mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
v3dv: don't overwrite the primary fd if it's already set
If a valid primary file descriptor is already set (e.g. from vc4),
don't overwrite it with -1.
This prevents losing a valid primary fd and resolves issues arising
when vc4 is the first node returned by `drmGetDevices2()` and v3d is
the second.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12777
Fixes: 188f1c6cbe ("v3dv: rewrite device identification")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33958>
This commit is contained in:
parent
2983ca0d20
commit
7775c79035
1 changed files with 4 additions and 2 deletions
|
|
@ -1594,10 +1594,12 @@ enumerate_devices(struct vk_instance *vk_instance)
|
|||
if (devices[i]->bustype != DRM_BUS_PLATFORM)
|
||||
continue;
|
||||
|
||||
if ((devices[i]->available_nodes & 1 << DRM_NODE_RENDER))
|
||||
if ((devices[i]->available_nodes & 1 << DRM_NODE_RENDER)) {
|
||||
try_device(devices[i]->nodes[DRM_NODE_RENDER], &render_fd, "v3d");
|
||||
if ((devices[i]->available_nodes & 1 << DRM_NODE_PRIMARY))
|
||||
} else if (primary_fd == -1 &&
|
||||
(devices[i]->available_nodes & 1 << DRM_NODE_PRIMARY)) {
|
||||
try_display_device(instance, devices[i]->nodes[DRM_NODE_PRIMARY], &primary_fd);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (render_fd >= 0 && primary_fd >= 0)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue