1b8e80941Smrg# Copyright © 2016 Intel Corporation 2b8e80941Smrg# Copyright © 2016 Mauro Rossi <issor.oruam@gmail.com> 3b8e80941Smrg# 4b8e80941Smrg# Permission is hereby granted, free of charge, to any person obtaining a 5b8e80941Smrg# copy of this software and associated documentation files (the "Software"), 6b8e80941Smrg# to deal in the Software without restriction, including without limitation 7b8e80941Smrg# the rights to use, copy, modify, merge, publish, distribute, sublicense, 8b8e80941Smrg# and/or sell copies of the Software, and to permit persons to whom the 9b8e80941Smrg# Software is furnished to do so, subject to the following conditions: 10b8e80941Smrg# 11b8e80941Smrg# The above copyright notice and this permission notice shall be included 12b8e80941Smrg# in all copies or substantial portions of the Software. 13b8e80941Smrg# 14b8e80941Smrg# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15b8e80941Smrg# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16b8e80941Smrg# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17b8e80941Smrg# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18b8e80941Smrg# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19b8e80941Smrg# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20b8e80941Smrg# DEALINGS IN THE SOFTWARE. 21b8e80941Smrg# 22b8e80941Smrg 23b8e80941Smrg# --------------------------------------- 24b8e80941Smrg# libmesa_isl_gen* common variables 25b8e80941Smrg# --------------------------------------- 26b8e80941Smrg 27b8e80941SmrgLIBISL_GENX_COMMON_INCLUDES := \ 28b8e80941Smrg $(MESA_TOP)/src/ 29b8e80941Smrg 30b8e80941Smrg# --------------------------------------- 31b8e80941Smrg# Build libmesa_isl_gen4 32b8e80941Smrg# --------------------------------------- 33b8e80941Smrg 34b8e80941Smrginclude $(CLEAR_VARS) 35b8e80941Smrg 36b8e80941SmrgLOCAL_MODULE := libmesa_isl_gen4 37b8e80941Smrg 38b8e80941SmrgLOCAL_SRC_FILES := $(ISL_GEN4_FILES) 39b8e80941Smrg 40b8e80941SmrgLOCAL_CFLAGS := -DGEN_VERSIONx10=40 41b8e80941Smrg 42b8e80941SmrgLOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES) 43b8e80941Smrg 44b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml 45b8e80941Smrg 46b8e80941Smrginclude $(MESA_COMMON_MK) 47b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 48b8e80941Smrg 49b8e80941Smrg# --------------------------------------- 50b8e80941Smrg# Build libmesa_isl_gen5 51b8e80941Smrg# --------------------------------------- 52b8e80941Smrg 53b8e80941Smrginclude $(CLEAR_VARS) 54b8e80941Smrg 55b8e80941SmrgLOCAL_MODULE := libmesa_isl_gen5 56b8e80941Smrg 57b8e80941SmrgLOCAL_SRC_FILES := $(ISL_GEN5_FILES) 58b8e80941Smrg 59b8e80941SmrgLOCAL_CFLAGS := -DGEN_VERSIONx10=50 60b8e80941Smrg 61b8e80941SmrgLOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES) 62b8e80941Smrg 63b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml 64b8e80941Smrg 65b8e80941Smrginclude $(MESA_COMMON_MK) 66b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 67b8e80941Smrg 68b8e80941Smrg# --------------------------------------- 69b8e80941Smrg# Build libmesa_isl_gen6 70b8e80941Smrg# --------------------------------------- 71b8e80941Smrg 72b8e80941Smrginclude $(CLEAR_VARS) 73b8e80941Smrg 74b8e80941SmrgLOCAL_MODULE := libmesa_isl_gen6 75b8e80941Smrg 76b8e80941SmrgLOCAL_SRC_FILES := $(ISL_GEN6_FILES) 77b8e80941Smrg 78b8e80941SmrgLOCAL_CFLAGS := -DGEN_VERSIONx10=60 79b8e80941Smrg 80b8e80941SmrgLOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES) 81b8e80941Smrg 82b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml 83b8e80941Smrg 84b8e80941Smrginclude $(MESA_COMMON_MK) 85b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 86b8e80941Smrg 87b8e80941Smrg# --------------------------------------- 88b8e80941Smrg# Build libmesa_isl_gen7 89b8e80941Smrg# --------------------------------------- 90b8e80941Smrg 91b8e80941Smrginclude $(CLEAR_VARS) 92b8e80941Smrg 93b8e80941SmrgLOCAL_MODULE := libmesa_isl_gen7 94b8e80941Smrg 95b8e80941SmrgLOCAL_SRC_FILES := $(ISL_GEN7_FILES) 96b8e80941Smrg 97b8e80941SmrgLOCAL_CFLAGS := -DGEN_VERSIONx10=70 98b8e80941Smrg 99b8e80941SmrgLOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES) 100b8e80941Smrg 101b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml 102b8e80941Smrg 103b8e80941Smrginclude $(MESA_COMMON_MK) 104b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 105b8e80941Smrg 106b8e80941Smrg# --------------------------------------- 107b8e80941Smrg# Build libmesa_isl_gen75 108b8e80941Smrg# --------------------------------------- 109b8e80941Smrg 110b8e80941Smrginclude $(CLEAR_VARS) 111b8e80941Smrg 112b8e80941SmrgLOCAL_MODULE := libmesa_isl_gen75 113b8e80941Smrg 114b8e80941SmrgLOCAL_SRC_FILES := $(ISL_GEN75_FILES) 115b8e80941Smrg 116b8e80941SmrgLOCAL_CFLAGS := -DGEN_VERSIONx10=75 117b8e80941Smrg 118b8e80941SmrgLOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES) 119b8e80941Smrg 120b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml 121b8e80941Smrg 122b8e80941Smrginclude $(MESA_COMMON_MK) 123b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 124b8e80941Smrg 125b8e80941Smrg# --------------------------------------- 126b8e80941Smrg# Build libmesa_isl_gen8 127b8e80941Smrg# --------------------------------------- 128b8e80941Smrg 129b8e80941Smrginclude $(CLEAR_VARS) 130b8e80941Smrg 131b8e80941SmrgLOCAL_MODULE := libmesa_isl_gen8 132b8e80941Smrg 133b8e80941SmrgLOCAL_SRC_FILES := $(ISL_GEN8_FILES) 134b8e80941Smrg 135b8e80941SmrgLOCAL_CFLAGS := -DGEN_VERSIONx10=80 136b8e80941Smrg 137b8e80941SmrgLOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES) 138b8e80941Smrg 139b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml 140b8e80941Smrg 141b8e80941Smrginclude $(MESA_COMMON_MK) 142b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 143b8e80941Smrg 144b8e80941Smrg# --------------------------------------- 145b8e80941Smrg# Build libmesa_isl_gen9 146b8e80941Smrg# --------------------------------------- 147b8e80941Smrg 148b8e80941Smrginclude $(CLEAR_VARS) 149b8e80941Smrg 150b8e80941SmrgLOCAL_MODULE := libmesa_isl_gen9 151b8e80941Smrg 152b8e80941SmrgLOCAL_SRC_FILES := $(ISL_GEN9_FILES) 153b8e80941Smrg 154b8e80941SmrgLOCAL_CFLAGS := -DGEN_VERSIONx10=90 155b8e80941Smrg 156b8e80941SmrgLOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES) 157b8e80941Smrg 158b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml 159b8e80941Smrg 160b8e80941Smrginclude $(MESA_COMMON_MK) 161b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 162b8e80941Smrg 163b8e80941Smrg# --------------------------------------- 164b8e80941Smrg# Build libmesa_isl_gen10 165b8e80941Smrg# --------------------------------------- 166b8e80941Smrg 167b8e80941Smrginclude $(CLEAR_VARS) 168b8e80941Smrg 169b8e80941SmrgLOCAL_MODULE := libmesa_isl_gen10 170b8e80941Smrg 171b8e80941SmrgLOCAL_SRC_FILES := $(ISL_GEN10_FILES) 172b8e80941Smrg 173b8e80941SmrgLOCAL_CFLAGS := -DGEN_VERSIONx10=100 174b8e80941Smrg 175b8e80941SmrgLOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES) 176b8e80941Smrg 177b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml 178b8e80941Smrg 179b8e80941Smrginclude $(MESA_COMMON_MK) 180b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 181b8e80941Smrg 182b8e80941Smrg# --------------------------------------- 183b8e80941Smrg# Build libmesa_isl_gen11 184b8e80941Smrg# --------------------------------------- 185b8e80941Smrg 186b8e80941Smrginclude $(CLEAR_VARS) 187b8e80941Smrg 188b8e80941SmrgLOCAL_MODULE := libmesa_isl_gen11 189b8e80941Smrg 190b8e80941SmrgLOCAL_SRC_FILES := $(ISL_GEN11_FILES) 191b8e80941Smrg 192b8e80941SmrgLOCAL_CFLAGS := -DGEN_VERSIONx10=110 193b8e80941Smrg 194b8e80941SmrgLOCAL_C_INCLUDES := $(LIBISL_GENX_COMMON_INCLUDES) 195b8e80941Smrg 196b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES := libmesa_genxml 197b8e80941Smrg 198b8e80941Smrginclude $(MESA_COMMON_MK) 199b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 200b8e80941Smrg 201b8e80941Smrg# --------------------------------------- 202b8e80941Smrg# Build libmesa_isl_tiled_memcpy 203b8e80941Smrg# --------------------------------------- 204b8e80941Smrg 205b8e80941Smrginclude $(CLEAR_VARS) 206b8e80941Smrg 207b8e80941SmrgLOCAL_MODULE := libmesa_isl_tiled_memcpy 208b8e80941Smrg 209b8e80941SmrgLOCAL_C_INCLUDES := \ 210b8e80941Smrg $(MESA_TOP)/src/gallium/include \ 211b8e80941Smrg $(MESA_TOP)/src/mapi \ 212b8e80941Smrg $(MESA_TOP)/src/mesa 213b8e80941Smrg 214b8e80941SmrgLOCAL_SRC_FILES := $(ISL_TILED_MEMCPY_FILES) 215b8e80941Smrg 216b8e80941Smrginclude $(MESA_COMMON_MK) 217b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 218b8e80941Smrg 219b8e80941Smrg# --------------------------------------- 220b8e80941Smrg# Build libmesa_isl_tiled_memcpy_sse41 221b8e80941Smrg# --------------------------------------- 222b8e80941Smrg 223b8e80941Smrgifeq ($(ARCH_X86_HAVE_SSE4_1),true) 224b8e80941Smrginclude $(CLEAR_VARS) 225b8e80941Smrg 226b8e80941SmrgLOCAL_MODULE := libmesa_isl_tiled_memcpy_sse41 227b8e80941Smrg 228b8e80941SmrgLOCAL_C_INCLUDES := \ 229b8e80941Smrg $(MESA_TOP)/src/gallium/include \ 230b8e80941Smrg $(MESA_TOP)/src/mapi \ 231b8e80941Smrg $(MESA_TOP)/src/mesa 232b8e80941Smrg 233b8e80941SmrgLOCAL_SRC_FILES := $(ISL_TILED_MEMCPY_SSE41_FILES) 234b8e80941Smrg 235b8e80941SmrgLOCAL_CFLAGS += \ 236b8e80941Smrg -DUSE_SSE41 -msse4.1 -mstackrealign 237b8e80941Smrg 238b8e80941Smrginclude $(MESA_COMMON_MK) 239b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 240b8e80941Smrgendif 241b8e80941Smrg 242b8e80941Smrg# --------------------------------------- 243b8e80941Smrg# Build libmesa_isl 244b8e80941Smrg# --------------------------------------- 245b8e80941Smrg 246b8e80941Smrginclude $(CLEAR_VARS) 247b8e80941Smrg 248b8e80941SmrgLOCAL_MODULE := libmesa_isl 249b8e80941Smrg 250b8e80941SmrgLOCAL_SRC_FILES := $(ISL_FILES) 251b8e80941Smrg 252b8e80941SmrgLOCAL_C_INCLUDES := \ 253b8e80941Smrg $(MESA_TOP)/src/gallium/include \ 254b8e80941Smrg $(MESA_TOP)/src/gallium/auxiliary \ 255b8e80941Smrg $(MESA_TOP)/src/mapi \ 256b8e80941Smrg $(MESA_TOP)/src/mesa \ 257b8e80941Smrg $(MESA_TOP)/src/intel 258b8e80941Smrg 259b8e80941SmrgLOCAL_EXPORT_C_INCLUDE_DIRS := $(MESA_TOP)/src/intel 260b8e80941Smrg 261b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES := \ 262b8e80941Smrg libmesa_isl_gen4 \ 263b8e80941Smrg libmesa_isl_gen5 \ 264b8e80941Smrg libmesa_isl_gen6 \ 265b8e80941Smrg libmesa_isl_gen7 \ 266b8e80941Smrg libmesa_isl_gen75 \ 267b8e80941Smrg libmesa_isl_gen8 \ 268b8e80941Smrg libmesa_isl_gen9 \ 269b8e80941Smrg libmesa_isl_gen10 \ 270b8e80941Smrg libmesa_isl_gen11 \ 271b8e80941Smrg libmesa_genxml \ 272b8e80941Smrg libmesa_isl_tiled_memcpy 273b8e80941Smrg 274b8e80941Smrgifeq ($(ARCH_X86_HAVE_SSE4_1),true) 275b8e80941SmrgLOCAL_CFLAGS += \ 276b8e80941Smrg -DUSE_SSE41 277b8e80941SmrgLOCAL_WHOLE_STATIC_LIBRARIES += \ 278b8e80941Smrg libmesa_isl_tiled_memcpy_sse41 279b8e80941Smrgendif 280b8e80941Smrg 281b8e80941Smrg# Autogenerated sources 282b8e80941Smrg 283b8e80941SmrgLOCAL_MODULE_CLASS := STATIC_LIBRARIES 284b8e80941Smrg 285b8e80941Smrgintermediates := $(call local-generated-sources-dir) 286b8e80941Smrg 287b8e80941SmrgLOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, $(ISL_GENERATED_FILES)) 288b8e80941Smrg 289b8e80941Smrgdefine bash-gen 290b8e80941Smrg @mkdir -p $(dir $@) 291b8e80941Smrg @echo "Gen Bash: $(PRIVATE_MODULE) <= $(notdir $(@))" 292b8e80941Smrg $(hide) $(PRIVATE_SCRIPT) --csv $(PRIVATE_CSV) --out $@ 293b8e80941Smrgendef 294b8e80941Smrg 295b8e80941Smrgisl_format_layout_deps := \ 296b8e80941Smrg $(LOCAL_PATH)/isl/gen_format_layout.py \ 297b8e80941Smrg $(LOCAL_PATH)/isl/isl_format_layout.csv 298b8e80941Smrg 299b8e80941Smrg$(intermediates)/isl/isl_format_layout.c: PRIVATE_SCRIPT := $(MESA_PYTHON2) $(LOCAL_PATH)/isl/gen_format_layout.py 300b8e80941Smrg$(intermediates)/isl/isl_format_layout.c: PRIVATE_CSV := $(LOCAL_PATH)/isl/isl_format_layout.csv 301b8e80941Smrg$(intermediates)/isl/isl_format_layout.c: $(isl_format_layout_deps) 302b8e80941Smrg $(call bash-gen) 303b8e80941Smrg 304b8e80941Smrginclude $(MESA_COMMON_MK) 305b8e80941Smrginclude $(BUILD_STATIC_LIBRARY) 306