summaryrefslogtreecommitdiffstats
path: root/libdha
diff options
context:
space:
mode:
authoralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-21 21:36:30 +0000
committeralex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-21 21:36:30 +0000
commit09b8a53e164afcc435ab48a4c5228efed0221928 (patch)
treea23d8ffcdc128e9955c80dccfd9be57591cdd067 /libdha
parent63d8cbd8bc6864db13618f5288204d134b13062d (diff)
downloadmpv-09b8a53e164afcc435ab48a4c5228efed0221928.tar.bz2
mpv-09b8a53e164afcc435ab48a4c5228efed0221928.tar.xz
openbsd xf86 aperture support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14568 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libdha')
-rw-r--r--libdha/libdha.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libdha/libdha.c b/libdha/libdha.c
index f6ff7e664f..328df4d87a 100644
--- a/libdha/libdha.c
+++ b/libdha/libdha.c
@@ -50,6 +50,10 @@
# endif
# endif /* SVR4 */
+#if defined(__OpenBSD__)
+#define DEV_APERTURE "/dev/xf86"
+#endif
+
/* Generic version */
#include <sys/mman.h>
@@ -117,6 +121,20 @@ dha_helper_way:
#endif
dev_mem_way:
+#ifdef DEV_APERTURE
+ if ((mem_fd = open(DEV_APERTURE, O_RDWR)) == -1)
+ perror("libdha: opening aperture failed");
+ else {
+ void *p = mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,mem_fd,base);
+
+ if (p == MAP_FAILED) {
+ perror("libdha: mapping aperture failed");
+ close(mem_fd);
+ } else
+ return p;
+ }
+#endif
+
if ( (mem_fd = open(DEV_MEM,O_RDWR)) == -1)
{
perror("libdha: opening /dev/mem failed");