mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
loader: Report DRI_PRIME errors earlier
This needs devices[] in order to print an appropriate message but we
free it right after the loop. Instead, print the error right away and
make the error case after the free just handle jumping to err.
Fixes: ea84b85887 ("loader: add DRI_PRIME_DEBUG env var")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36014>
This commit is contained in:
parent
694fe5f7e5
commit
9e1a1633c4
1 changed files with 6 additions and 9 deletions
|
|
@ -583,21 +583,18 @@ bool loader_get_user_preferred_fd(int *fd_render_gpu, int *original_fd)
|
|||
log_(debug ? _LOADER_WARNING : _LOADER_INFO,
|
||||
"selected (%s)\n", devices[i]->nodes[DRM_NODE_RENDER]);
|
||||
fd = loader_open_device(devices[i]->nodes[DRM_NODE_RENDER]);
|
||||
if (fd < 0) {
|
||||
log_(debug ? _LOADER_WARNING : _LOADER_INFO,
|
||||
"DRI_PRIME: failed to open '%s'\n",
|
||||
devices[i]->nodes[DRM_NODE_RENDER]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
drmFreeDevices(devices, num_devices);
|
||||
|
||||
if (i == num_devices)
|
||||
if (i == num_devices || fd < 0)
|
||||
goto err;
|
||||
|
||||
if (fd < 0) {
|
||||
log_(debug ? _LOADER_WARNING : _LOADER_INFO,
|
||||
"DRI_PRIME: failed to open '%s'\n",
|
||||
devices[i]->nodes[DRM_NODE_RENDER]);
|
||||
|
||||
goto err;
|
||||
}
|
||||
|
||||
bool is_render_and_display_gpu_diff = !!strcmp(default_tag, prime.str);
|
||||
if (original_fd) {
|
||||
if (is_render_and_display_gpu_diff) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue