blob: f7c930e7585a26dae5bb8e3b6f488e4fdcc01019 [file] [log] [blame]
Naseer Ahmed4d35af82012-07-11 23:43:42 -07001#Common headers
Naseer Ahmedd68b47d2016-04-05 17:40:02 -04002display_top := $(call my-dir)
Naseer Ahmed30d3f1c2018-10-24 20:53:13 -04003
4#Get the highest display config version available
Yuchao Mada4d97a2018-09-20 15:33:43 +08005display_config_version := $(shell \
Dileep Marchyaafa45bc2019-06-21 17:05:31 +05306 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.10" ];\
7 then echo DISPLAY_CONFIG_1_10; fi)
8
9ifeq ($(display_config_version),)
10display_config_version := $(shell \
Archit Srivastavaa59c4ff2019-05-20 10:54:22 +053011 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.9" ];\
12 then echo DISPLAY_CONFIG_1_9; fi)
Dileep Marchyaafa45bc2019-06-21 17:05:31 +053013endif
Archit Srivastavaa59c4ff2019-05-20 10:54:22 +053014ifeq ($(display_config_version),)
15display_config_version := $(shell \
Ramkumar Radhakrishnan44c64362018-12-12 13:03:59 -080016 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.8" ];\
17 then echo DISPLAY_CONFIG_1_8; fi)
Archit Srivastavaa59c4ff2019-05-20 10:54:22 +053018endif
Ramkumar Radhakrishnan44c64362018-12-12 13:03:59 -080019ifeq ($(display_config_version),)
20display_config_version := $(shell \
Dileep Marchyae1c7c8d2018-12-06 15:27:45 +053021 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.7" ];\
22 then echo DISPLAY_CONFIG_1_7; fi)
Ramkumar Radhakrishnan44c64362018-12-12 13:03:59 -080023endif
Dileep Marchyae1c7c8d2018-12-06 15:27:45 +053024ifeq ($(display_config_version),)
25display_config_version := $(shell \
26 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.6" ];\
27 then echo DISPLAY_CONFIG_1_6; fi)
28endif
29ifeq ($(display_config_version),)
30display_config_version := $(shell \
Yuchao Mada4d97a2018-09-20 15:33:43 +080031 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.5" ];\
32 then echo DISPLAY_CONFIG_1_5; fi)
Dileep Marchyae1c7c8d2018-12-06 15:27:45 +053033endif
Naseer Ahmed30d3f1c2018-10-24 20:53:13 -040034ifeq ($(display_config_version),)
35display_config_version := $(shell \
36 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.4" ];\
37 then echo DISPLAY_CONFIG_1_4; fi)
38endif
39ifeq ($(display_config_version),)
40display_config_version := $(shell \
41 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.3" ];\
42 then echo DISPLAY_CONFIG_1_3; fi)
43endif
44ifeq ($(display_config_version),)
45display_config_version := $(shell \
46 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.2" ];\
47 then echo DISPLAY_CONFIG_1_2; fi)
48endif
49ifeq ($(display_config_version),)
50display_config_version := $(shell \
51 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.1" ];\
52 then echo DISPLAY_CONFIG_1_1; fi)
53endif
54
Naseer Ahmedb6b936d2016-08-05 16:23:32 -040055#Common C flags
Saurabh Shah546f77b2017-12-13 14:10:39 -080056common_flags := -Wno-missing-field-initializers
Rajavenu Kyatham42d11cb2019-04-16 13:03:29 +053057common_flags += -Wall -Werror -std=c++14
Naseer Ahmed85020082017-05-17 14:36:46 -040058common_flags += -DUSE_GRALLOC1
Saurabh Shahf84c4122017-04-07 10:34:40 -070059ifeq ($(TARGET_IS_HEADLESS), true)
Naseer Ahmed4d78d032017-03-22 12:47:30 -040060 common_flags += -DTARGET_HEADLESS
61 LOCAL_CLANG := false
Saurabh Shah7d476ed2016-06-27 16:40:58 -070062endif
Naseer Ahmedb6b936d2016-08-05 16:23:32 -040063
Naseer Ahmeda699e792017-11-09 15:08:31 -050064ifeq ($(display_config_version), DISPLAY_CONFIG_1_1)
65 common_flags += -DDISPLAY_CONFIG_1_1
66endif
Dileep Marchyaf3ce11f2018-04-30 23:35:46 +053067ifeq ($(display_config_version), DISPLAY_CONFIG_1_2)
68 common_flags += -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
69endif
Ramkumar Radhakrishnanf985d482018-07-23 18:10:41 -070070ifeq ($(display_config_version), DISPLAY_CONFIG_1_3)
71 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
72endif
Ramakant Singhdbe738a2018-08-23 23:57:07 +053073ifeq ($(display_config_version), DISPLAY_CONFIG_1_4)
74 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2
75 common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_4
76endif
Yuchao Mada4d97a2018-09-20 15:33:43 +080077ifeq ($(display_config_version), DISPLAY_CONFIG_1_5)
78 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
79 common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5
80endif
Dileep Marchyae1c7c8d2018-12-06 15:27:45 +053081ifeq ($(display_config_version), DISPLAY_CONFIG_1_6)
82 common_flags += -DDISPLAY_CONFIG_1_6 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_4
83 common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
84endif
85ifeq ($(display_config_version), DISPLAY_CONFIG_1_7)
86 common_flags += -DDISPLAY_CONFIG_1_7
87 common_flags += -DDISPLAY_CONFIG_1_6 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_4
88 common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
89endif
Ramkumar Radhakrishnan44c64362018-12-12 13:03:59 -080090ifeq ($(display_config_version), DISPLAY_CONFIG_1_8)
91 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
92 common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6
93 common_flags += -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8
94endif
Archit Srivastavaa59c4ff2019-05-20 10:54:22 +053095ifeq ($(display_config_version), DISPLAY_CONFIG_1_9)
96 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
97 common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6
98 common_flags += -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8 -DDISPLAY_CONFIG_1_9
99endif
Dileep Marchyaafa45bc2019-06-21 17:05:31 +0530100ifeq ($(display_config_version), DISPLAY_CONFIG_1_10)
101 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
102 common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6
103 common_flags += -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8 -DDISPLAY_CONFIG_1_9
104 common_flags += -DDISPLAY_CONFIG_1_10
105endif
Naseer Ahmeda699e792017-11-09 15:08:31 -0500106
Arun Kumar K.Rca196fc2016-12-07 19:28:30 -0800107ifeq ($(TARGET_USES_COLOR_METADATA), true)
Naseer Ahmed4d78d032017-03-22 12:47:30 -0400108 common_flags += -DUSE_COLOR_METADATA
Arun Kumar K.Rb2771bf2016-10-03 21:38:23 -0700109endif
110
Naseer Ahmed4d78d032017-03-22 12:47:30 -0400111ifeq ($(TARGET_USES_QCOM_BSP),true)
112 common_flags += -DQTI_BSP
Praveena Pachipulusu734118a2014-12-04 14:53:12 +0530113endif
114
Naseer Ahmed4d35af82012-07-11 23:43:42 -0700115ifeq ($(ARCH_ARM_HAVE_NEON),true)
116 common_flags += -D__ARM_HAVE_NEON
117endif
118
Shalaj Jain3c490412015-04-22 16:52:03 -0700119ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)), true)
120 common_flags += -DMASTER_SIDE_CP
121endif
122
Naseer Ahmed4d78d032017-03-22 12:47:30 -0400123use_hwc2 := false
124ifeq ($(TARGET_USES_HWC2), true)
125 use_hwc2 := true
126 common_flags += -DVIDEO_MODE_DEFER_RETIRE_FENCE
127endif
128
Naseer Ahmed87895932017-05-30 17:01:44 -0400129ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
130 common_flags += -DUSER_DEBUG
131endif
132
Ramakant Singh80a15d72017-07-14 13:52:15 +0530133ifeq ($(LLVM_SA), true)
134 common_flags += --compile-and-analyze --analyzer-perf --analyzer-Werror
135endif
136
Naseer Ahmed4d78d032017-03-22 12:47:30 -0400137common_includes := system/core/base/include
138CHECK_VERSION_LE = $(shell if [ $(1) -le $(2) ] ; then echo true ; else echo false ; fi)
139PLATFORM_SDK_NOUGAT = 25
140ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
141ifeq ($(call CHECK_VERSION_LE, $(PLATFORM_SDK_VERSION), $(PLATFORM_SDK_NOUGAT)), true)
142version_flag := -D__NOUGAT__
143
144# These include paths are deprecated post N
145common_includes += $(display_top)/libqdutils
146common_includes += $(display_top)/libqservice
147common_includes += $(display_top)/gpu_tonemapper
148ifneq ($(TARGET_IS_HEADLESS), true)
149 common_includes += $(display_top)/libcopybit
Naseer Ahmed4d78d032017-03-22 12:47:30 -0400150endif
151
152common_includes += $(display_top)/include
153common_includes += $(display_top)/sdm/include
154common_flags += -isystem $(TARGET_OUT_HEADERS)/qcom/display
155endif
156endif
157
158common_header_export_path := qcom/display
159
160#Common libraries external to display HAL
161common_libs := liblog libutils libcutils libhardware
Naseer Ahmed4d35af82012-07-11 23:43:42 -0700162common_deps :=
163kernel_includes :=
Saurabh Shah56f610d2012-08-07 15:27:06 -0700164
Naseer Ahmedd68b47d2016-04-05 17:40:02 -0400165ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
Naseer Ahmede7ff13f2013-04-15 20:42:08 -0400166# This check is to pick the kernel headers from the right location.
167# If the macro above is defined, we make the assumption that we have the kernel
168# available in the build tree.
169# If the macro is not present, the headers are picked from hardware/qcom/msmXXXX
170# failing which, they are picked from bionic.
Naseer Ahmed4d35af82012-07-11 23:43:42 -0700171 common_deps += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
172 kernel_includes += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
173endif