v3dv: allow device with only render node

When using drm-shim there is no primary node for the driver. This is
fine, and hence we only mark that we don't have primary device.

This fixes using v3dv with drm-shim.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41779>
This commit is contained in:
Juan A. Suarez Romero 2026-05-23 13:32:07 +02:00 committed by Marge Bot
parent 6f8a692abc
commit 1eae5ca94f

View file

@ -1359,10 +1359,10 @@ create_physical_device(struct v3dv_instance *instance,
if (fstat(primary_fd, &primary_stat) != 0) {
result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
"failed to stat DRM primary node");
goto fail;
} else {
device->has_primary = true;
device->primary_devid = primary_stat.st_rdev;
}
device->has_primary = true;
device->primary_devid = primary_stat.st_rdev;
if (fstat(render_fd, &render_stat) != 0) {
result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
@ -1664,7 +1664,7 @@ enumerate_devices(struct vk_instance *vk_instance)
break;
}
if (render_fd < 0 || primary_fd < 0)
if (render_fd < 0)
result = VK_ERROR_INCOMPATIBLE_DRIVER;
else
result = create_physical_device(instance, primary_fd, render_fd, display_fd);