agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) 
agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB) 
static void intel_i830_init_gtt_entries(void){	u16 gmch_ctrl;	int gtt_entries;	u8 rdct;	int local = 0;	static const int ddt[4] = { 0, 16, 32, 64 };	int size;	pci_read_config_word(agp_bridge->dev,I830_GMCH_CTRL,&gmch_ctrl);	/* We obtain the size of the GTT, which is also stored (for some	 * reason) at the top of stolen memory. Then we add 4KB to that	 * for the video BIOS popup, which is also stored in there. */	size = agp_bridge->driver->fetch_size() + 4;	if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82830_HB ||	    agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82845G_HB) {		switch (gmch_ctrl & I830_GMCH_GMS_MASK) {		case I830_GMCH_GMS_STOLEN_512:			gtt_entries = KB(512) - KB(size);			break;		case I830_GMCH_GMS_STOLEN_1024:			gtt_entries = MB(1) - KB(size);			break;		case I830_GMCH_GMS_STOLEN_8192:			gtt_entries = MB(8) - KB(size);			break;		case I830_GMCH_GMS_LOCAL:			rdct = readb(intel_i830_private.registers+I830_RDRAM_CHANNEL_TYPE);			gtt_entries = (I830_RDRAM_ND(rdct) + 1) *					MB(ddt[I830_RDRAM_DDT(rdct)]);			local = 1;			break;		default:			gtt_entries = 0;			break;		}	} else {		switch (gmch_ctrl & I830_GMCH_GMS_MASK) {		case I855_GMCH_GMS_STOLEN_1M:			gtt_entries = MB(1) - KB(size);			break;		case I855_GMCH_GMS_STOLEN_4M:			gtt_entries = MB(4) - KB(size);			break;		case I855_GMCH_GMS_STOLEN_8M:			gtt_entries = MB(8) - KB(size);			break;		case I855_GMCH_GMS_STOLEN_16M:			gtt_entries = MB(16) - KB(size);			break;		case I855_GMCH_GMS_STOLEN_32M:			gtt_entries = MB(32) - KB(size);			break;		case I915_GMCH_GMS_STOLEN_48M:			/* Check it's really I915G */			if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB ||			    agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB)				gtt_entries = MB(48) - KB(size);			else				gtt_entries = 0;			break;		case I915_GMCH_GMS_STOLEN_64M:			/* Check it's really I915G */			if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB ||			    agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB)				gtt_entries = MB(64) - KB(size);			else				gtt_entries = 0;		default:			gtt_entries = 0;			break;		}	}	if (gtt_entries > 0)		printk(KERN_INFO PFX "Detected %dK %s memory.\n",		       gtt_entries / KB(1), local ? "local" : "stolen");	else		printk(KERN_INFO PFX		       "No pre-allocated video memory detected.\n");	gtt_entries /= KB(4);	intel_i830_private.gtt_entries = gtt_entries;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/d0de98fa16169562bd74913c6c9b3857f9065c79/intel-agp.c/buggy/drivers/char/agp/intel-agp.c