From 0b1e8e106f2ee50b5cd4b2eaa478875032340302 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Sat, 8 Oct 2016 10:58:16 +0200 Subject: [PATCH] glx: usability: *must* also log issue context (at "failed to open drm device"). Currently one is greeted with e.g. libGL error: failed to open drm device: Permission denied libGL error: failed to load driver: r200 This is poor usability, since if this important error message also managed to log/show/mention the *name* (e.g. /dev/dri/*) of the specific device, a mere mortal user would have much higher chances of sufficiently quickly identifying/realizing that the particular device file that this error is complaining about is owned by a user group (Debian: "video") which this system user happens to currently *not* yet have access to. One would then simply have to do some kind of adduser (group) operation for that system user id (and likely re-init/-login the relevant session instance). [ironically, the name of the driver *is* logged already, which is much less of an initial concern for this error case] Also, add a fat comment to generally emphasize/combat the currently somewhat sad state of affairs in software environments. Related complaint at Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1539046 (" libGL error: failed to open drm device: Permission denied") Signed-off-by: Andreas Mohr --- src/glx/dri2_glx.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index af388d9..63c431d 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -1189,7 +1189,13 @@ dri2CreateScreen(int screen, struct glx_display * priv) psc->fd = loader_open_device(deviceName); if (psc->fd < 0) { - ErrorMessageF("failed to open drm device: %s\n", strerror(errno)); + /* Usability!!: reports *always* must ensure + * handing over sufficient context/details info + * for mortal users to gain sufficient troubleshooting clues + * (here e.g.: device *name* ownership, thus user permission fail). + */ + ErrorMessageF("failed to open drm device (%s): %s\n", + deviceName, strerror(errno)); goto handle_error; } -- 2.5.5