summaryrefslogtreecommitdiff
path: root/xserver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2007-11-25 18:41:24 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2007-11-25 18:41:24 +0000
commitb2d2360111ee36cb6e840a3a9357e00c1f8206c1 (patch)
treedae07db3483c9e29dca2f5139c91cbb0ac0edd57 /xserver
parent417f076b9eb20b5b90e2a8363e191faaefe57661 (diff)
Support the new AGP device. Work by oga@ and me, with some ideas from
dim@ long ago.
Diffstat (limited to 'xserver')
-rw-r--r--xserver/hw/xfree86/os-support/bsd/bsd_agp.c15
-rw-r--r--xserver/hw/xfree86/os-support/bsd/i386_video.c1
-rw-r--r--xserver/os/privsep.c3
3 files changed, 11 insertions, 8 deletions
diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_agp.c b/xserver/hw/xfree86/os-support/bsd/bsd_agp.c
index cc1231d9a..3930264a5 100644
--- a/xserver/hw/xfree86/os-support/bsd/bsd_agp.c
+++ b/xserver/hw/xfree86/os-support/bsd/bsd_agp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bsd_agp.c,v 1.1 2006/11/28 20:29:31 matthieu Exp $ */
+/* $OpenBSD: bsd_agp.c,v 1.2 2007/11/25 18:41:23 matthieu Exp $ */
/*
* Abstraction of the AGP GART interface.
*
@@ -33,7 +33,7 @@ static int acquiredScreen = -1;
static Bool initDone = FALSE;
/*
- * Close /dev/agpgart. This frees all associated memory allocated during
+ * Close the AGP device. This frees all associated memory allocated during
* this server generation.
*/
Bool
@@ -48,7 +48,7 @@ xf86GARTCloseScreen(int screenNum)
}
/*
- * Open /dev/agpgart. Keep it open until xf86GARTCloseScreen is called.
+ * Open the AGP device. Keep it open until xf86GARTCloseScreen is called.
*/
static Bool
GARTInit(int screenNum)
@@ -60,11 +60,14 @@ GARTInit(int screenNum)
initDone = TRUE;
- if (gartFd == -1)
- gartFd = xf86Info.consoleFd;
- else
+ if (gartFd != -1)
return FALSE;
+ gartFd = priv_open_device(AGP_DEVICE);
+ if (gartFd == -1 && errno == ENOENT) {
+ /* try the old interface */
+ gartFd = xf86Info.consoleFd;
+ }
xf86AcquireGART(-1);
/* Check the kernel driver version. */
if (ioctl(gartFd, AGPIOC_INFO, &agpinf) != 0) {
diff --git a/xserver/hw/xfree86/os-support/bsd/i386_video.c b/xserver/hw/xfree86/os-support/bsd/i386_video.c
index e4065a839..303cea449 100644
--- a/xserver/hw/xfree86/os-support/bsd/i386_video.c
+++ b/xserver/hw/xfree86/os-support/bsd/i386_video.c
@@ -997,6 +997,5 @@ xf86PrivilegedInit(void)
checkDevMem(TRUE);
xf86EnableIO();
xf86OpenConsole();
- xf86AgpGARTSupported();
}
#endif
diff --git a/xserver/os/privsep.c b/xserver/os/privsep.c
index ddcf12d92..98b1b5c78 100644
--- a/xserver/os/privsep.c
+++ b/xserver/os/privsep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: privsep.c,v 1.1 2006/11/28 20:29:32 matthieu Exp $ */
+/* $OpenBSD: privsep.c,v 1.2 2007/11/25 18:41:23 matthieu Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -104,6 +104,7 @@ static const char * const allowed_devices[] = {
"/dev/ttyD6",
"/dev/ttyD7",
"/dev/pci",
+ "/dev/agp0",
NULL
};