diff -ur modules/nvidia-kernel/nv/nv-linux.h modules_new/nvidia-kernel/nv/nv-linux.h --- modules/nvidia-kernel/nv/nv-linux.h 2004-11-12 14:14:20.000000000 -0500 +++ modules_new/nvidia-kernel/nv/nv-linux.h 2005-01-18 23:25:03.000000000 -0500 @@ -854,6 +854,9 @@ /* lock for linux-specific alloc queue */ struct semaphore at_lock; + + /* AGP handle. */ + struct agp_bridge_data *agp_bridge; } nv_linux_state_t; diff -ur modules/nvidia-kernel/nv/os-agp.c modules_new/nvidia-kernel/nv/os-agp.c --- modules/nvidia-kernel/nv/os-agp.c 2004-11-12 14:14:20.000000000 -0500 +++ modules_new/nvidia-kernel/nv/os-agp.c 2005-01-18 23:22:51.000000000 -0500 @@ -70,6 +70,7 @@ U032 agp_fw; void *bitmap; U032 bitmap_size; + nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); memset( (void *) &gart, 0, sizeof(agp_gart)); @@ -82,7 +83,7 @@ * the memory controller. */ - if (drm_agp_p->acquire()) + if (!(nvl->agp_bridge = drm_agp_p->acquire(nvl->dev))) { nv_printf(NV_DBG_ERRORS, "NVRM: AGPGART: backend in use\n"); inter_module_put("drm_agp"); @@ -110,7 +111,7 @@ */ drm_agp_p->copy_info(&agpinfo); #else - if (drm_agp_p->copy_info(&agpinfo)) { + if (drm_agp_p->copy_info(nvl->agp_bridge, &agpinfo)) { nv_printf(NV_DBG_ERRORS, "NVRM: AGPGART: kernel reports chipset as unsupported\n"); goto failed; @@ -170,7 +171,7 @@ if (!(agp_rate & 0x00000004)) agpinfo.mode &= ~0x00000004; if (!(agp_rate & 0x00000002)) agpinfo.mode &= ~0x00000002; - drm_agp_p->enable(agpinfo.mode); + drm_agp_p->enable(nvl->agp_bridge, agpinfo.mode); *ap_phys_base = (void*) agpinfo.aper_base; *ap_mapped_base = (void*) gart.aperture; @@ -182,7 +183,7 @@ failed: MTRR_DEL(gart); /* checks gart.mtrr */ - drm_agp_p->release(); + drm_agp_p->release(nvl->agp_bridge); inter_module_put("drm_agp"); return -1; @@ -198,6 +199,7 @@ return 1; #else void *bitmap; + nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); /* sanity check to make sure we should actually be here. */ if (!gart.ready) @@ -213,7 +215,7 @@ NV_IOUNMAP(gart.aperture, RM_PAGE_SIZE); } - drm_agp_p->release(); + drm_agp_p->release(nvl->agp_bridge); inter_module_put("drm_agp"); @@ -247,6 +249,7 @@ int err; agp_priv_data *data; RM_STATUS status; + nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv); if (!gart.ready) { @@ -262,7 +265,7 @@ return RM_ERROR; } - ptr = drm_agp_p->allocate_memory(PageCount, AGP_NORMAL_MEMORY); + ptr = drm_agp_p->allocate_memory(nvl->agp_bridge, PageCount, AGP_NORMAL_MEMORY); if (ptr == NULL) { *pAddress = (void*) 0;