blob: 5db3d162bd2aed4743d6f5df55ca000a19bb8db4 [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 \
Archit Srivastavaa59c4ff2019-05-20 10:54:22 +05306 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.9" ];\
7 then echo DISPLAY_CONFIG_1_9; fi)
8ifeq ($(display_config_version),)
9display_config_version := $(shell \
Ramkumar Radhakrishnan44c64362018-12-12 13:03:59 -080010 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.8" ];\
11 then echo DISPLAY_CONFIG_1_8; fi)
Archit Srivastavaa59c4ff2019-05-20 10:54:22 +053012endif
Ramkumar Radhakrishnan44c64362018-12-12 13:03:59 -080013ifeq ($(display_config_version),)
14display_config_version := $(shell \
Dileep Marchyae1c7c8d2018-12-06 15:27:45 +053015 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.7" ];\
16 then echo DISPLAY_CONFIG_1_7; fi)
Ramkumar Radhakrishnan44c64362018-12-12 13:03:59 -080017endif
Dileep Marchyae1c7c8d2018-12-06 15:27:45 +053018ifeq ($(display_config_version),)
19display_config_version := $(shell \
20 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.6" ];\
21 then echo DISPLAY_CONFIG_1_6; fi)
22endif
23ifeq ($(display_config_version),)
24display_config_version := $(shell \
Yuchao Mada4d97a2018-09-20 15:33:43 +080025 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.5" ];\
26 then echo DISPLAY_CONFIG_1_5; fi)
Dileep Marchyae1c7c8d2018-12-06 15:27:45 +053027endif
Naseer Ahmed30d3f1c2018-10-24 20:53:13 -040028ifeq ($(display_config_version),)
29display_config_version := $(shell \
30 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.4" ];\
31 then echo DISPLAY_CONFIG_1_4; fi)
32endif
33ifeq ($(display_config_version),)
34display_config_version := $(shell \
35 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.3" ];\
36 then echo DISPLAY_CONFIG_1_3; fi)
37endif
38ifeq ($(display_config_version),)
39display_config_version := $(shell \
40 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.2" ];\
41 then echo DISPLAY_CONFIG_1_2; fi)
42endif
43ifeq ($(display_config_version),)
44display_config_version := $(shell \
45 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.1" ];\
46 then echo DISPLAY_CONFIG_1_1; fi)
47endif
48
Naseer Ahmedb6b936d2016-08-05 16:23:32 -040049#Common C flags
Saurabh Shah546f77b2017-12-13 14:10:39 -080050common_flags := -Wno-missing-field-initializers
Rajavenu Kyatham42d11cb2019-04-16 13:03:29 +053051common_flags += -Wall -Werror -std=c++14
Naseer Ahmed85020082017-05-17 14:36:46 -040052common_flags += -DUSE_GRALLOC1
Saurabh Shahf84c4122017-04-07 10:34:40 -070053ifeq ($(TARGET_IS_HEADLESS), true)
Naseer Ahmed4d78d032017-03-22 12:47:30 -040054 common_flags += -DTARGET_HEADLESS
55 LOCAL_CLANG := false
Saurabh Shah7d476ed2016-06-27 16:40:58 -070056endif
Naseer Ahmedb6b936d2016-08-05 16:23:32 -040057
Naseer Ahmeda699e792017-11-09 15:08:31 -050058ifeq ($(display_config_version), DISPLAY_CONFIG_1_1)
59 common_flags += -DDISPLAY_CONFIG_1_1
60endif
Dileep Marchyaf3ce11f2018-04-30 23:35:46 +053061ifeq ($(display_config_version), DISPLAY_CONFIG_1_2)
62 common_flags += -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
63endif
Ramkumar Radhakrishnanf985d482018-07-23 18:10:41 -070064ifeq ($(display_config_version), DISPLAY_CONFIG_1_3)
65 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
66endif
Ramakant Singhdbe738a2018-08-23 23:57:07 +053067ifeq ($(display_config_version), DISPLAY_CONFIG_1_4)
68 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2
69 common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_4
70endif
Yuchao Mada4d97a2018-09-20 15:33:43 +080071ifeq ($(display_config_version), DISPLAY_CONFIG_1_5)
72 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
73 common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5
74endif
Dileep Marchyae1c7c8d2018-12-06 15:27:45 +053075ifeq ($(display_config_version), DISPLAY_CONFIG_1_6)
76 common_flags += -DDISPLAY_CONFIG_1_6 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_4
77 common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
78endif
79ifeq ($(display_config_version), DISPLAY_CONFIG_1_7)
80 common_flags += -DDISPLAY_CONFIG_1_7
81 common_flags += -DDISPLAY_CONFIG_1_6 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_4
82 common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
83endif
Ramkumar Radhakrishnan44c64362018-12-12 13:03:59 -080084ifeq ($(display_config_version), DISPLAY_CONFIG_1_8)
85 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
86 common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6
87 common_flags += -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8
88endif
Archit Srivastavaa59c4ff2019-05-20 10:54:22 +053089ifeq ($(display_config_version), DISPLAY_CONFIG_1_9)
90 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
91 common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5 -DDISPLAY_CONFIG_1_6
92 common_flags += -DDISPLAY_CONFIG_1_7 -DDISPLAY_CONFIG_1_8 -DDISPLAY_CONFIG_1_9
93endif
Naseer Ahmeda699e792017-11-09 15:08:31 -050094
Arun Kumar K.Rca196fc2016-12-07 19:28:30 -080095ifeq ($(TARGET_USES_COLOR_METADATA), true)
Naseer Ahmed4d78d032017-03-22 12:47:30 -040096 common_flags += -DUSE_COLOR_METADATA
Arun Kumar K.Rb2771bf2016-10-03 21:38:23 -070097endif
98
Naseer Ahmed4d78d032017-03-22 12:47:30 -040099ifeq ($(TARGET_USES_QCOM_BSP),true)
100 common_flags += -DQTI_BSP
Praveena Pachipulusu734118a2014-12-04 14:53:12 +0530101endif
102
Naseer Ahmed4d35af82012-07-11 23:43:42 -0700103ifeq ($(ARCH_ARM_HAVE_NEON),true)
104 common_flags += -D__ARM_HAVE_NEON
105endif
106
Shalaj Jain3c490412015-04-22 16:52:03 -0700107ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)), true)
108 common_flags += -DMASTER_SIDE_CP
109endif
110
Naseer Ahmed4d78d032017-03-22 12:47:30 -0400111use_hwc2 := false
112ifeq ($(TARGET_USES_HWC2), true)
113 use_hwc2 := true
114 common_flags += -DVIDEO_MODE_DEFER_RETIRE_FENCE
115endif
116
Naseer Ahmed87895932017-05-30 17:01:44 -0400117ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
118 common_flags += -DUSER_DEBUG
119endif
120
Ramakant Singh80a15d72017-07-14 13:52:15 +0530121ifeq ($(LLVM_SA), true)
122 common_flags += --compile-and-analyze --analyzer-perf --analyzer-Werror
123endif
124
Naseer Ahmed4d78d032017-03-22 12:47:30 -0400125common_includes := system/core/base/include
126CHECK_VERSION_LE = $(shell if [ $(1) -le $(2) ] ; then echo true ; else echo false ; fi)
127PLATFORM_SDK_NOUGAT = 25
128ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
129ifeq ($(call CHECK_VERSION_LE, $(PLATFORM_SDK_VERSION), $(PLATFORM_SDK_NOUGAT)), true)
130version_flag := -D__NOUGAT__
131
132# These include paths are deprecated post N
133common_includes += $(display_top)/libqdutils
134common_includes += $(display_top)/libqservice
135common_includes += $(display_top)/gpu_tonemapper
136ifneq ($(TARGET_IS_HEADLESS), true)
137 common_includes += $(display_top)/libcopybit
Naseer Ahmed4d78d032017-03-22 12:47:30 -0400138endif
139
140common_includes += $(display_top)/include
141common_includes += $(display_top)/sdm/include
142common_flags += -isystem $(TARGET_OUT_HEADERS)/qcom/display
143endif
144endif
145
146common_header_export_path := qcom/display
147
148#Common libraries external to display HAL
149common_libs := liblog libutils libcutils libhardware
Naseer Ahmed4d35af82012-07-11 23:43:42 -0700150common_deps :=
151kernel_includes :=
Saurabh Shah56f610d2012-08-07 15:27:06 -0700152
Naseer Ahmedd68b47d2016-04-05 17:40:02 -0400153ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
Naseer Ahmede7ff13f2013-04-15 20:42:08 -0400154# This check is to pick the kernel headers from the right location.
155# If the macro above is defined, we make the assumption that we have the kernel
156# available in the build tree.
157# If the macro is not present, the headers are picked from hardware/qcom/msmXXXX
158# failing which, they are picked from bionic.
Naseer Ahmed4d35af82012-07-11 23:43:42 -0700159 common_deps += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
160 kernel_includes += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
161endif