Skip to contentSkip to conversation

Return an -ENODEV from drmGetDevice() when no device was found.

PATCH In review Eric Anholt 3 participants 7 messages Oct 21, 2016 – Oct 24, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Return an -ENODEV from drmGetDevice() when no device was found.

From: Rob Herring <[email protected]>

Fixes crashes in Mesa on platform device, which expected *device to have a device when 0 was returned.

(code from a paste by Rob, commit message by anholt)

---
 xf86drm.c | 2 ++
 1 file changed, 2 insertions(+)
xf86drm.c +2 -0
index 9cfca49ddfda..9b52889e4cef 100644
@@ -3181,6 +3181,8 @@ int drmGetDevice(int fd, drmDevicePtr *device)
 
     closedir(sysdir);
     free(local_devices);
+    if (*device == NULL)
+	return -ENODEV;
     return 0;
 
 free_devices:
Signature · 1 line
2.9.3
#1 lore raw

PATCH 2/2 Silence runtime complaints on platform devices

glxgears was spamming this 12 times at startup because of Mesa's probing of the DRM device code, which doesn't support platform devices.

---
 xf86drm.c | 2 --
 1 file changed, 2 deletions(-)
xf86drm.c +0 -2
index 9b52889e4cef..52add5e441d7 100644
@@ -3149,7 +3149,6 @@ int drmGetDevice(int fd, drmDevicePtr *device)
 
             break;
         default:
-            fprintf(stderr, "The subsystem type is not supported yet\n");
             continue;
         }
 
@@ -3259,7 +3258,6 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
 
             break;
         default:
-            fprintf(stderr, "The subsystem type is not supported yet\n");
             continue;
         }
 
Signature · 1 line
2.9.3
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH libdrm 2/2] Silence runtime complaints on platform devices

Quoted 5 lines · Eric Anholt

glxgears was spamming this 12 times at startup because of Mesa's probing of the DRM device code, which doesn't support platform devices.

Quoted 27 lines
---
 xf86drm.c | 2 --
 1 file changed, 2 deletions(-)
xf86drm.c +0 -3
index 9b52889e4cef..52add5e441d7 100644
@@ -3149,7 +3149,6 @@ int drmGetDevice(int fd, drmDevicePtr *device)
 
             break;
         default:
-            fprintf(stderr, "The subsystem type is not supported yet\n");
             continue;
         }
 
@@ -3259,7 +3258,6 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
 
             break;
         default:
-            fprintf(stderr, "The subsystem type is not supported yet\n");
             continue;
         }
 
--

2.9.3

Quoted 4 lines

_______________________________________________
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

Re: [PATCH libdrm 2/2] Silence runtime complaints on platform devices

In reply to Eric Anholt
Quoted 4 lines · Eric Anholt

glxgears was spamming this 12 times at startup because of Mesa's probing of the DRM device code, which doesn't support platform devices.

Better option is to add support for platform devices. Can we get anyone interested in that ?
If we drop (the annoying) printf people will just ignore/forget about it, and things will fall through the cracks - similar to the 5+ pokes (at various people) to add support.

On the cool side - it will allow you to use the DRI_PRIME/driconf's device_id=libudev_path_id_tag to manage the devices on your system.

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

#4 lore raw

Re: [PATCH libdrm 2/2] Silence runtime complaints on platform devices

Quoted 7 lines · Emil Velikov
Quoted 4 lines · Eric Anholt

glxgears was spamming this 12 times at startup because of Mesa's probing of the DRM device code, which doesn't support platform devices.

Better option is to add support for platform devices. Can we get anyone interested in that ?

I agree it would be good but it certainly isn't remotely near the top of my todo list. I'm just fixing up regressions.

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

Reviewed-by on v1 1/2
#5 lore raw
In reply to Eric Anholt
Quoted 8 lines · Eric Anholt

From: Rob Herring <[email protected]>

Fixes crashes in Mesa on platform device, which expected *device to have a device when 0 was returned.

(code from a paste by Rob, commit message by anholt)

Quoted 20 lines
---
 xf86drm.c | 2 ++
 1 file changed, 2 insertions(+)
xf86drm.c +2 -1
index 9cfca49ddfda..9b52889e4cef 100644
@@ -3181,6 +3181,8 @@ int drmGetDevice(int fd, drmDevicePtr *device)
 
     closedir(sysdir);
     free(local_devices);
+    if (*device == NULL)
+       return -ENODEV;
     return 0;
 
 free_devices:
--

2.9.3

Quoted 4 lines

_______________________________________________
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

Reviewed-by on v1 1/2
#6 lore raw
In reply to Eric Anholt
Quoted 8 lines · Eric Anholt

From: Rob Herring <[email protected]>

Fixes crashes in Mesa on platform device, which expected *device to have a device when 0 was returned.

(code from a paste by Rob, commit message by anholt)

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