From 191b85898eafad69c35ff3e3ea86612b6c2ba808 Mon Sep 17 00:00:00 2001 From: WuZhen <wuzhen@jidemail.com> Date: Sat, 31 Dec 2016 16:19:06 +0800 Subject: [PATCH] Android: add Android.mk for llvmpipe this commit enables llvmpipe when using swrast on android (v1) original WuZhen patch https://lists.freedesktop.org/archives/mesa-dev/2017-January/139789.html (v2) resolution of conflicts and support for Rob Herring "Android: push driver build details to driver makefiles" Changes to be committed compared to WuZhen's: Android.mk add swrast.HAVE_GALLIUM_LLVMPIPE, MESA_ENABLE_LLVM rules src/gallium/Android.mk resolution of conflicts src/gallium/drivers/llvmpipe/Android.mk added GALLIUM_LIBS rules src/gallium/targets/dri/Android.mk resolution of conflicts Signed-off-by: Rob Herring <robh@kernel.org> --- Android.mk | 3 +- src/gallium/Android.mk | 2 +- src/gallium/drivers/llvmpipe/Android.mk | 45 +++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 src/gallium/drivers/llvmpipe/Android.mk diff --git a/Android.mk b/Android.mk index 6571161c878..d09cb3b8af4 100644 --- a/Android.mk +++ b/Android.mk @@ -47,6 +47,7 @@ MESA_PYTHON2 := python # in form of <driver name>.<boolean make variable> classic_drivers := i915.HAVE_I915_DRI i965.HAVE_I965_DRI gallium_drivers := \ + swrast.HAVE_GALLIUM_LLVMPIPE \ swrast.HAVE_GALLIUM_SOFTPIPE \ freedreno.HAVE_GALLIUM_FREEDRENO \ i915g.HAVE_GALLIUM_I915 \ @@ -84,7 +85,7 @@ else MESA_ENABLE_ASM := false endif -ifneq ($(filter true, $(HAVE_GALLIUM_RADEONSI)),) +ifneq ($(filter true, $(HAVE_GALLIUM_RADEONSI) $(HAVE_GALLIUM_LLVMPIPE)),) MESA_ENABLE_LLVM := true endif diff --git a/src/gallium/Android.mk b/src/gallium/Android.mk index 8be365a5504..473fa5e2fed 100644 --- a/src/gallium/Android.mk +++ b/src/gallium/Android.mk @@ -34,7 +34,7 @@ SUBDIRS += auxiliary/pipe-loader # Gallium drivers and their respective winsys # -SUBDIRS += winsys/sw/dri drivers/softpipe +SUBDIRS += winsys/sw/dri drivers/llvmpipe drivers/softpipe SUBDIRS += winsys/freedreno/drm drivers/freedreno SUBDIRS += winsys/i915/drm drivers/i915 SUBDIRS += winsys/nouveau/drm drivers/nouveau diff --git a/src/gallium/drivers/llvmpipe/Android.mk b/src/gallium/drivers/llvmpipe/Android.mk new file mode 100644 index 00000000000..5980aeb1785 --- /dev/null +++ b/src/gallium/drivers/llvmpipe/Android.mk @@ -0,0 +1,45 @@ +# Mesa 3-D graphics library +# +# Copyright (C) 2015-2016 Zhen Wu <wuzhen@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 + +$(call mesa-build-with-llvm) + +include $(GALLIUM_COMMON_MK) +include $(BUILD_STATIC_LIBRARY) + +ifneq ($(HAVE_GALLIUM_LLVMPIPE),) +GALLIUM_TARGET_DRIVERS += swrast kms_swrast +$(eval GALLIUM_LIBS += $(LOCAL_MODULE) libmesa_winsys_sw_dri libmesa_winsys_sw_kms_dri) +$(eval GALLIUM_SHARED_LIBS += $(LOCAL_SHARED_LIBRARIES)) +endif -- GitLab