plan 9 kernel history: overview | file list | diff list

2001/0527/pc/vgacyber938x.c (diff list | history)

1998/0205/sys/src/9/pc/vgacyber938x.c:71,1091998/0209/sys/src/9/pc/vgacyber938x.c:71,76 (short | long)
1998/0205    
} 
 
static void 
cyber938xcurenable(VGAscr* scr) 
{ 
	int i; 
	ulong storage; 
                 
	cyber938xcurdisable(scr); 
                 
	/* 
	 * Cursor colours. 
	 */ 
	for(i = 0x48; i < 0x4C; i++) 
		vgaxo(Crtx, i, Pwhite); 
	for(i = 0x4C; i < 0x50; i++) 
		vgaxo(Crtx, i, Pblack); 
                 
	/* 
	 * Find a place for the cursor data in display memory. 
	 */ 
	storage = ((scr->gscreen->width*BY2WD*scr->gscreen->r.max.y+1023)/1024)*2; 
	vgaxo(Crtx, 0x44, storage & 0xFF); 
	vgaxo(Crtx, 0x45, (storage>>8) & 0xFF); 
	storage *= 512; 
	scr->storage = storage; 
                 
	/* 
	 * Enable the 32x32 cursor. 
	 * (64x64 is bit 0, X11 format is bit 6 and 
	 * cursor enable is bit 7). 
	 */ 
	vgaxo(Crtx, 0x50, 0xC0); 
} 
                 
static void 
cyber938xcurload(VGAscr* scr, Cursor* curs) 
{ 
	uchar *p; 
1998/0205/sys/src/9/pc/vgacyber938x.c:207,2121998/0209/sys/src/9/pc/vgacyber938x.c:174,214
1998/0205    
	vgaxo(Crtx, 0x43, (y>>8) & 0xFF); 
 
	return 0; 
1998/0209    
} 
 
static void 
cyber938xcurenable(VGAscr* scr) 
{ 
	int i; 
	ulong storage; 
 
	cyber938xcurdisable(scr); 
 
	/* 
	 * Cursor colours. 
	 */ 
	for(i = 0x48; i < 0x4C; i++) 
		vgaxo(Crtx, i, Pwhite); 
	for(i = 0x4C; i < 0x50; i++) 
		vgaxo(Crtx, i, Pblack); 
 
	/* 
	 * Find a place for the cursor data in display memory. 
	 */ 
	storage = ((scr->gscreen->width*BY2WD*scr->gscreen->r.max.y+1023)/1024)*2; 
	vgaxo(Crtx, 0x44, storage & 0xFF); 
	vgaxo(Crtx, 0x45, (storage>>8) & 0xFF); 
	storage *= 512; 
	scr->storage = storage; 
 
	/* 
	 * Load, locate and enable the 32x32 cursor. 
	 * (64x64 is bit 0, X11 format is bit 6 and cursor 
	 * enable is bit 7). 
	 */ 
	cyber938xcurload(scr, &arrow); 
	cyber938xcurmove(scr, ZP); 
	vgaxo(Crtx, 0x50, 0xC0); 
1998/0205    
} 
 
VGAdev vgacyber938xdev = { 
1998/0209/sys/src/9/pc/vgacyber938x.c:137,1431998/0214/sys/src/9/pc/vgacyber938x.c:137,143 (short | long)
1998/0205    
	 * Save the cursor hotpoint and enable the cursor. 
	 */ 
	scr->offset = curs->offset; 
	vgaxo(Crtx, 0x50, 0xC0); 
1998/0214    
	vgaxo(Crtx, 0x50, 0xC8); 
1998/0205    
} 
 
static int 
1998/0209/sys/src/9/pc/vgacyber938x.c:204,2141998/0214/sys/src/9/pc/vgacyber938x.c:204,215
1998/0209    
	/* 
	 * Load, locate and enable the 32x32 cursor. 
	 * (64x64 is bit 0, X11 format is bit 6 and cursor 
	 * enable is bit 7). 
1998/0214    
	 * enable is bit 7). Bit 3 needs to be set on 9382 
	 * chips otherwise even the white bits are black. 
1998/0209    
	 */ 
	cyber938xcurload(scr, &arrow); 
	cyber938xcurmove(scr, ZP); 
	vgaxo(Crtx, 0x50, 0xC0); 
1998/0214    
	vgaxo(Crtx, 0x50, 0xC8); 
1998/0205    
} 
 
VGAdev vgacyber938xdev = { 
1998/0214/sys/src/9/pc/vgacyber938x.c:108,1141998/0522/sys/src/9/pc/vgacyber938x.c:108,114 (short | long)
Comment edit.
rsc Fri Mar 4 12:44:25 2005
1998/0205    
	 * without a proper datasheet this is what binary search 
	 * through the display memory gives as the place for the 
	 * pattern. 
	 * Note also that is seems the cursor image offset (CRT44 
1998/0522    
	 * Note also that it seems the cursor image offset (CRT44 
1998/0205    
	 * and CRT45) cannot be set above 512KB. 
	 * This will do for now as the ThinkPad 560E has 1MB and 
	 * can only manage 800x600x8. 
1998/0522/sys/src/9/pc/vgacyber938x.c:11,161998/0829/sys/src/9/pc/vgacyber938x.c:11,21 (short | long)
1998/0205    
#include <memdraw.h> 
#include "screen.h" 
 
1998/0829    
enum { 
	CursorON	= 0xC8, 
	CursorOFF	= 0x00, 
}; 
 
1998/0205    
static int 
cyber938xpageset(VGAscr*, int page) 
{ 
1998/0522/sys/src/9/pc/vgacyber938x.c:67,731998/0829/sys/src/9/pc/vgacyber938x.c:72,78
1998/0205    
static void 
cyber938xcurdisable(VGAscr*) 
{ 
	vgaxo(Crtx, 0x50, 0); 
1998/0829    
	vgaxo(Crtx, 0x50, CursorOFF); 
1998/0205    
} 
 
static void 
1998/0522/sys/src/9/pc/vgacyber938x.c:94,1321998/0829/sys/src/9/pc/vgacyber938x.c:99,110
1998/0205    
		*p++ = curs->set[2*y + 1]|curs->clr[2*y + 1]; 
		*p++ = 0x00; 
		*p++ = 0x00; 
	} 
	while(y < 32){ 
		*p++ = 0x00; 
		*p++ = 0x00; 
		*p++ = 0x00; 
		*p++ = 0x00; 
		y++; 
	} 
                 
	/* 
	 * This is clearly not what's supposed to be done, but 
	 * without a proper datasheet this is what binary search 
	 * through the display memory gives as the place for the 
	 * pattern. 
1998/0522    
	 * Note also that it seems the cursor image offset (CRT44 
1998/0205    
	 * and CRT45) cannot be set above 512KB. 
	 * This will do for now as the ThinkPad 560E has 1MB and 
	 * can only manage 800x600x8. 
	 */ 
	p += 512*1024 - 128; 
	for(y = 0; y < 16; y++){ 
		*p++ = curs->set[2*y]; 
		*p++ = curs->set[2*y + 1]; 
		*p++ = 0x00; 
		*p++ = 0x00; 
	} 
	while(y < 32){ 
		*p++ = 0x00; 
		*p++ = 0x00; 
		*p++ = 0x00; 
		*p++ = 0x00; 
		y++; 
	} 
1998/0829    
	memset(p, 0, (32-y)*8); 
1998/0205    
 
	if(!islinear){ 
		cyber938xpageset(scr, opage); 
1998/0522/sys/src/9/pc/vgacyber938x.c:137,1431998/0829/sys/src/9/pc/vgacyber938x.c:115,121
1998/0205    
	 * Save the cursor hotpoint and enable the cursor. 
	 */ 
	scr->offset = curs->offset; 
1998/0214    
	vgaxo(Crtx, 0x50, 0xC8); 
1998/0829    
	vgaxo(Crtx, 0x50, CursorON); 
1998/0205    
} 
 
static int 
1998/0522/sys/src/9/pc/vgacyber938x.c:195,2041998/0829/sys/src/9/pc/vgacyber938x.c:173,182
1998/0209    
	/* 
	 * Find a place for the cursor data in display memory. 
	 */ 
	storage = ((scr->gscreen->width*BY2WD*scr->gscreen->r.max.y+1023)/1024)*2; 
1998/0829    
	storage = ((scr->gscreen->width*BY2WD*scr->gscreen->r.max.y+1023)/1024); 
1998/0209    
	vgaxo(Crtx, 0x44, storage & 0xFF); 
	vgaxo(Crtx, 0x45, (storage>>8) & 0xFF); 
	storage *= 512; 
1998/0829    
	storage *= 1024; 
1998/0209    
	scr->storage = storage; 
 
	/* 
1998/0522/sys/src/9/pc/vgacyber938x.c:209,2151998/0829/sys/src/9/pc/vgacyber938x.c:187,193
1998/0209    
	 */ 
	cyber938xcurload(scr, &arrow); 
	cyber938xcurmove(scr, ZP); 
1998/0214    
	vgaxo(Crtx, 0x50, 0xC8); 
1998/0829    
	vgaxo(Crtx, 0x50, CursorON); 
1998/0205    
} 
 
VGAdev vgacyber938xdev = { 
1998/0829/sys/src/9/pc/vgacyber938x.c:9,141999/0119/sys/src/9/pc/vgacyber938x.c:9,15 (short | long)
1998/0205    
#define	Image	IMAGE 
#include <draw.h> 
#include <memdraw.h> 
1999/0119    
#include <cursor.h> 
1998/0205    
#include "screen.h" 
 
1998/0829    
enum { 
1999/0119/sys/src/9/pc/vgacyber938x.c:167,1751999/1005/sys/src/9/pc/vgacyber938x.c:167,175 (short | long)
1998/0209    
	 * Cursor colours. 
	 */ 
	for(i = 0x48; i < 0x4C; i++) 
		vgaxo(Crtx, i, Pwhite); 
1999/1005    
		vgaxo(Crtx, i, 0x00); 
1998/0209    
	for(i = 0x4C; i < 0x50; i++) 
		vgaxo(Crtx, i, Pblack); 
1999/1005    
		vgaxo(Crtx, i, 0xFF); 
1998/0209    
 
	/* 
	 * Find a place for the cursor data in display memory. 
1999/1005/sys/src/9/pc/vgacyber938x.c:43,502001/0410/sys/src/9/pc/vgacyber938x.c:43,52 (short | long)
1998/0205    
{ 
	ulong aperture, oaperture; 
	int oapsize, wasupamem; 
2001/0410    
	int osize; 
1998/0205    
	Pcidev *p; 
 
2001/0410    
	osize = *size; 
1998/0205    
	oaperture = scr->aperture; 
	oapsize = scr->apsize; 
	wasupamem = scr->isupamem; 
1999/1005/sys/src/9/pc/vgacyber938x.c:51,602001/0410/sys/src/9/pc/vgacyber938x.c:53,69
1998/0205    
	if(wasupamem) 
		upafree(oaperture, oapsize); 
	scr->isupamem = 0; 
2001/0410    
	scr->mmio = 0; 
1998/0205    
 
	if(p = pcimatch(nil, 0x1023, 0)){ 
		aperture = p->mem[0].bar & ~0x0F; 
		*size = p->mem[0].size; 
2001/0410    
		/* 
		 * Heuristic to detect the MMIO space.  We're flying blind 
		 * here, with only the XFree86 source to guide us. 
		 */ 
		if(p->mem[1].size == 0x20000) 
			scr->mmio = (ulong*)(p->mem[1].bar & ~0x0F); 
1998/0205    
	} 
	else 
		aperture = 0; 
1999/1005/sys/src/9/pc/vgacyber938x.c:67,722001/0410/sys/src/9/pc/vgacyber938x.c:76,86
1998/0205    
	else 
		scr->isupamem = 1; 
 
2001/0410    
	if(aperture) 
		addvgaseg("cyber938xscreen", aperture, osize); 
	if(scr->mmio) 
		addvgaseg("cyber938xmmio", (ulong)scr->mmio, 0x20000); 
 
1998/0205    
	return aperture; 
} 
 
1999/1005/sys/src/9/pc/vgacyber938x.c:191,1962001/0410/sys/src/9/pc/vgacyber938x.c:205,215
1998/0829    
	vgaxo(Crtx, 0x50, CursorON); 
1998/0205    
} 
 
2001/0410    
static void 
cyber938xdrawinit(VGAscr *scr) 
{ 
} 
 
1998/0205    
VGAdev vgacyber938xdev = { 
	"cyber938x", 
 
1999/1005/sys/src/9/pc/vgacyber938x.c:198,2032001/0410/sys/src/9/pc/vgacyber938x.c:217,223
1998/0205    
	0,				/* disable */ 
	cyber938xpage,			/* page */ 
	cyber938xlinear,		/* linear */ 
2001/0410    
	cyber938xdrawinit,		/* drawinit */ 
1998/0205    
}; 
 
VGAcur vgacyber938xcur = { 
2001/0410/sys/src/9/pc/vgacyber938x.c:205,2232001/0430/sys/src/9/pc/vgacyber938x.c:205,218 (short | long)
1998/0829    
	vgaxo(Crtx, 0x50, CursorON); 
1998/0205    
} 
 
2001/0410    
static void 
cyber938xdrawinit(VGAscr *scr) 
{ 
} 
                 
1998/0205    
VGAdev vgacyber938xdev = { 
	"cyber938x", 
 
	0,				/* enable */ 
	0,				/* disable */ 
2001/0430    
	nil,				/* enable */ 
	nil,				/* disable */ 
1998/0205    
	cyber938xpage,			/* page */ 
	cyber938xlinear,		/* linear */ 
2001/0410    
	cyber938xdrawinit,		/* drawinit */ 
2001/0430    
	nil,				/* drawinit */ 
1998/0205    
}; 
 
VGAcur vgacyber938xcur = { 
2001/0430/sys/src/9/pc/vgacyber938x.c:43,522001/0527/sys/src/9/pc/vgacyber938x.c:43,50 (short | long)
1998/0205    
{ 
	ulong aperture, oaperture; 
	int oapsize, wasupamem; 
2001/0410    
	int osize; 
1998/0205    
	Pcidev *p; 
 
2001/0410    
	osize = *size; 
1998/0205    
	oaperture = scr->aperture; 
	oapsize = scr->apsize; 
	wasupamem = scr->isupamem; 
2001/0430/sys/src/9/pc/vgacyber938x.c:53,692001/0527/sys/src/9/pc/vgacyber938x.c:51,60
1998/0205    
	if(wasupamem) 
		upafree(oaperture, oapsize); 
	scr->isupamem = 0; 
2001/0410    
	scr->mmio = 0; 
1998/0205    
 
	if(p = pcimatch(nil, 0x1023, 0)){ 
		aperture = p->mem[0].bar & ~0x0F; 
		*size = p->mem[0].size; 
2001/0410    
		/* 
		 * Heuristic to detect the MMIO space.  We're flying blind 
		 * here, with only the XFree86 source to guide us. 
		 */ 
		if(p->mem[1].size == 0x20000) 
			scr->mmio = (ulong*)(p->mem[1].bar & ~0x0F); 
1998/0205    
	} 
	else 
		aperture = 0; 
2001/0430/sys/src/9/pc/vgacyber938x.c:76,862001/0527/sys/src/9/pc/vgacyber938x.c:67,72
1998/0205    
	else 
		scr->isupamem = 1; 
 
2001/0410    
	if(aperture) 
		addvgaseg("cyber938xscreen", aperture, osize); 
	if(scr->mmio) 
		addvgaseg("cyber938xmmio", (ulong)scr->mmio, 0x20000); 
                 
1998/0205    
	return aperture; 
} 
 
2001/0430/sys/src/9/pc/vgacyber938x.c:208,2182001/0527/sys/src/9/pc/vgacyber938x.c:194,203
1998/0205    
VGAdev vgacyber938xdev = { 
	"cyber938x", 
 
2001/0430    
	nil,				/* enable */ 
	nil,				/* disable */ 
2001/0527    
	0,				/* enable */ 
	0,				/* disable */ 
1998/0205    
	cyber938xpage,			/* page */ 
	cyber938xlinear,		/* linear */ 
2001/0430    
	nil,				/* drawinit */ 
1998/0205    
}; 
 
VGAcur vgacyber938xcur = { 
2001/0527/sys/src/9/pc/vgacyber938x.c:43,502001/0908/sys/src/9/pc/vgacyber938x.c:43,52 (short | long)
1998/0205    
{ 
	ulong aperture, oaperture; 
	int oapsize, wasupamem; 
2001/0908    
	int osize; 
1998/0205    
	Pcidev *p; 
 
2001/0908    
	osize = *size; 
1998/0205    
	oaperture = scr->aperture; 
	oapsize = scr->apsize; 
	wasupamem = scr->isupamem; 
2001/0527/sys/src/9/pc/vgacyber938x.c:51,602001/0908/sys/src/9/pc/vgacyber938x.c:53,69
1998/0205    
	if(wasupamem) 
		upafree(oaperture, oapsize); 
	scr->isupamem = 0; 
2001/0908    
	scr->mmio = 0; 
1998/0205    
 
	if(p = pcimatch(nil, 0x1023, 0)){ 
		aperture = p->mem[0].bar & ~0x0F; 
		*size = p->mem[0].size; 
2001/0908    
		/* 
		 * Heuristic to detect the MMIO space.  We're flying blind 
		 * here, with only the XFree86 source to guide us. 
		 */ 
		if(p->mem[1].size == 0x20000) 
			scr->mmio = (ulong*)(p->mem[1].bar & ~0x0F); 
1998/0205    
	} 
	else 
		aperture = 0; 
2001/0527/sys/src/9/pc/vgacyber938x.c:67,722001/0908/sys/src/9/pc/vgacyber938x.c:76,86
1998/0205    
	else 
		scr->isupamem = 1; 
 
2001/0908    
	if(aperture) 
		addvgaseg("cyber938xscreen", aperture, osize); 
	if(scr->mmio) 
		addvgaseg("cyber938xmmio", (ulong)scr->mmio, 0x20000); 
 
1998/0205    
	return aperture; 
} 
 
2001/0527/sys/src/9/pc/vgacyber938x.c:194,2032001/0908/sys/src/9/pc/vgacyber938x.c:208,218
1998/0205    
VGAdev vgacyber938xdev = { 
	"cyber938x", 
 
2001/0527    
	0,				/* enable */ 
	0,				/* disable */ 
2001/0908    
	nil,				/* enable */ 
	nil,				/* disable */ 
1998/0205    
	cyber938xpage,			/* page */ 
	cyber938xlinear,		/* linear */ 
2001/0908    
	nil,				/* drawinit */ 
1998/0205    
}; 
 
VGAcur vgacyber938xcur = { 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)