[Mesa-dev] [PATCH 5/8] android: add Android.mk for llvmpipe

Wu Zhen wuzhen at jidemail.com
Fri Jan 6 17:35:06 UTC 2017


From: WuZhen <wuzhen at jidemail.com>

rename old swrast to softpipe, add a new driver llvmpipe

Change-Id: Ia8bc1005ad6846df78bc1f6d0a4196310a049aca
Reviewed-by: Mauro Rossi <issor.oruam at gmail.com>
Reviewed-by: Chih-Wei Huang <cwhuang at linux.org.tw>
---
 Android.common.mk                            |  2 +-
 Android.mk                                   |  6 ++---
 src/gallium/Android.mk                       |  4 ++-
 src/gallium/auxiliary/pipe-loader/Android.mk |  2 +-
 src/gallium/drivers/llvmpipe/Android.mk      | 39 ++++++++++++++++++++++++++++
 src/gallium/state_trackers/dri/Android.mk    |  4 +--
 src/gallium/targets/dri/Android.mk           |  6 ++++-
 7 files changed, 54 insertions(+), 9 deletions(-)
 create mode 100644 src/gallium/drivers/llvmpipe/Android.mk

diff --git a/Android.common.mk b/Android.common.mk
index cb2a4e6104..023895bffd 100644
--- a/Android.common.mk
+++ b/Android.common.mk
@@ -85,7 +85,7 @@ endif
 
 ifneq ($(LOCAL_IS_HOST_MODULE),true)
 # add libdrm if there are hardware drivers
-ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
+ifneq ($(filter-out llvmpipe softpipe,$(MESA_GPU_DRIVERS)),)
 LOCAL_CFLAGS += -DHAVE_LIBDRM
 LOCAL_SHARED_LIBRARIES += libdrm
 endif
diff --git a/Android.mk b/Android.mk
index b52e7f8232..9ef99377a1 100644
--- a/Android.mk
+++ b/Android.mk
@@ -24,7 +24,7 @@
 # BOARD_GPU_DRIVERS should be defined.  The valid values are
 #
 #   classic drivers: i915 i965
-#   gallium drivers: swrast freedreno i915g ilo nouveau r300g r600g radeonsi vc4 virgl vmwgfx
+#   gallium drivers: llvmpipe softpipe freedreno i915g ilo nouveau r300g r600g radeonsi vc4 virgl vmwgfx
 #
 # The main target is libGLES_mesa.  For each classic driver enabled, a DRI
 # module will also be built.  DRI modules will be loaded by libGLES_mesa.
@@ -50,7 +50,7 @@ MESA_COMMON_MK := $(MESA_TOP)/Android.common.mk
 MESA_PYTHON2 := python
 
 classic_drivers := i915 i965
-gallium_drivers := swrast freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx vc4 virgl
+gallium_drivers := llvmpipe softpipe freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx vc4 virgl
 
 MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))
 
@@ -82,7 +82,7 @@ else
 MESA_BUILD_GALLIUM := false
 endif
 
-MESA_ENABLE_LLVM := $(if $(filter radeonsi,$(MESA_GPU_DRIVERS)),true,false)
+MESA_ENABLE_LLVM := $(if $(filter radeonsi llvmpipe,$(MESA_GPU_DRIVERS)),true,false)
 
 # add subdirectories
 ifneq ($(strip $(MESA_GPU_DRIVERS)),)
diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk
index 2b469b65ee..1c719d1968 100644
--- a/src/gallium/Android.mk
+++ b/src/gallium/Android.mk
@@ -34,7 +34,9 @@ SUBDIRS += auxiliary/pipe-loader
 #
 
 # swrast
-ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),)
+ifneq ($(filter llvmpipe,$(MESA_GPU_DRIVERS)),)
+SUBDIRS += winsys/sw/dri drivers/llvmpipe drivers/softpipe
+else ifneq ($(filter softpipe,$(MESA_GPU_DRIVERS)),)
 SUBDIRS += winsys/sw/dri drivers/softpipe
 endif
 
diff --git a/src/gallium/auxiliary/pipe-loader/Android.mk b/src/gallium/auxiliary/pipe-loader/Android.mk
index 006bb0ebfd..3f0563afb6 100644
--- a/src/gallium/auxiliary/pipe-loader/Android.mk
+++ b/src/gallium/auxiliary/pipe-loader/Android.mk
@@ -37,7 +37,7 @@ LOCAL_SRC_FILES := $(COMMON_SOURCES)
 
 LOCAL_MODULE := libmesa_pipe_loader
 
-ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
+ifneq ($(filter-out llvmpipe softpipe,$(MESA_GPU_DRIVERS)),)
 LOCAL_SRC_FILES += $(DRM_SOURCES)
 LOCAL_STATIC_LIBRARIES := libmesa_loader
 endif
diff --git a/src/gallium/drivers/llvmpipe/Android.mk b/src/gallium/drivers/llvmpipe/Android.mk
new file mode 100644
index 0000000000..0193071e60
--- /dev/null
+++ b/src/gallium/drivers/llvmpipe/Android.mk
@@ -0,0 +1,39 @@
+# Mesa 3-D graphics library
+#
+# Copyright (C) 2015-2016 Zhen Wu <wuzhen at jidemail.com>
+# Copyright (C) 2015-2016 Jide Inc.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+
+LOCAL_PATH := $(call my-dir)
+
+# get C_SOURCES
+include $(LOCAL_PATH)/Makefile.sources
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES := \
+	$(C_SOURCES)
+
+LOCAL_MODULE := libmesa_pipe_llvmpipe
+
+LOCAL_SHARED_LIBRARIES += libLLVM
+
+include $(GALLIUM_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/gallium/state_trackers/dri/Android.mk b/src/gallium/state_trackers/dri/Android.mk
index 4bdd136ea9..9eb7c83204 100644
--- a/src/gallium/state_trackers/dri/Android.mk
+++ b/src/gallium/state_trackers/dri/Android.mk
@@ -40,11 +40,11 @@ LOCAL_EXPORT_C_INCLUDE_DIRS := \
 LOCAL_STATIC_LIBRARIES := \
 	libmesa_dri_common \
 
-ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),)
+ifneq ($(filter llvmpipe softpipe,$(MESA_GPU_DRIVERS)),)
 LOCAL_SRC_FILES += $(drisw_SOURCES)
 endif
 
-ifneq ($(filter-out swrast,$(MESA_GPU_DRIVERS)),)
+ifneq ($(filter-out llvmpipe softpipe,$(MESA_GPU_DRIVERS)),)
 LOCAL_SRC_FILES += $(dri2_SOURCES)
 endif
 
diff --git a/src/gallium/targets/dri/Android.mk b/src/gallium/targets/dri/Android.mk
index 972ea83530..5a71867381 100644
--- a/src/gallium/targets/dri/Android.mk
+++ b/src/gallium/targets/dri/Android.mk
@@ -81,7 +81,11 @@ endif
 gallium_DRIVERS += libmesa_winsys_radeon libmesa_pipe_radeon libmesa_amdgpu_addrlib
 LOCAL_SHARED_LIBRARIES += libdrm_radeon
 endif
-ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),)
+ifneq ($(filter llvmpipe,$(MESA_GPU_DRIVERS)),)
+gallium_DRIVERS += libmesa_pipe_llvmpipe libmesa_pipe_softpipe libmesa_winsys_sw_dri
+LOCAL_CFLAGS += -DGALLIUM_LLVMPIPE -DGALLIUM_SOFTPIPE
+LOCAL_SHARED_LIBRARIES += libLLVM
+else ifeq ($(filter softpipe,$(MESA_GPU_DRIVERS)),)
 gallium_DRIVERS += libmesa_pipe_softpipe libmesa_winsys_sw_dri
 LOCAL_CFLAGS += -DGALLIUM_SOFTPIPE
 endif
-- 
2.11.0



More information about the mesa-dev mailing list