[Mesa-dev] [PATCH 07/11] dri/common: use HAVE_LIBDRM over __NOT_HAVE_DRM_H
Emil Velikov
emil.l.velikov at gmail.com
Wed Jul 8 10:07:44 PDT 2015
See previous commit message for details.
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
src/mesa/drivers/dri/common/Android.mk | 13 ++-----------
src/mesa/drivers/dri/common/Makefile.am | 2 +-
src/mesa/drivers/dri/common/SConscript | 4 ----
src/mesa/drivers/dri/common/dri_util.c | 4 ++--
4 files changed, 5 insertions(+), 18 deletions(-)
diff --git a/src/mesa/drivers/dri/common/Android.mk b/src/mesa/drivers/dri/common/Android.mk
index 6986f5e..6e29baf 100644
--- a/src/mesa/drivers/dri/common/Android.mk
+++ b/src/mesa/drivers/dri/common/Android.mk
@@ -43,10 +43,8 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
$(LOCAL_PATH) \
$(intermediates)
-# swrast only
-ifeq ($(MESA_GPU_DRIVERS),swrast)
-LOCAL_CFLAGS := -D__NOT_HAVE_DRM_H
-else
+ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
+LOCAL_CFLAGS := -DHAVE_LIBDRM
LOCAL_SHARED_LIBRARIES := libdrm
endif
@@ -110,13 +108,6 @@ LOCAL_MODULE_CLASS := STATIC_LIBRARIES
LOCAL_C_INCLUDES := \
$(MESA_DRI_C_INCLUDES)
-# swrast only
-ifeq ($(MESA_GPU_DRIVERS),swrast)
-LOCAL_CFLAGS := -D__NOT_HAVE_DRM_H
-else
-LOCAL_SHARED_LIBRARIES := libdrm
-endif
-
LOCAL_SRC_FILES := $(megadriver_stub_FILES)
include $(MESA_COMMON_MK)
diff --git a/src/mesa/drivers/dri/common/Makefile.am b/src/mesa/drivers/dri/common/Makefile.am
index ae19fcb..ee6c691 100644
--- a/src/mesa/drivers/dri/common/Makefile.am
+++ b/src/mesa/drivers/dri/common/Makefile.am
@@ -58,5 +58,5 @@ if DRICOMMON_NEED_LIBDRM
AM_CFLAGS += $(LIBDRM_CFLAGS)
libdricommon_la_LIBADD = $(LIBDRM_LIBS)
else
-AM_CFLAGS += -D__NOT_HAVE_DRM_H
+AM_CFLAGS += -UHAVE_LIBDRM
endif
diff --git a/src/mesa/drivers/dri/common/SConscript b/src/mesa/drivers/dri/common/SConscript
index b402736..adaac29 100644
--- a/src/mesa/drivers/dri/common/SConscript
+++ b/src/mesa/drivers/dri/common/SConscript
@@ -32,10 +32,7 @@ drienv.AppendUnique(LIBS = [
'expat',
])
-# if HAVE_DRI2
drienv.PkgUseModules('DRM')
-# else
-#env.Append(CPPDEFINES = ['__NOT_HAVE_DRM_H'])
sources = drienv.ParseSourceList('Makefile.sources', ['DRI_COMMON_FILES', 'XMLCONFIG_FILES' ])
@@ -57,7 +54,6 @@ env.Append(CPPPATH = [
])
env.Append(CPPDEFINES = [
- '__NOT_HAVE_DRM_H',
'HAVE_DLADDR',
])
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index ae4592c..100a727 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -40,7 +40,7 @@
#include <stdbool.h>
-#ifndef __NOT_HAVE_DRM_H
+#ifdef HAVE_LIBDRM
#include <xf86drm.h>
#endif
#include "dri_util.h"
@@ -137,7 +137,7 @@ driCreateNewScreen2(int scrn, int fd,
setupLoaderExtensions(psp, extensions);
-#ifndef __NOT_HAVE_DRM_H
+#ifdef HAVE_LIBDRM
if (fd != -1) {
drmVersionPtr version = drmGetVersion(fd);
if (version) {
--
2.4.5
More information about the mesa-dev
mailing list