Skip to contentSkip to conversation

xf86drm: fallback to MODALIAS for OF less platform devices

PATCH In review Emil Velikov 3 participants 8 messages Jan 23, 2019 – Feb 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 xf86drm: fallback to MODALIAS for OF less platform devices

From: Emil Velikov <[email protected]>

Some devices can lack OF data or it may not be available in the uevent file. Fallback to the MODALIAS data in those cases.

We strip any leading "MODALIAS=.*:" thus the resulting information is compatible with existing code in Mesa.

---
 xf86drm.c | 55 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 42 insertions(+), 13 deletions(-)
xf86drm.c +42 -13
index 10df682b..374734eb 100644
@@ -3511,15 +3511,28 @@ free_device:
 static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
 {
 #ifdef __linux__
-    char path[PATH_MAX + 1], *name;
+    char path[PATH_MAX + 1], *name, *foo;
 
     snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
 
     name = sysfs_uevent_get(path, "OF_FULLNAME");
-    if (!name)
-        return -ENOENT;
+    foo = name;
+    if (!name) {
+        /* If the device lacks OF data, pick the MODALIAS info */
+        name = sysfs_uevent_get(path, "MODALIAS");
+        if (!name)
+            return -ENOENT;
+
+        /* .. and strip the MODALIAS=[platform,usb...]: part. */
+        foo = strrchr(name, ':');
+        if (!foo) {
+            free(name);
+            return -ENOENT;
+        }
+        foo++;
+    }
 
-    strncpy(info->fullname, name, DRM_PLATFORM_DEVICE_NAME_LEN);
+    strncpy(info->fullname, foo, DRM_PLATFORM_DEVICE_NAME_LEN);
     info->fullname[DRM_PLATFORM_DEVICE_NAME_LEN - 1] = '\0';
     free(name);
 
@@ -3534,18 +3547,20 @@ static int drmParsePlatformDeviceInfo(int maj, int min,
                                       drmPlatformDeviceInfoPtr info)
 {
 #ifdef __linux__
-    char path[PATH_MAX + 1], *value;
+    char path[PATH_MAX + 1], *value, *foo;
     unsigned int count, i;
     int err;
 
     snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
 
     value = sysfs_uevent_get(path, "OF_COMPATIBLE_N");
-    if (!value)
-        return -ENOENT;
-
-    sscanf(value, "%u", &count);
-    free(value);
+    if (value) {
+        sscanf(value, "%u", &count);
+        free(value);
+    } else {
+        /* Assume one entry if the device lack OF data */
+        count = 1;
+    }
 
     info->compatible = calloc(count + 1, sizeof(*info->compatible));
     if (!info->compatible)
@@ -3553,12 +3568,26 @@ static int drmParsePlatformDeviceInfo(int maj, int min,
 
     for (i = 0; i < count; i++) {
         value = sysfs_uevent_get(path, "OF_COMPATIBLE_%u", i);
+        foo = value;
         if (!value) {
-            err = -ENOENT;
-            goto free;
+            /* If the device lacks OF data, pick the MODALIAS info */
+            value = sysfs_uevent_get(path, "MODALIAS");
+            if (!value) {
+                err = -ENOENT;
+                goto free;
+            }
+
+            /* .. and strip the MODALIAS=[platform,usb...]: part. */
+            foo = strrchr(value, ':');
+            if (!foo) {
+                free(value);
+                return -ENOENT;
+            }
+            foo = strdup(foo + 1);
+            free(value);
         }
 
-        info->compatible[i] = value;
+        info->compatible[i] = foo;
     }
 
     return 0;
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/2 xf85drm: de-duplicate drmParse{Platform.Host1x}{Bus, Device}Info

From: Emil Velikov <[email protected]>

The functions are virtually identical, fold them up.

---
 xf86drm.c | 98 +++++++++----------------------------------------------
 1 file changed, 15 insertions(+), 83 deletions(-)
xf86drm.c +15 -83
index 374734eb..18c9693a 100644
@@ -3508,7 +3508,7 @@ free_device:
     return ret;
 }
 
-static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
+static int drmParseOFBusInfo(int maj, int min, char *fullname)
 {
 #ifdef __linux__
     char path[PATH_MAX + 1], *name, *foo;
@@ -3532,19 +3532,18 @@ static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
         foo++;
     }
 
-    strncpy(info->fullname, foo, DRM_PLATFORM_DEVICE_NAME_LEN);
-    info->fullname[DRM_PLATFORM_DEVICE_NAME_LEN - 1] = '\0';
+    strncpy(fullname, foo, DRM_PLATFORM_DEVICE_NAME_LEN);
+    fullname[DRM_PLATFORM_DEVICE_NAME_LEN - 1] = '\0';
     free(name);
 
     return 0;
 #else
-#warning "Missing implementation of drmParsePlatformBusInfo"
+#warning "Missing implementation of drmParseOFBusInfo"
     return -EINVAL;
 #endif
 }
 
-static int drmParsePlatformDeviceInfo(int maj, int min,
-                                      drmPlatformDeviceInfoPtr info)
+static int drmParseOFDeviceInfo(int maj, int min, char ***compatible)
 {
 #ifdef __linux__
     char path[PATH_MAX + 1], *value, *foo;
@@ -3562,8 +3561,8 @@ static int drmParsePlatformDeviceInfo(int maj, int min,
         count = 1;
     }
 
-    info->compatible = calloc(count + 1, sizeof(*info->compatible));
-    if (!info->compatible)
+    *compatible = calloc(count + 1, sizeof(char *));
+    if (!*compatible)
         return -ENOMEM;
 
     for (i = 0; i < count; i++) {
@@ -3587,19 +3586,19 @@ static int drmParsePlatformDeviceInfo(int maj, int min,
             free(value);
         }
 
-        info->compatible[i] = foo;
+        *compatible[i] = foo;
     }
 
     return 0;
 
 free:
     while (i--)
-        free(info->compatible[i]);
+        free(*compatible[i]);
 
-    free(info->compatible);
+    free(*compatible);
     return err;
 #else
-#warning "Missing implementation of drmParsePlatformDeviceInfo"
+#warning "Missing implementation of drmParseOFDeviceInfo"
     return -EINVAL;
 #endif
 }
@@ -3622,7 +3621,7 @@ static int drmProcessPlatformDevice(drmDevicePtr *device,
 
     dev->businfo.platform = (drmPlatformBusInfoPtr)ptr;
 
-    ret = drmParsePlatformBusInfo(maj, min, dev->businfo.platform);
+    ret = drmParseOFBusInfo(maj, min, dev->businfo.platform->fullname);
     if (ret < 0)
         goto free_device;
 
@@ -3630,7 +3629,7 @@ static int drmProcessPlatformDevice(drmDevicePtr *device,
         ptr += sizeof(drmPlatformBusInfo);
         dev->deviceinfo.platform = (drmPlatformDeviceInfoPtr)ptr;
 
-        ret = drmParsePlatformDeviceInfo(maj, min, dev->deviceinfo.platform);
+        ret = drmParseOFDeviceInfo(maj, min, &dev->deviceinfo.platform->compatible);
         if (ret < 0)
             goto free_device;
     }
@@ -3644,73 +3643,6 @@ free_device:
     return ret;
 }
 
-static int drmParseHost1xBusInfo(int maj, int min, drmHost1xBusInfoPtr info)
-{
-#ifdef __linux__
-    char path[PATH_MAX + 1], *name;
-
-    snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
-
-    name = sysfs_uevent_get(path, "OF_FULLNAME");
-    if (!name)
-        return -ENOENT;
-
-    strncpy(info->fullname, name, DRM_HOST1X_DEVICE_NAME_LEN);
-    info->fullname[DRM_HOST1X_DEVICE_NAME_LEN - 1] = '\0';
-    free(name);
-
-    return 0;
-#else
-#warning "Missing implementation of drmParseHost1xBusInfo"
-    return -EINVAL;
-#endif
-}
-
-static int drmParseHost1xDeviceInfo(int maj, int min,
-                                    drmHost1xDeviceInfoPtr info)
-{
-#ifdef __linux__
-    char path[PATH_MAX + 1], *value;
-    unsigned int count, i;
-    int err;
-
-    snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
-
-    value = sysfs_uevent_get(path, "OF_COMPATIBLE_N");
-    if (!value)
-        return -ENOENT;
-
-    sscanf(value, "%u", &count);
-    free(value);
-
-    info->compatible = calloc(count + 1, sizeof(*info->compatible));
-    if (!info->compatible)
-        return -ENOMEM;
-
-    for (i = 0; i < count; i++) {
-        value = sysfs_uevent_get(path, "OF_COMPATIBLE_%u", i);
-        if (!value) {
-            err = -ENOENT;
-            goto free;
-        }
-
-        info->compatible[i] = value;
-    }
-
-    return 0;
-
-free:
-    while (i--)
-        free(info->compatible[i]);
-
-    free(info->compatible);
-    return err;
-#else
-#warning "Missing implementation of drmParseHost1xDeviceInfo"
-    return -EINVAL;
-#endif
-}
-
 static int drmProcessHost1xDevice(drmDevicePtr *device,
                                   const char *node, int node_type,
                                   int maj, int min, bool fetch_deviceinfo,
@@ -3729,7 +3661,7 @@ static int drmProcessHost1xDevice(drmDevicePtr *device,
 
     dev->businfo.host1x = (drmHost1xBusInfoPtr)ptr;
 
-    ret = drmParseHost1xBusInfo(maj, min, dev->businfo.host1x);
+    ret = drmParseOFBusInfo(maj, min, dev->businfo.host1x->fullname);
     if (ret < 0)
         goto free_device;
 
@@ -3737,7 +3669,7 @@ static int drmProcessHost1xDevice(drmDevicePtr *device,
         ptr += sizeof(drmHost1xBusInfo);
         dev->deviceinfo.host1x = (drmHost1xDeviceInfoPtr)ptr;
 
-        ret = drmParseHost1xDeviceInfo(maj, min, dev->deviceinfo.host1x);
+        ret = drmParseOFDeviceInfo(maj, min, &dev->deviceinfo.host1x->compatible);
         if (ret < 0)
             goto free_device;
     }
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH libdrm 2/2] xf85drm: de-duplicate drmParse{Platform.Host1x}{Bus, Device}Info

Quoted 5 lines · Emil Velikov

From: Emil Velikov <[email protected]>

The functions are virtually identical, fold them up.

Assuming patch 1 is OK, and foo gets renamed to something better:

I don't know enough to review patch 1 though.

Quoted 193 lines
---
 xf86drm.c | 98 +++++++++----------------------------------------------
 1 file changed, 15 insertions(+), 83 deletions(-)
xf86drm.c +15 -83
index 374734eb..18c9693a 100644
@@ -3508,7 +3508,7 @@ free_device:
     return ret;
 }
 
-static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
+static int drmParseOFBusInfo(int maj, int min, char *fullname)
 {
 #ifdef __linux__
     char path[PATH_MAX + 1], *name, *foo;
@@ -3532,19 +3532,18 @@ static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
         foo++;
     }
 
-    strncpy(info->fullname, foo, DRM_PLATFORM_DEVICE_NAME_LEN);
-    info->fullname[DRM_PLATFORM_DEVICE_NAME_LEN - 1] = '\0';
+    strncpy(fullname, foo, DRM_PLATFORM_DEVICE_NAME_LEN);
+    fullname[DRM_PLATFORM_DEVICE_NAME_LEN - 1] = '\0';
     free(name);
 
     return 0;
 #else
-#warning "Missing implementation of drmParsePlatformBusInfo"
+#warning "Missing implementation of drmParseOFBusInfo"
     return -EINVAL;
 #endif
 }
 
-static int drmParsePlatformDeviceInfo(int maj, int min,
-                                      drmPlatformDeviceInfoPtr info)
+static int drmParseOFDeviceInfo(int maj, int min, char ***compatible)
 {
 #ifdef __linux__
     char path[PATH_MAX + 1], *value, *foo;
@@ -3562,8 +3561,8 @@ static int drmParsePlatformDeviceInfo(int maj, int min,
         count = 1;
     }
 
-    info->compatible = calloc(count + 1, sizeof(*info->compatible));
-    if (!info->compatible)
+    *compatible = calloc(count + 1, sizeof(char *));
+    if (!*compatible)
         return -ENOMEM;
 
     for (i = 0; i < count; i++) {
@@ -3587,19 +3586,19 @@ static int drmParsePlatformDeviceInfo(int maj, int min,
             free(value);
         }
 
-        info->compatible[i] = foo;
+        *compatible[i] = foo;
     }
 
     return 0;
 
 free:
     while (i--)
-        free(info->compatible[i]);
+        free(*compatible[i]);
 
-    free(info->compatible);
+    free(*compatible);
     return err;
 #else
-#warning "Missing implementation of drmParsePlatformDeviceInfo"
+#warning "Missing implementation of drmParseOFDeviceInfo"
     return -EINVAL;
 #endif
 }
@@ -3622,7 +3621,7 @@ static int drmProcessPlatformDevice(drmDevicePtr *device,
 
     dev->businfo.platform = (drmPlatformBusInfoPtr)ptr;
 
-    ret = drmParsePlatformBusInfo(maj, min, dev->businfo.platform);
+    ret = drmParseOFBusInfo(maj, min, dev->businfo.platform->fullname);
     if (ret < 0)
         goto free_device;
 
@@ -3630,7 +3629,7 @@ static int drmProcessPlatformDevice(drmDevicePtr *device,
         ptr += sizeof(drmPlatformBusInfo);
         dev->deviceinfo.platform = (drmPlatformDeviceInfoPtr)ptr;
 
-        ret = drmParsePlatformDeviceInfo(maj, min, dev->deviceinfo.platform);
+        ret = drmParseOFDeviceInfo(maj, min, &dev->deviceinfo.platform->compatible);
         if (ret < 0)
             goto free_device;
     }
@@ -3644,73 +3643,6 @@ free_device:
     return ret;
 }
 
-static int drmParseHost1xBusInfo(int maj, int min, drmHost1xBusInfoPtr info)
-{
-#ifdef __linux__
-    char path[PATH_MAX + 1], *name;
-
-    snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
-
-    name = sysfs_uevent_get(path, "OF_FULLNAME");
-    if (!name)
-        return -ENOENT;
-
-    strncpy(info->fullname, name, DRM_HOST1X_DEVICE_NAME_LEN);
-    info->fullname[DRM_HOST1X_DEVICE_NAME_LEN - 1] = '\0';
-    free(name);
-
-    return 0;
-#else
-#warning "Missing implementation of drmParseHost1xBusInfo"
-    return -EINVAL;
-#endif
-}
-
-static int drmParseHost1xDeviceInfo(int maj, int min,
-                                    drmHost1xDeviceInfoPtr info)
-{
-#ifdef __linux__
-    char path[PATH_MAX + 1], *value;
-    unsigned int count, i;
-    int err;
-
-    snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
-
-    value = sysfs_uevent_get(path, "OF_COMPATIBLE_N");
-    if (!value)
-        return -ENOENT;
-
-    sscanf(value, "%u", &count);
-    free(value);
-
-    info->compatible = calloc(count + 1, sizeof(*info->compatible));
-    if (!info->compatible)
-        return -ENOMEM;
-
-    for (i = 0; i < count; i++) {
-        value = sysfs_uevent_get(path, "OF_COMPATIBLE_%u", i);
-        if (!value) {
-            err = -ENOENT;
-            goto free;
-        }
-
-        info->compatible[i] = value;
-    }
-
-    return 0;
-
-free:
-    while (i--)
-        free(info->compatible[i]);
-
-    free(info->compatible);
-    return err;
-#else
-#warning "Missing implementation of drmParseHost1xDeviceInfo"
-    return -EINVAL;
-#endif
-}
-
 static int drmProcessHost1xDevice(drmDevicePtr *device,
                                   const char *node, int node_type,
                                   int maj, int min, bool fetch_deviceinfo,
@@ -3729,7 +3661,7 @@ static int drmProcessHost1xDevice(drmDevicePtr *device,
 
     dev->businfo.host1x = (drmHost1xBusInfoPtr)ptr;
 
-    ret = drmParseHost1xBusInfo(maj, min, dev->businfo.host1x);
+    ret = drmParseOFBusInfo(maj, min, dev->businfo.host1x->fullname);
     if (ret < 0)
         goto free_device;
 
@@ -3737,7 +3669,7 @@ static int drmProcessHost1xDevice(drmDevicePtr *device,
         ptr += sizeof(drmHost1xBusInfo);
         dev->deviceinfo.host1x = (drmHost1xDeviceInfoPtr)ptr;
 
-        ret = drmParseHost1xDeviceInfo(maj, min, dev->deviceinfo.host1x);
+        ret = drmParseOFDeviceInfo(maj, min, &dev->deviceinfo.host1x->compatible);
         if (ret < 0)
             goto free_device;
     }
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to Emil Velikov
Quoted 18 lines · Emil Velikov

From: Emil Velikov <[email protected]>

Some devices can lack OF data or it may not be available in the uevent file. Fallback to the MODALIAS data in those cases.

We strip any leading "MODALIAS=.*:" thus the resulting information is compatible with existing code in Mesa.

---
 xf86drm.c | 55 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 42 insertions(+), 13 deletions(-)
xf86drm.c +0 -0
index 10df682b..374734eb 100644

xf86drm.c free_device: · line 3514

Quoted 5 lines
xf86drm.c +1 -1
@@ -3511,15 +3511,28 @@ free_device:
 static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
 {
 #ifdef __linux__
-    char path[PATH_MAX + 1], *name;
+    char path[PATH_MAX + 1], *name, *foo;

I assume you didn't mean to send this patch yet? :P

Quoted 91 lines
xf86drm.c +41 -12
     snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
 
     name = sysfs_uevent_get(path, "OF_FULLNAME");
-    if (!name)
-        return -ENOENT;
+    foo = name;
+    if (!name) {
+        /* If the device lacks OF data, pick the MODALIAS info */
+        name = sysfs_uevent_get(path, "MODALIAS");
+        if (!name)
+            return -ENOENT;
+
+        /* .. and strip the MODALIAS=[platform,usb...]: part. */
+        foo = strrchr(name, ':');
+        if (!foo) {
+            free(name);
+            return -ENOENT;
+        }
+        foo++;
+    }
 
-    strncpy(info->fullname, name, DRM_PLATFORM_DEVICE_NAME_LEN);
+    strncpy(info->fullname, foo, DRM_PLATFORM_DEVICE_NAME_LEN);
     info->fullname[DRM_PLATFORM_DEVICE_NAME_LEN - 1] = '\0';
     free(name);
 
@@ -3534,18 +3547,20 @@ static int drmParsePlatformDeviceInfo(int maj, int min,
                                       drmPlatformDeviceInfoPtr info)
 {
 #ifdef __linux__
-    char path[PATH_MAX + 1], *value;
+    char path[PATH_MAX + 1], *value, *foo;
     unsigned int count, i;
     int err;
 
     snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
 
     value = sysfs_uevent_get(path, "OF_COMPATIBLE_N");
-    if (!value)
-        return -ENOENT;
-
-    sscanf(value, "%u", &count);
-    free(value);
+    if (value) {
+        sscanf(value, "%u", &count);
+        free(value);
+    } else {
+        /* Assume one entry if the device lack OF data */
+        count = 1;
+    }
 
     info->compatible = calloc(count + 1, sizeof(*info->compatible));
     if (!info->compatible)
@@ -3553,12 +3568,26 @@ static int drmParsePlatformDeviceInfo(int maj, int min,
 
     for (i = 0; i < count; i++) {
         value = sysfs_uevent_get(path, "OF_COMPATIBLE_%u", i);
+        foo = value;
         if (!value) {
-            err = -ENOENT;
-            goto free;
+            /* If the device lacks OF data, pick the MODALIAS info */
+            value = sysfs_uevent_get(path, "MODALIAS");
+            if (!value) {
+                err = -ENOENT;
+                goto free;
+            }
+
+            /* .. and strip the MODALIAS=[platform,usb...]: part. */
+            foo = strrchr(value, ':');
+            if (!foo) {
+                free(value);
+                return -ENOENT;
+            }
+            foo = strdup(foo + 1);
+            free(value);
         }
 
-        info->compatible[i] = value;
+        info->compatible[i] = foo;
     }
 
     return 0;
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
Quoted 15 lines · Eric Engestrom
Quoted 13 lines · Emil Velikov

From: Emil Velikov <[email protected]>

Some devices can lack OF data or it may not be available in the uevent file. Fallback to the MODALIAS data in those cases.

We strip any leading "MODALIAS=.*:" thus the resulting information is compatible with existing code in Mesa.

---
 xf86drm.c | 55 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 42 insertions(+), 13 deletions(-)
Quoted 13 lines

xf86drm.c free_device: · line 3514

Quoted 10 lines
xf86drm.c +1 -1
index 10df682b..374734eb 100644
@@ -3511,15 +3511,28 @@ free_device:
 static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
 {
 #ifdef __linux__
-    char path[PATH_MAX + 1], *name;
+    char path[PATH_MAX + 1], *name, *foo;

I assume you didn't mean to send this patch yet? :P

Thanks Eric, I intentionally sent it out. Mind was blank thinking for a reasonable variable name :-\
Suggestions are more than welcome.

For reference with this patch drmdevice and other drmDevice API users list:
- VGEM, needs "drm/vgem: Fix vgem_init to get drm device available."
- in v5.0 only :'-(
- etnaviv, after "drm/etnaviv: remove the need for a gpu-subsystem DT
node" landed in v4.17/18

HTH
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw
Quoted 34 lines · Emil Velikov
Quoted 15 lines · Eric Engestrom
Quoted 13 lines · Emil Velikov

From: Emil Velikov <[email protected]>

Some devices can lack OF data or it may not be available in the uevent file. Fallback to the MODALIAS data in those cases.

We strip any leading "MODALIAS=.*:" thus the resulting information is compatible with existing code in Mesa.

---
 xf86drm.c | 55 ++++++++++++++++++++++++++++++++++++++++++-------------
 1 file changed, 42 insertions(+), 13 deletions(-)
Quoted 13 lines

xf86drm.c free_device: · line 3514

Quoted 10 lines
xf86drm.c +1 -1
index 10df682b..374734eb 100644
@@ -3511,15 +3511,28 @@ free_device:
 static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
 {
 #ifdef __linux__
-    char path[PATH_MAX + 1], *name;
+    char path[PATH_MAX + 1], *name, *foo;

I assume you didn't mean to send this patch yet? :P

Thanks Eric, I intentionally sent it out. Mind was blank thinking for a reasonable variable name :-\
Suggestions are more than welcome.

Quoted 6 lines

For reference with this patch drmdevice and other drmDevice API users list:
- VGEM, needs "drm/vgem: Fix vgem_init to get drm device available."
- in v5.0 only :'-(
- etnaviv, after "drm/etnaviv: remove the need for a gpu-subsystem DT
node" landed in v4.17/18

Christian can you please test that this patches brings etnaviv back to the list? Above is a reasonable assumption, yet assumption never the less.

I've only tested VGEM.

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw

Hi Emil,

Am Donnerstag, den 24.01.2019, 14:42 +0000 schrieb Emil Velikov:

Quoted 43 lines
Quoted 36 lines · Emil Velikov
Quoted 15 lines · Eric Engestrom
Quoted 13 lines · Emil Velikov
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

From: Emil Velikov <[email protected]>

Some devices can lack OF data or it may not be available in the uevent file. Fallback to the MODALIAS data in those cases.

We strip any leading "MODALIAS=.*:" thus the resulting information is compatible with existing code in Mesa.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

---
 xf86drm.c | 55 ++++++++++++++++++++++++++++++++++++++++++-------------

 1 file changed, 42 insertions(+), 13 deletions(-)
Quoted 13 lines

xf86drm.c free_device: · line 3514

Quoted 10 lines
xf86drm.c +1 -1
index 10df682b..374734eb 100644
@@ -3511,15 +3511,28 @@ free_device:
  static int drmParsePlatformBusInfo(int maj, int min, drmPlatformBusInfoPtr info)
  {
  #ifdef __linux__
-    char path[PATH_MAX + 1], *name;
+    char path[PATH_MAX + 1], *name, *foo;

I assume you didn't mean to send this patch yet? :P

Thanks Eric, I intentionally sent it out. Mind was blank thinking for a reasonable variable name :-\
Suggestions are more than welcome.

Quoted 6 lines

For reference with this patch drmdevice and other drmDevice API users list:
 - VGEM, needs "drm/vgem: Fix vgem_init to get drm device available."
- in v5.0 only :'-(
 - etnaviv, after "drm/etnaviv: remove the need for a gpu-subsystem DT node" landed in v4.17/18

Quoted 2 lines

Christian can you please test that this patches brings etnaviv back to the list? Above is a reasonable assumption, yet assumption never the less.

I can confirm that with this patch applied loader_open_render_node("etnaviv") works as intended.

Regards,
Lucas

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
Quoted 11 lines · Lucas Stach

Hi Emil,

Quoted 7 lines
Quoted 6 lines

For reference with this patch drmdevice and other drmDevice API users list:
- VGEM, needs "drm/vgem: Fix vgem_init to get drm device available."
- in v5.0 only :'-(
- etnaviv, after "drm/etnaviv: remove the need for a gpu-subsystem DT
node" landed in v4.17/18

Quoted 6 lines
Quoted 2 lines

Christian can you please test that this patches brings etnaviv back to the list? Above is a reasonable assumption, yet assumption never the less.

I can confirm that with this patch applied loader_open_render_node("etnaviv") works as intended.

Amazing, thank you Lucas.
Pushed to master.

-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel