summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Hourihane <alanh@fairlite.demon.co.uk>2005-07-19 20:51:46 +0000
committerAlan Hourihane <alanh@fairlite.demon.co.uk>2005-07-19 20:51:46 +0000
commitbf32f4739c6ef7f41cde6cc409d42e00462402fb (patch)
treef5facaf4d712458422514375f07beac1a3e9d91d
parent931abdba8410bf1188d69d54c57543a21ea36968 (diff)
programs/Xserver/hw/xfree86/os-support/shared/agp_noop.c
programs/Xserver/hw/xfree86/os-support/linux/lnx_agp.c programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h //bugs.freedesktop.org/show_bug.cgi?id=3164> Add xf86DeallocateGARTMemory() function call (Austin Yuan)
-rw-r--r--hw/xfree86/loader/xf86sym.c1
-rw-r--r--hw/xfree86/os-support/linux/lnx_agp.c21
-rw-r--r--hw/xfree86/os-support/shared/agp_noop.c5
-rw-r--r--hw/xfree86/os-support/xf86_OSproc.h1
4 files changed, 28 insertions, 0 deletions
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 70aec096b..a2d0af919 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -295,6 +295,7 @@ LOOKUP xfree86LookupTab[] = {
SYMFUNC(xf86AcquireGART)
SYMFUNC(xf86ReleaseGART)
SYMFUNC(xf86AllocateGARTMemory)
+ SYMFUNC(xf86DeallocateGARTMemory)
SYMFUNC(xf86BindGARTMemory)
SYMFUNC(xf86UnbindGARTMemory)
SYMFUNC(xf86EnableAGP)
diff --git a/hw/xfree86/os-support/linux/lnx_agp.c b/hw/xfree86/os-support/linux/lnx_agp.c
index 7a2b0606b..5fca1f7fa 100644
--- a/hw/xfree86/os-support/linux/lnx_agp.c
+++ b/hw/xfree86/os-support/linux/lnx_agp.c
@@ -248,6 +248,27 @@ xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
return alloc.key;
}
+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;
+}
/* Bind GART memory with "key" at "offset" */
Bool
diff --git a/hw/xfree86/os-support/shared/agp_noop.c b/hw/xfree86/os-support/shared/agp_noop.c
index dc176fec9..c13b29c38 100644
--- a/hw/xfree86/os-support/shared/agp_noop.c
+++ b/hw/xfree86/os-support/shared/agp_noop.c
@@ -81,6 +81,11 @@ xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
return -1;
}
+Bool
+xf86DeallocateGARTMemory(int screenNum, int key)
+{
+ return FALSE;
+}
Bool
xf86BindGARTMemory(int screenNum, int key, unsigned long offset)
diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h
index 391baebc6..555e7eef1 100644
--- a/hw/xfree86/os-support/xf86_OSproc.h
+++ b/hw/xfree86/os-support/xf86_OSproc.h
@@ -198,6 +198,7 @@ extern Bool xf86AcquireGART(int screenNum);
extern Bool xf86ReleaseGART(int screenNum);
extern int xf86AllocateGARTMemory(int screenNum, unsigned long size, int type,
unsigned long *physical);
+extern Bool xf86DeallocateGARTMemory(int screenNum, int key);
extern Bool xf86BindGARTMemory(int screenNum, int key, unsigned long offset);
extern Bool xf86UnbindGARTMemory(int screenNum, int key);
extern Bool xf86EnableAGP(int screenNum, CARD32 mode);