v3dv: Fix assertion failure for not-found primary_fd during enumeration.

Found when I had v3dv built in my aarch64 turnip setup.

Fixes: 451a0bd490 ("v3dv: use v3d primary node for VK_EXT_physical_device_drm")
(cherry picked from commit bb532a7a39)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38432>
This commit is contained in:
Emma Anholt 2025-10-29 11:46:19 -07:00 committed by Dylan Baker
parent c167b0a816
commit 96d959986c
2 changed files with 2 additions and 4 deletions

View file

@ -1174,7 +1174,7 @@
"description": "v3dv: Fix assertion failure for not-found primary_fd during enumeration.",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "451a0bd49002713d64c4a70a292ceadcad29f943",
"notes": null

View file

@ -1582,9 +1582,7 @@ enumerate_devices(struct vk_instance *vk_instance)
break;
}
assert(primary_fd >= 0);
if (render_fd < 0)
if (render_fd < 0 || primary_fd < 0)
result = VK_ERROR_INCOMPATIBLE_DRIVER;
else
result = create_physical_device(instance, primary_fd, render_fd, display_fd);