~kris/9p

9hist

a06d881670d211e655d84f7ef8e8555c6b0f46df — David du Colombier 29 years ago 8dc045a
Plan 9 from Bell Labs 1997-07-18
1 files changed, 27 insertions(+), 6 deletions(-)

M pc/vgaclgd542x.c
M pc/vgaclgd542x.c => pc/vgaclgd542x.c +27 -6
@@ 17,10 17,21 @@ static Lock clgd542xlock;
static ulong storage;

static void
setclgd542xpage(int page)
{
	if(vgaxi(Seqx, 0x07) & 0xF0)
		page = 0;
	if(vgaxi(Seqx, 0x0B) & 0x20)
		vgaxo(Grx, 0x09, page<<2);
	else
		vgaxo(Grx, 0x09, page<<4);
}

static void
clgd542xpage(int page)
{
	lock(&clgd542xlock);
	vgaxo(Grx, 0x09, page<<4);
	setclgd542xpage(page);
	unlock(&clgd542xlock);
}



@@ 30,7 41,11 @@ clgd542xlinear(ulong* mem, ulong* size, ulong* align)
	ulong baseaddr;
	static Pcidev *p;

	if((*size && *size < 16*MB) || (*align && (*align & (16*MB-1))))
	if(*size != 16*MB)
		return 0;
	if(*align == 0)
		*align = 16*MB;
	else if(*align & (16*MB-1))
		return 0;

	*mem = 0;


@@ 53,6 68,10 @@ clgd542xlinear(ulong* mem, ulong* size, ulong* align)
		return 0;
	}

	/*
	 * This doesn't work if the card is on the other side of a
	 * a bridge. Need to coordinate with PCI support.
	 */
	if((baseaddr = upamalloc(0, *size, *align)) == 0)
		return 0;
	*mem = baseaddr;


@@ 157,12 176,10 @@ initcursor(Cursor* c, int xo, int yo, int index)
	if(vgaxi(Seqx, 0x07) & 0xF0)
		p = ((uchar*)gscreen.base) + storage;
	else {
		vgaxo(Grx, 0x09, (storage>>16)<<4);
		setclgd542xpage(storage>>16);
		p = ((uchar*)gscreen.base) + (storage & 0xFFFF);
	}
//	p += index*1024;
memset(p, 0xFF, 16*1024);
return;
	p += index*1024;

	for(y = yo; y < 16; y++){
		p0 = c->clr[2*y];


@@ 228,6 245,10 @@ load(Cursor* c)
	 */
	vgaxo(Seqx, 0x13, 0);
	vgaxo(Seqx, 0x12, sr12|0x05);
{
for(storage = 0; storage < (2048-32)*1024; storage += 16*1024)
    initcursor(c, 0, 0, 0);
}

	unlock(&clgd542xlock);
}