v3dv: allow headless device without display device

When trying to create a headless Vulkan instance without a display
device available, device enumeration would fail.
Part of the physical device creation code already accounts for a missing
display device, allow device enumeration to continue in that case too so
headless instances can be created.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25313>
This commit is contained in:
Erico Nunes
2023-09-20 22:06:39 +02:00
committed by Marge Bot
parent 22bca4a14f
commit e3e64e3dbe
+4 -3
View File
@@ -1274,9 +1274,10 @@ enumerate_devices(struct vk_instance *vk_instance)
}
#if !using_v3d_simulator
if (v3d_idx != -1 && vc4_idx != -1) {
result =
create_physical_device(instance, devices[v3d_idx], devices[vc4_idx]);
if (v3d_idx != -1) {
drmDevicePtr v3d_device = devices[v3d_idx];
drmDevicePtr vc4_device = vc4_idx != -1 ? devices[vc4_idx] : NULL;
result = create_physical_device(instance, v3d_device, vc4_device);
}
#endif