diff -aur xc/programs/Xserver/hw/xfree86/loader/xf86sym.c xc-new/programs/Xserver/hw/xfree86/loader/xf86sym.c --- xc/programs/Xserver/hw/xfree86/loader/xf86sym.c 2005-04-30 09:59:13.062097392 -0400 +++ xc-new/programs/Xserver/hw/xfree86/loader/xf86sym.c 2005-04-30 10:08:33.757858680 -0400 @@ -293,6 +293,7 @@ SYMFUNC(xf86AllocateGARTMemory) SYMFUNC(xf86BindGARTMemory) SYMFUNC(xf86UnbindGARTMemory) + SYMFUNC(xf86DeallocateGARTMemory) SYMFUNC(xf86EnableAGP) SYMFUNC(xf86SoundKbdBell) SYMFUNC(xf86GARTCloseScreen) diff -aur xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c xc-new/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c --- xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c 2005-04-30 09:09:03.000000000 -0400 +++ xc-new/programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c 2005-04-30 10:06:49.063774600 -0400 @@ -319,6 +319,29 @@ return TRUE; } +Bool +xf86DeallocateGARTMemory(int screenNum, int key) +{ + if (!GARTInit(screenNum) || acquiredScreen != screenNum) + return FALSE; + + if (acquiredScreen != screenNum) { + xf86DrvMsg(screenNum, X_ERROR, + "xf86UnbindGARTMemory: AGP not acquired by this screen\n"); + return FALSE; + } + + if (ioctl(gartFd, AGPIOC_DEALLOCATE, (char *)key) != 0) { + xf86DrvMsg(screenNum, X_WARNING,"xf86DeAllocateGARTMemory: " + "deallocation gart memory with key %d failed\n\t(%s)\n", + key, strerror(errno)); + return FALSE; + } + + return TRUE; + +} + /* XXX Interface may change. */ Bool diff -aur xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c xc-new/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c --- xc/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c 2005-04-30 09:09:09.000000000 -0400 +++ xc-new/programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c 2005-04-30 10:07:48.766698376 -0400 @@ -91,6 +91,13 @@ return FALSE; } + +Bool +xf86DeallocateGARTMemory(int screenNum, int key) +{ + return FALSE; +} + Bool xf86EnableAGP(int screenNum, CARD32 mode) { diff -aur xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h xc-new/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h --- xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h 2005-04-30 09:08:54.000000000 -0400 +++ xc-new/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h 2005-04-30 10:06:39.772187136 -0400 @@ -196,6 +196,7 @@ unsigned long *physical); extern Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset); extern Bool xf86UnbindGARTMemory(int screenNum, int key); +extern Bool xf86DeallocateGARTMemory(int screenNum, int key); extern Bool xf86EnableAGP(int screenNum, CARD32 mode); extern Bool xf86GARTCloseScreen(int screenNum);