From 47e5039680787d1d7072caffdb767a54ecd63218 Mon Sep 17 00:00:00 2001 From: Aaron Watry Date: Sat, 2 Aug 2014 16:10:34 -0500 Subject: [PATCH] st/dri: Fix driver loading if swrast isn't built If building hardware drivers only, then kms_swrast_create_screen won't be defined in inline_drm_helper.h and hardware drivers will fail to dlopen as a result. Copy the #if guards from inline_drm_helper.h to dri_kms_init_screen to make the definition/use of the function match. Fixes radeonsi_dri.so dlopen with the following configure: ./configure --with-dri-drivers= --with-dri-driverdir=/usr/local/lib/dri/ \ --enable-gbm --enable-gallium-gbm --enable-debug --enable-opencl \ --enable-opencl-icd --with-gallium-drivers=radeonsi \ --with-egl-platforms=drm --enable-glx-tls --enable-texture-float \ --enable-omx Signed-off-by: Aaron Watry Reviewed-by: Emil Velikov --- src/gallium/state_trackers/dri/dri2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c index ef192e36f7a..c466de78379 100644 --- a/src/gallium/state_trackers/dri/dri2.c +++ b/src/gallium/state_trackers/dri/dri2.c @@ -1322,6 +1322,8 @@ static const __DRIconfig ** dri_kms_init_screen(__DRIscreen * sPriv) { #if GALLIUM_STATIC_TARGETS +#if defined(GALLIUM_SOFTPIPE) +#if defined(DRI_TARGET) const __DRIconfig **configs; struct dri_screen *screen; struct pipe_screen *pscreen = NULL; @@ -1352,6 +1354,8 @@ dri_kms_init_screen(__DRIscreen * sPriv) fail: dri_destroy_screen_helper(screen); FREE(screen); +#endif // DRI_TARGET +#endif // GALLIUM_SOFTPIPE #endif // GALLIUM_STATIC_TARGETS return NULL; } -- 2.30.2