[Mesa-dev] [PATCH] isl: add support for Android libisl static
Mauro Rossi
issor.oruam at gmail.com
Tue May 10 23:56:22 UTC 2016
This patch adds support for libisl static, needed to build i965.
Android.genxml.gen.mk generates the necessary gen%_pack.h headers
Android.gen.mk generates isl_format_layout.c
---
Android.mk | 1 +
src/intel/isl/Android.gen.mk | 47 ++++++++++++
src/intel/isl/Android.genxml.gen.mk | 75 ++++++++++++++++++
src/intel/isl/Android.mk | 143 +++++++++++++++++++++++++++++++++++
src/intel/isl/Makefile.sources | 31 ++++++++
src/mesa/drivers/dri/i965/Android.mk | 6 +-
6 files changed, 301 insertions(+), 2 deletions(-)
create mode 100644 src/intel/isl/Android.gen.mk
create mode 100644 src/intel/isl/Android.genxml.gen.mk
create mode 100644 src/intel/isl/Android.mk
create mode 100644 src/intel/isl/Makefile.sources
diff --git a/Android.mk b/Android.mk
index bd42bc6..222c6b9 100644
--- a/Android.mk
+++ b/Android.mk
@@ -94,6 +94,7 @@ SUBDIRS := \
src/mesa \
src/util \
src/egl \
+ src/intel/isl \
src/mesa/drivers/dri
INC_DIRS := $(call all-named-subdir-makefiles,$(SUBDIRS))
diff --git a/src/intel/isl/Android.gen.mk b/src/intel/isl/Android.gen.mk
new file mode 100644
index 0000000..dcfdfaf
--- /dev/null
+++ b/src/intel/isl/Android.gen.mk
@@ -0,0 +1,47 @@
+#
+# Copyright (C) 2016 Linaro, Ltd., Rob Herring <robh at kernel.org>
+#
+# 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.
+#
+
+ifeq ($(LOCAL_MODULE_CLASS),)
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+endif
+
+isl_format_layout_deps := \
+ $(LOCAL_PATH)/isl_format_layout_gen.bash \
+ $(LOCAL_PATH)/isl_format_layout.csv
+
+intermediates := $(call local-generated-sources-dir)
+
+define bash-gen
+ @mkdir -p $(dir $@)
+ @echo "Gen Bash: $(PRIVATE_MODULE) <= $(notdir $(@))"
+ $(hide) $(PRIVATE_SCRIPT) < $(PRIVATE_CSV) > $@
+endef
+
+$(intermediates)/isl_format_layout.c: PRIVATE_SCRIPT := bash -c $(LOCAL_PATH)/isl_format_layout_gen.bash
+$(intermediates)/isl_format_layout.c: PRIVATE_CSV := $(LOCAL_PATH)/isl_format_layout.csv
+$(intermediates)/isl_format_layout.c: $(isl_format_layout_deps)
+ $(call bash-gen)
+
+LOCAL_SRC_FILES := $(filter-out $(libisl_GENERATED_FILES), $(LOCAL_SRC_FILES))
+
+LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, \
+ $(libisl_GENERATED_FILES))
diff --git a/src/intel/isl/Android.genxml.gen.mk b/src/intel/isl/Android.genxml.gen.mk
new file mode 100644
index 0000000..4b69c76
--- /dev/null
+++ b/src/intel/isl/Android.genxml.gen.mk
@@ -0,0 +1,75 @@
+# Mesa 3-D graphics library
+#
+# Copyright (C) 2010-2011 Chia-I Wu <olvaffe at gmail.com>
+# Copyright (C) 2010-2011 LunarG 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.
+
+# included by isl Android.mk for source generation
+
+ifeq ($(LOCAL_MODULE_CLASS),)
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+endif
+
+intermediates := $(call local-generated-sources-dir)
+
+LOCAL_C_INCLUDES += $(intermediates)
+
+# This is the list of auto-generated files headers
+sources := \
+ genxml/gen6_pack.h \
+ genxml/gen7_pack.h \
+ genxml/gen75_pack.h \
+ genxml/gen8_pack.h \
+ genxml/gen9_pack.h
+
+sources := $(addprefix $(intermediates)/, $(sources))
+
+LOCAL_GENERATED_SOURCES += $(sources)
+
+define header-gen
+ @mkdir -p $(dir $@)
+ @echo "Gen Header: $(PRIVATE_MODULE) <= $(notdir $(@))"
+ $(hide) $(PRIVATE_SCRIPT) $(PRIVATE_XML) > $@
+endef
+
+$(intermediates)/genxml/gen6_pack.h : PRIVATE_SCRIPT := python3 $(LOCAL_PATH)/../genxml/gen_pack_header.py
+$(intermediates)/genxml/gen6_pack.h : PRIVATE_XML := $(LOCAL_PATH)/../genxml/gen6.xml
+$(intermediates)/genxml/gen6_pack.h : $(LOCAL_PATH)/../genxml/gen6.xml $(LOCAL_PATH)/../genxml/gen_pack_header.py
+ $(call header-gen)
+
+$(intermediates)/genxml/gen7_pack.h : PRIVATE_SCRIPT := python3 $(LOCAL_PATH)/../genxml/gen_pack_header.py
+$(intermediates)/genxml/gen7_pack.h : PRIVATE_XML := $(LOCAL_PATH)/../genxml/gen7.xml
+$(intermediates)/genxml/gen7_pack.h : $(LOCAL_PATH)/../genxml/gen7.xml $(LOCAL_PATH)/../genxml/gen_pack_header.py
+ $(call header-gen)
+
+$(intermediates)/genxml/gen75_pack.h : PRIVATE_SCRIPT := python3 $(LOCAL_PATH)/../genxml/gen_pack_header.py
+$(intermediates)/genxml/gen75_pack.h : PRIVATE_XML := $(LOCAL_PATH)/../genxml/gen75.xml
+$(intermediates)/genxml/gen75_pack.h : $(LOCAL_PATH)/../genxml/gen75.xml $(LOCAL_PATH)/../genxml/gen_pack_header.py
+ $(call header-gen)
+
+$(intermediates)/genxml/gen8_pack.h : PRIVATE_SCRIPT := python3 $(LOCAL_PATH)/../genxml/gen_pack_header.py
+$(intermediates)/genxml/gen8_pack.h : PRIVATE_XML := $(LOCAL_PATH)/../genxml/gen8.xml
+$(intermediates)/genxml/gen8_pack.h : $(LOCAL_PATH)/../genxml/gen8.xml $(LOCAL_PATH)/../genxml/gen_pack_header.py
+ $(call header-gen)
+
+$(intermediates)/genxml/gen9_pack.h : PRIVATE_SCRIPT := python3 $(LOCAL_PATH)/../genxml/gen_pack_header.py
+$(intermediates)/genxml/gen9_pack.h : PRIVATE_XML := $(LOCAL_PATH)/../genxml/gen9.xml
+$(intermediates)/genxml/gen9_pack.h : $(LOCAL_PATH)/../genxml/gen9.xml $(LOCAL_PATH)/../genxml/gen_pack_header.py
+ $(call header-gen)
diff --git a/src/intel/isl/Android.mk b/src/intel/isl/Android.mk
new file mode 100644
index 0000000..86f9f5b
--- /dev/null
+++ b/src/intel/isl/Android.mk
@@ -0,0 +1,143 @@
+#
+# Copyright (C) 2011 Intel Corporation
+# Copyright (C) 2010-2011 Chia-I Wu <olvaffe at gmail.com>
+# Copyright (C) 2010-2011 LunarG
+#
+# 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)
+
+# Import variables libisl_FILES.
+include $(LOCAL_PATH)/Makefile.sources
+
+# ---------------------------------------
+# Build libisl_gen7
+# ---------------------------------------
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libisl_gen7
+
+LOCAL_SRC_FILES := \
+ $(libisl_gen7_FILES)
+
+LOCAL_CFLAGS := -DGEN_VERSIONx10=70
+
+LOCAL_C_INCLUDES := \
+ $(MESA_TOP)/src/ \
+ $(MESA_TOP)/src/intel \
+ $(MESA_TOP)/src/mesa/drivers/dri/i965
+
+include $(LOCAL_PATH)/Android.genxml.gen.mk
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+# ---------------------------------------
+# Build libisl_gen75
+# ---------------------------------------
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libisl_gen75
+
+LOCAL_SRC_FILES := \
+ $(libisl_gen75_FILES)
+
+LOCAL_CFLAGS := -DGEN_VERSIONx10=75
+
+LOCAL_C_INCLUDES := \
+ $(MESA_TOP)/src/ \
+ $(MESA_TOP)/src/intel \
+ $(MESA_TOP)/src/mesa/drivers/dri/i965
+
+include $(LOCAL_PATH)/Android.genxml.gen.mk
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+# ---------------------------------------
+# Build libisl_gen8
+# ---------------------------------------
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libisl_gen8
+
+LOCAL_SRC_FILES := \
+ $(libisl_gen8_FILES)
+
+LOCAL_CFLAGS := -DGEN_VERSIONx10=80
+
+LOCAL_C_INCLUDES := \
+ $(MESA_TOP)/src/ \
+ $(MESA_TOP)/src/intel \
+ $(MESA_TOP)/src/mesa/drivers/dri/i965
+
+include $(LOCAL_PATH)/Android.genxml.gen.mk
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+# ---------------------------------------
+# Build libisl_gen9
+# ---------------------------------------
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libisl_gen9
+
+LOCAL_SRC_FILES := \
+ $(libisl_gen9_FILES)
+
+LOCAL_CFLAGS := -DGEN_VERSIONx10=90
+
+LOCAL_C_INCLUDES := \
+ $(MESA_TOP)/src/ \
+ $(MESA_TOP)/src/intel \
+ $(MESA_TOP)/src/mesa/drivers/dri/i965
+
+include $(LOCAL_PATH)/Android.genxml.gen.mk
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
+
+# ---------------------------------------
+# Build libisl
+# ---------------------------------------
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libisl
+
+LOCAL_SRC_FILES := \
+ $(libisl_FILES)
+
+LOCAL_C_INCLUDES := \
+ $(MESA_TOP)/src/mapi \
+ $(MESA_TOP)/src/mesa \
+ $(MESA_TOP)/src/mesa/drivers/dri/i965
+
+LOCAL_WHOLE_STATIC_LIBRARIES := \
+ libisl_gen7 \
+ libisl_gen75 \
+ libisl_gen8 \
+ libisl_gen9
+
+include $(LOCAL_PATH)/Android.genxml.gen.mk
+include $(LOCAL_PATH)/Android.gen.mk
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)
diff --git a/src/intel/isl/Makefile.sources b/src/intel/isl/Makefile.sources
new file mode 100644
index 0000000..c8eb5b3
--- /dev/null
+++ b/src/intel/isl/Makefile.sources
@@ -0,0 +1,31 @@
+libisl_FILES = \
+ isl.c \
+ isl.h \
+ isl_format.c \
+ isl_format_layout.c \
+ isl_gen4.c \
+ isl_gen4.h \
+ isl_gen6.c \
+ isl_gen6.h \
+ isl_storage_image.c
+
+libisl_gen7_FILES = \
+ isl_gen7.c \
+ isl_gen7.h \
+ isl_surface_state.c
+
+libisl_gen75_FILES = \
+ isl_surface_state.c
+
+libisl_gen8_FILES = \
+ isl_gen8.c \
+ isl_gen8.h \
+ isl_surface_state.c
+
+libisl_gen9_FILES = \
+ isl_gen9.c \
+ isl_gen9.h \
+ isl_surface_state.c
+
+libisl_GENERATED_FILES = \
+ isl_format_layout.c
diff --git a/src/mesa/drivers/dri/i965/Android.mk b/src/mesa/drivers/dri/i965/Android.mk
index 9fd3a30..b46d5e3 100644
--- a/src/mesa/drivers/dri/i965/Android.mk
+++ b/src/mesa/drivers/dri/i965/Android.mk
@@ -45,14 +45,16 @@ LOCAL_CFLAGS += \
endif
LOCAL_C_INCLUDES := \
- $(MESA_DRI_C_INCLUDES)
+ $(MESA_DRI_C_INCLUDES) \
+ $(MESA_TOP)/src/intel
LOCAL_SRC_FILES := \
$(i965_compiler_FILES) \
$(i965_FILES)
LOCAL_WHOLE_STATIC_LIBRARIES := \
- $(MESA_DRI_WHOLE_STATIC_LIBRARIES)
+ $(MESA_DRI_WHOLE_STATIC_LIBRARIES) \
+ libisl
LOCAL_SHARED_LIBRARIES := \
$(MESA_DRI_SHARED_LIBRARIES) \
--
2.7.4
More information about the mesa-dev
mailing list