Blame SOURCES/libdrm-2.4.0-no-bc.patch

a23184
diff -up libdrm-2.4.103/xf86drm.c.dma libdrm-2.4.103/xf86drm.c
a23184
--- libdrm-2.4.103/xf86drm.c.dma	2020-11-04 13:24:14.000000000 +1000
a23184
+++ libdrm-2.4.103/xf86drm.c	2020-11-04 13:42:04.190975193 +1000
a23184
@@ -507,11 +507,6 @@ drm_public int drmAvailable(void)
c5cb54
     int           fd;
c5cb54
 
c5cb54
     if ((fd = drmOpenMinor(0, 1, DRM_NODE_PRIMARY)) < 0) {
c5cb54
-#ifdef __linux__
c5cb54
-        /* Try proc for backward Linux compatibility */
c5cb54
-        if (!access("/proc/dri/0", R_OK))
c5cb54
-            return 1;
c5cb54
-#endif
c5cb54
         return 0;
c5cb54
     }
c5cb54
 
a23184
@@ -704,38 +699,6 @@ static int drmOpenByName(const char *nam
c5cb54
         }
c5cb54
     }
c5cb54
 
c5cb54
-#ifdef __linux__
c5cb54
-    /* Backward-compatibility /proc support */
c5cb54
-    for (i = 0; i < 8; i++) {
c5cb54
-        char proc_name[64], buf[512];
c5cb54
-        char *driver, *pt, *devstring;
c5cb54
-        int  retcode;
c5cb54
-
c5cb54
-        sprintf(proc_name, "/proc/dri/%d/name", i);
a23184
-        if ((fd = open(proc_name, O_RDONLY, 0)) >= 0) {
c5cb54
-            retcode = read(fd, buf, sizeof(buf)-1);
c5cb54
-            close(fd);
c5cb54
-            if (retcode) {
c5cb54
-                buf[retcode-1] = '\0';
c5cb54
-                for (driver = pt = buf; *pt && *pt != ' '; ++pt)
c5cb54
-                    ;
c5cb54
-                if (*pt) { /* Device is next */
c5cb54
-                    *pt = '\0';
c5cb54
-                    if (!strcmp(driver, name)) { /* Match */
c5cb54
-                        for (devstring = ++pt; *pt && *pt != ' '; ++pt)
c5cb54
-                            ;
c5cb54
-                        if (*pt) { /* Found busid */
c5cb54
-                            return drmOpenByBusid(++pt, type);
c5cb54
-                        } else { /* No busid */
c5cb54
-                            return drmOpenDevice(strtol(devstring, NULL, 0),i, type);
c5cb54
-                        }
c5cb54
-                    }
c5cb54
-                }
c5cb54
-            }
c5cb54
-        }
c5cb54
-    }
c5cb54
-#endif
c5cb54
-
c5cb54
     return -1;
c5cb54
 }
c5cb54