aboutsummaryrefslogtreecommitdiffstats
path: root/src/loader/loader.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2020-02-04 17:31:28 -0800
committerMarge Bot <[email protected]>2020-04-01 09:32:25 +0000
commit1e3b74ee73f897bfe50c9bf27458c95870d8c317 (patch)
tree386959732041f7716c6052b3db57fd8fcb5fb8d3 /src/loader/loader.c
parent15a9f6c07228f59401954bb18b9c2f980297f634 (diff)
loader: Warn when we fail to open a device node due to permissions.
This is definitely not the first time I've debugged why I'm getting swrast on a device only to find out I'm not a member of the render node's group. This does mean that you'll get a warning print even without EGL_LOG_LEVEL set. This may be an issue if we expect people outside of the DRI node's group to actually be using swrast instead of getting their permissions fixed. Right now surfaceless throws a "libEGL warning: No hardware driver found, falling back to software rendering" in that case anyway, so this is just more informative. Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3703> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3703>
Diffstat (limited to 'src/loader/loader.c')
-rw-r--r--src/loader/loader.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/loader/loader.c b/src/loader/loader.c
index c896fdc3360..a6ad2ee075b 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -91,6 +91,10 @@ loader_open_device(const char *device_name)
if (fd != -1)
fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
}
+ if (fd == -1 && errno == EACCES) {
+ log_(_LOADER_WARNING, "failed to open %s: %s\n",
+ device_name, strerror(errno));
+ }
return fd;
}