v3dv: Output a message if file open fails in physical_device_init
authorAndreas Bergmeier <abergmeier@gmx.net>
Sat, 27 Feb 2021 22:28:19 +0000 (22:28 +0000)
committerMarge Bot <eric+marge@anholt.net>
Mon, 1 Mar 2021 09:25:21 +0000 (09:25 +0000)
In the caller, this error simply gets mapped to VK_ERROR_INIT[...].
Especially for users it is very valuable to know what the driver
tried and what kind of failure occured. Thus just straight out log
to stderr.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9317>

src/broadcom/vulkan/v3dv_device.c

index cf76716..40b2c00 100644 (file)
@@ -613,6 +613,7 @@ physical_device_init(struct v3dv_physical_device *device,
    const char *path = drm_render_device->nodes[DRM_NODE_RENDER];
    render_fd = open(path, O_RDWR | O_CLOEXEC);
    if (render_fd < 0) {
+      fprintf(stderr, "Opening %s failed: %s\n", path, strerror(errno));
       result = VK_ERROR_INCOMPATIBLE_DRIVER;
       goto fail;
    }