2009-12-01 01:10:23 +00:00
|
|
|
diff -up libdrm-20080814/xf86drm.c.no-bc libdrm-20080814/xf86drm.c
|
|
|
|
--- libdrm-20080814/xf86drm.c.no-bc 2008-08-14 15:43:09.000000000 +1000
|
|
|
|
+++ libdrm-20080814/xf86drm.c 2008-08-14 15:45:09.000000000 +1000
|
2008-08-14 05:51:06 +00:00
|
|
|
@@ -396,11 +396,6 @@ int drmAvailable(void)
|
2008-06-12 04:01:31 +00:00
|
|
|
int fd;
|
|
|
|
|
2008-08-14 05:51:06 +00:00
|
|
|
if ((fd = drmOpenMinor(0, 1, DRM_NODE_RENDER)) < 0) {
|
2008-06-12 04:01:31 +00:00
|
|
|
-#ifdef __linux__
|
|
|
|
- /* Try proc for backward Linux compatibility */
|
|
|
|
- if (!access("/proc/dri/0", R_OK))
|
|
|
|
- return 1;
|
|
|
|
-#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-08-14 05:51:06 +00:00
|
|
|
@@ -519,38 +514,6 @@ static int drmOpenByName(const char *nam
|
2008-06-12 04:01:31 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-#ifdef __linux__
|
|
|
|
- /* Backward-compatibility /proc support */
|
|
|
|
- for (i = 0; i < 8; i++) {
|
|
|
|
- char proc_name[64], buf[512];
|
|
|
|
- char *driver, *pt, *devstring;
|
|
|
|
- int retcode;
|
|
|
|
-
|
|
|
|
- sprintf(proc_name, "/proc/dri/%d/name", i);
|
|
|
|
- if ((fd = open(proc_name, 0, 0)) >= 0) {
|
|
|
|
- retcode = read(fd, buf, sizeof(buf)-1);
|
|
|
|
- close(fd);
|
|
|
|
- if (retcode) {
|
|
|
|
- buf[retcode-1] = '\0';
|
|
|
|
- for (driver = pt = buf; *pt && *pt != ' '; ++pt)
|
|
|
|
- ;
|
|
|
|
- if (*pt) { /* Device is next */
|
|
|
|
- *pt = '\0';
|
|
|
|
- if (!strcmp(driver, name)) { /* Match */
|
|
|
|
- for (devstring = ++pt; *pt && *pt != ' '; ++pt)
|
|
|
|
- ;
|
|
|
|
- if (*pt) { /* Found busid */
|
|
|
|
- return drmOpenByBusid(++pt);
|
|
|
|
- } else { /* No busid */
|
2008-08-14 05:51:06 +00:00
|
|
|
- return drmOpenDevice(strtol(devstring, NULL, 0),i, DRM_NODE_RENDER);
|
2008-06-12 04:01:31 +00:00
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|