|
|
3cc6c2 |
diff -up libdrm-2.4.74/xf86drm.c.no-bc libdrm-2.4.74/xf86drm.c
|
|
|
3cc6c2 |
--- libdrm-2.4.74/xf86drm.c.no-bc 2017-01-18 13:39:38.878473110 +1000
|
|
|
3cc6c2 |
+++ libdrm-2.4.74/xf86drm.c 2017-01-18 13:40:30.603848193 +1000
|
|
|
3cc6c2 |
@@ -484,11 +484,6 @@ int drmAvailable(void)
|
|
|
3cc6c2 |
int fd;
|
|
|
3cc6c2 |
|
|
|
3cc6c2 |
if ((fd = drmOpenMinor(0, 1, DRM_NODE_PRIMARY)) < 0) {
|
|
|
3cc6c2 |
-#ifdef __linux__
|
|
|
3cc6c2 |
- /* Try proc for backward Linux compatibility */
|
|
|
3cc6c2 |
- if (!access("/proc/dri/0", R_OK))
|
|
|
3cc6c2 |
- return 1;
|
|
|
3cc6c2 |
-#endif
|
|
|
3cc6c2 |
return 0;
|
|
|
3cc6c2 |
}
|
|
|
3cc6c2 |
|
|
|
3cc6c2 |
@@ -661,38 +656,6 @@ static int drmOpenByName(const char *nam
|
|
|
3cc6c2 |
}
|
|
|
3cc6c2 |
}
|
|
|
3cc6c2 |
|
|
|
3cc6c2 |
-#ifdef __linux__
|
|
|
3cc6c2 |
- /* Backward-compatibility /proc support */
|
|
|
3cc6c2 |
- for (i = 0; i < 8; i++) {
|
|
|
3cc6c2 |
- char proc_name[64], buf[512];
|
|
|
3cc6c2 |
- char *driver, *pt, *devstring;
|
|
|
3cc6c2 |
- int retcode;
|
|
|
3cc6c2 |
-
|
|
|
3cc6c2 |
- sprintf(proc_name, "/proc/dri/%d/name", i);
|
|
|
3cc6c2 |
- if ((fd = open(proc_name, 0, 0)) >= 0) {
|
|
|
3cc6c2 |
- retcode = read(fd, buf, sizeof(buf)-1);
|
|
|
3cc6c2 |
- close(fd);
|
|
|
3cc6c2 |
- if (retcode) {
|
|
|
3cc6c2 |
- buf[retcode-1] = '\0';
|
|
|
3cc6c2 |
- for (driver = pt = buf; *pt && *pt != ' '; ++pt)
|
|
|
3cc6c2 |
- ;
|
|
|
3cc6c2 |
- if (*pt) { /* Device is next */
|
|
|
3cc6c2 |
- *pt = '\0';
|
|
|
3cc6c2 |
- if (!strcmp(driver, name)) { /* Match */
|
|
|
3cc6c2 |
- for (devstring = ++pt; *pt && *pt != ' '; ++pt)
|
|
|
3cc6c2 |
- ;
|
|
|
3cc6c2 |
- if (*pt) { /* Found busid */
|
|
|
3cc6c2 |
- return drmOpenByBusid(++pt, type);
|
|
|
3cc6c2 |
- } else { /* No busid */
|
|
|
3cc6c2 |
- return drmOpenDevice(strtol(devstring, NULL, 0),i, type);
|
|
|
3cc6c2 |
- }
|
|
|
3cc6c2 |
- }
|
|
|
3cc6c2 |
- }
|
|
|
3cc6c2 |
- }
|
|
|
3cc6c2 |
- }
|
|
|
3cc6c2 |
- }
|
|
|
3cc6c2 |
-#endif
|
|
|
3cc6c2 |
-
|
|
|
3cc6c2 |
return -1;
|
|
|
3cc6c2 |
}
|
|
|
3cc6c2 |
|