lavapipe: add support for non-dri loader on linux
authorDave Airlie <airlied@redhat.com>
Thu, 4 Mar 2021 05:49:51 +0000 (15:49 +1000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 20 Apr 2021 01:00:54 +0000 (01:00 +0000)
If you build --glx=gallium-xlib then lavapipe will fail to
link this should let it use the non-dri paths on Linux in that
case

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Tested-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9400>

src/gallium/frontends/lavapipe/lvp_device.c

index 308b370..e6759f6 100644 (file)
@@ -273,7 +273,7 @@ VKAPI_ATTR void VKAPI_CALL lvp_DestroyInstance(
    vk_free(&instance->vk.alloc, instance);
 }
 
-#ifndef _WIN32
+#if defined(HAVE_PIPE_LOADER_DRI)
 static void lvp_get_image(struct dri_drawable *dri_drawable,
                           int x, int y, unsigned width, unsigned height, unsigned stride,
                           void *data)
@@ -314,10 +314,10 @@ lvp_enumerate_physical_devices(struct lvp_instance *instance)
 
    assert(instance->num_devices == 1);
 
-#ifdef _WIN32
-   pipe_loader_sw_probe_null(&instance->devs);
-#else
+#if defined(HAVE_PIPE_LOADER_DRI)
    pipe_loader_sw_probe_dri(&instance->devs, &lvp_sw_lf);
+#else
+   pipe_loader_sw_probe_null(&instance->devs);
 #endif
 
    result = lvp_physical_device_init(&instance->physicalDevice,