From 079ad773e09ed0c5baf01de3d4f02a5568da5634 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Wed, 24 Aug 2005 22:37:15 +0000 Subject: [PATCH] Fill in xf86DeallocateGARTMemory stub based on lnx_agp.c version. Add include of xorg-config.h for modular builds --- hw/xfree86/os-support/solaris/sun_agp.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/os-support/solaris/sun_agp.c b/hw/xfree86/os-support/solaris/sun_agp.c index a85e9ecf2..ce35ea88b 100644 --- a/hw/xfree86/os-support/solaris/sun_agp.c +++ b/hw/xfree86/os-support/solaris/sun_agp.c @@ -37,6 +37,10 @@ #pragma ident "@(#)sun_agp.c 1.1 05/04/04 SMI" +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + #include #include "xf86.h" #include "xf86Priv.h" @@ -238,7 +242,17 @@ xf86AllocateGARTMemory(int screenNum, unsigned long size, int type, Bool xf86DeallocateGARTMemory(int screenNum, int key) { - return FALSE; + if (!GARTInit(screenNum) || (acquiredScreen != screenNum)) + return FALSE; + + if (ioctl(gartFd, AGPIOC_DEALLOCATE, (int *)key) != 0) { + xf86DrvMsg(screenNum, X_WARNING, "xf86DeAllocateGARTMemory: " + "deallocation of gart memory with key %d failed\n" + "\t(%s)\n", key, strerror(errno)); + return FALSE; + } + + return TRUE; } /* Bind GART memory with "key" at "offset" */