radv: fix creating null devices if KHR_display is enabled
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 26 Feb 2020 09:21:24 +0000 (10:21 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 26 Feb 2020 10:28:46 +0000 (10:28 +0000)
Found this while replaying pipelines with Fossilize, it worked
fine with vkpipeline-db.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3959>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3959>

src/amd/vulkan/radv_device.c

index a130952e88f03e0c0ca6591a6b101aef1823b110..d86f2c7d690ef92214ce563b6c10be732c59a97d 100644 (file)
@@ -350,7 +350,7 @@ radv_physical_device_init(struct radv_physical_device *device,
                goto fail;
        }
 
-       if (instance->enabled_extensions.KHR_display) {
+       if (drm_device && instance->enabled_extensions.KHR_display) {
                master_fd = open(drm_device->nodes[DRM_NODE_PRIMARY], O_RDWR | O_CLOEXEC);
                if (master_fd >= 0) {
                        uint32_t accel_working = 0;