From: Emil Velikov Date: Wed, 22 Jul 2015 15:34:15 +0000 (+0100) Subject: st/dri: unwrap/remove __NOT_HAVE_DRM_H magic X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=72c784347bf66b61385cb57bb666033e5234ba69;p=mesa.git st/dri: unwrap/remove __NOT_HAVE_DRM_H magic With the dri_interface.h clean of the macro, we can remove the final only st/dri specific use of the very same. Seemingly it was incorrectly used, as the build-time presence of dri2 is not libdrm specific. At run-time, the code is already limited to dri2 use-cases plus returning true, when the extension is not present (or too old) will likely lead to a crash as one tries to use it shortly after the dri_with_format() call. As a side effect this gives us a nice cleanup the builds. Signed-off-by: Emil Velikov --- diff --git a/src/gallium/state_trackers/dri/Android.mk b/src/gallium/state_trackers/dri/Android.mk index 188e4a1404d..4ee43385352 100644 --- a/src/gallium/state_trackers/dri/Android.mk +++ b/src/gallium/state_trackers/dri/Android.mk @@ -48,10 +48,7 @@ LOCAL_CFLAGS += -DGALLIUM_SOFTPIPE LOCAL_SRC_FILES += $(drisw_SOURCES) endif -# swrast only? -ifeq ($(MESA_GPU_DRIVERS),swrast) -LOCAL_CFLAGS += -D__NOT_HAVE_DRM_H -else +ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),) LOCAL_SRC_FILES += $(dri2_SOURCES) LOCAL_SHARED_LIBRARIES := libdrm endif diff --git a/src/gallium/state_trackers/dri/Makefile.am b/src/gallium/state_trackers/dri/Makefile.am index d2c7a82d720..9f4deba0c1e 100644 --- a/src/gallium/state_trackers/dri/Makefile.am +++ b/src/gallium/state_trackers/dri/Makefile.am @@ -50,10 +50,6 @@ noinst_LTLIBRARIES = libdri.la libdri_la_SOURCES = $(common_SOURCES) if HAVE_DRISW -if !HAVE_DRI2 -AM_CPPFLAGS += \ - -D__NOT_HAVE_DRM_H -endif libdri_la_SOURCES += $(drisw_SOURCES) endif diff --git a/src/gallium/state_trackers/dri/SConscript b/src/gallium/state_trackers/dri/SConscript index 89b5e611c2e..7a7060c4c2d 100644 --- a/src/gallium/state_trackers/dri/SConscript +++ b/src/gallium/state_trackers/dri/SConscript @@ -5,10 +5,7 @@ Import('*') env = env.Clone() -# XXX: If HAVE_DRI2 env.PkgUseModules(['DRM']) -# else -#env.Append(CPPDEFINES = [('__NOT_HAVE_DRM_H', '1')]) env.Append(CPPPATH = [ '#/src', diff --git a/src/gallium/state_trackers/dri/dri_screen.h b/src/gallium/state_trackers/dri/dri_screen.h index 6d46fea9684..4bcb0291d86 100644 --- a/src/gallium/state_trackers/dri/dri_screen.h +++ b/src/gallium/state_trackers/dri/dri_screen.h @@ -122,8 +122,6 @@ struct __DRIimageRec { }; -#ifndef __NOT_HAVE_DRM_H - static inline boolean dri_with_format(__DRIscreen * sPriv) { @@ -134,16 +132,6 @@ dri_with_format(__DRIscreen * sPriv) && (loader->getBuffersWithFormat != NULL); } -#else - -static inline boolean -dri_with_format(__DRIscreen * sPriv) -{ - return TRUE; -} - -#endif - void dri_fill_st_visual(struct st_visual *stvis, struct dri_screen *screen, const struct gl_config *mode);