aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Hourihane2003-09-24 09:39:25 -0500
committerAlan Hourihane2003-09-24 09:39:25 -0500
commitb0a928557c91fec527f41ae8b2441174889bf32c (patch)
tree28cb1e418bcc54486fe052e3d17cc9cd0d3f92e3 /libdrm/xf86drm.c
parentdecf9e2297d87d646a4259f5d70290f105a487cd (diff)
downloadexternal-libgbm-b0a928557c91fec527f41ae8b2441174889bf32c.tar.gz
external-libgbm-b0a928557c91fec527f41ae8b2441174889bf32c.tar.xz
external-libgbm-b0a928557c91fec527f41ae8b2441174889bf32c.zip
post merge fix
Diffstat (limited to 'libdrm/xf86drm.c')
-rw-r--r--libdrm/xf86drm.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 6d5f4a6f..773c6d24 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -94,6 +94,10 @@ extern unsigned long _bus_base(void);
94#define DRM_MAJOR 34 94#define DRM_MAJOR 34
95#endif 95#endif
96 96
97# ifdef __OpenBSD__
98# define DRM_MAJOR 81
99# endif
100
97#ifndef DRM_MAJOR 101#ifndef DRM_MAJOR
98#define DRM_MAJOR 226 /* Linux */ 102#define DRM_MAJOR 226 /* Linux */
99#endif 103#endif
@@ -321,8 +325,10 @@ int drmAvailable(void)
321 int fd; 325 int fd;
322 326
323 if ((fd = drmOpenMinor(0, 1)) < 0) { 327 if ((fd = drmOpenMinor(0, 1)) < 0) {
328#ifdef __linux__
324 /* Try proc for backward Linux compatibility */ 329 /* Try proc for backward Linux compatibility */
325 if (!access("/proc/dri/0", R_OK)) return 1; 330 if (!access("/proc/dri/0", R_OK)) return 1;
331#endif
326 return 0; 332 return 0;
327 } 333 }
328 334
@@ -598,6 +604,7 @@ drmVersionPtr drmGetVersion(int fd)
598 version->desc = drmMalloc(version->desc_len + 1); 604 version->desc = drmMalloc(version->desc_len + 1);
599 605
600 if (ioctl(fd, DRM_IOCTL_VERSION, version)) { 606 if (ioctl(fd, DRM_IOCTL_VERSION, version)) {
607 drmMsg("DRM_IOCTL_VERSION: %s\n", strerror(errno));
601 drmFreeKernelVersion(version); 608 drmFreeKernelVersion(version);
602 return NULL; 609 return NULL;
603 } 610 }
@@ -1167,8 +1174,6 @@ int drmGetLock(int fd, drmContext context, drmLockFlags flags)
1167 return 0; 1174 return 0;
1168} 1175}
1169 1176
1170static void (*drm_unlock_callback)( void ) = 0;
1171
1172/** 1177/**
1173 * Release the hardware lock. 1178 * Release the hardware lock.
1174 * 1179 *
@@ -1412,7 +1417,8 @@ int drmAgpAlloc(int fd, unsigned long size, unsigned long type,
1412 unsigned long *address, unsigned long *handle) 1417 unsigned long *address, unsigned long *handle)
1413{ 1418{
1414 drm_agp_buffer_t b; 1419 drm_agp_buffer_t b;
1415 *handle = 0; 1420
1421 *handle = DRM_AGP_NO_HANDLE;
1416 b.size = size; 1422 b.size = size;
1417 b.handle = 0; 1423 b.handle = 0;
1418 b.type = type; 1424 b.type = type;