[Mesa-dev] [PATCH 05/11] st/dri: unwrap/remove __NOT_HAVE_DRM_H magic
Emil Velikov
emil.l.velikov at gmail.com
Wed Jul 8 10:07:42 PDT 2015
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 <emil.l.velikov at gmail.com>
---
src/gallium/state_trackers/dri/Android.mk | 5 +----
src/gallium/state_trackers/dri/Makefile.am | 4 ----
src/gallium/state_trackers/dri/SConscript | 3 ---
src/gallium/state_trackers/dri/dri_screen.h | 12 ------------
4 files changed, 1 insertion(+), 23 deletions(-)
diff --git a/src/gallium/state_trackers/dri/Android.mk b/src/gallium/state_trackers/dri/Android.mk
index 188e4a1..4ee4338 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 d2c7a82..9f4deba 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 89b5e61..7a7060c 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 173f403..1263fa2 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);
--
2.4.5
More information about the mesa-dev
mailing list