blob: bb6494ad4be74747cb7a3028800caba2ed63f941 [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 \
6 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.5" ];\
7 then echo DISPLAY_CONFIG_1_5; fi)
Naseer Ahmed30d3f1c2018-10-24 20:53:13 -04008ifeq ($(display_config_version),)
9display_config_version := $(shell \
10 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.4" ];\
11 then echo DISPLAY_CONFIG_1_4; fi)
12endif
13ifeq ($(display_config_version),)
14display_config_version := $(shell \
15 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.3" ];\
16 then echo DISPLAY_CONFIG_1_3; fi)
17endif
18ifeq ($(display_config_version),)
19display_config_version := $(shell \
20 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.2" ];\
21 then echo DISPLAY_CONFIG_1_2; fi)
22endif
23ifeq ($(display_config_version),)
24display_config_version := $(shell \
25 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.1" ];\
26 then echo DISPLAY_CONFIG_1_1; fi)
27endif
28
Naseer Ahmedb6b936d2016-08-05 16:23:32 -040029#Common C flags
Saurabh Shah546f77b2017-12-13 14:10:39 -080030common_flags := -Wno-missing-field-initializers
Dileep Marchya6860b2b2017-04-07 15:56:47 +053031common_flags += -Wconversion -Wall -Werror -std=c++14
Naseer Ahmed85020082017-05-17 14:36:46 -040032common_flags += -DUSE_GRALLOC1
Saurabh Shahf84c4122017-04-07 10:34:40 -070033ifeq ($(TARGET_IS_HEADLESS), true)
Naseer Ahmed4d78d032017-03-22 12:47:30 -040034 common_flags += -DTARGET_HEADLESS
35 LOCAL_CLANG := false
Saurabh Shah7d476ed2016-06-27 16:40:58 -070036endif
Naseer Ahmedb6b936d2016-08-05 16:23:32 -040037
Naseer Ahmeda699e792017-11-09 15:08:31 -050038ifeq ($(display_config_version), DISPLAY_CONFIG_1_1)
39 common_flags += -DDISPLAY_CONFIG_1_1
40endif
Dileep Marchyaf3ce11f2018-04-30 23:35:46 +053041ifeq ($(display_config_version), DISPLAY_CONFIG_1_2)
42 common_flags += -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
43endif
Ramkumar Radhakrishnanf985d482018-07-23 18:10:41 -070044ifeq ($(display_config_version), DISPLAY_CONFIG_1_3)
45 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
46endif
Ramakant Singhdbe738a2018-08-23 23:57:07 +053047ifeq ($(display_config_version), DISPLAY_CONFIG_1_4)
48 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2
49 common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_4
50endif
Yuchao Mada4d97a2018-09-20 15:33:43 +080051ifeq ($(display_config_version), DISPLAY_CONFIG_1_5)
52 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
53 common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5
54endif
Naseer Ahmeda699e792017-11-09 15:08:31 -050055
Arun Kumar K.Rca196fc2016-12-07 19:28:30 -080056ifeq ($(TARGET_USES_COLOR_METADATA), true)
Naseer Ahmed4d78d032017-03-22 12:47:30 -040057 common_flags += -DUSE_COLOR_METADATA
Arun Kumar K.Rb2771bf2016-10-03 21:38:23 -070058endif
59
Naseer Ahmed4d78d032017-03-22 12:47:30 -040060ifeq ($(TARGET_USES_QCOM_BSP),true)
61 common_flags += -DQTI_BSP
Praveena Pachipulusu734118a2014-12-04 14:53:12 +053062endif
63
Naseer Ahmed4d35af82012-07-11 23:43:42 -070064ifeq ($(ARCH_ARM_HAVE_NEON),true)
65 common_flags += -D__ARM_HAVE_NEON
66endif
67
Shalaj Jain3c490412015-04-22 16:52:03 -070068ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)), true)
69 common_flags += -DMASTER_SIDE_CP
70endif
71
Naseer Ahmed4d78d032017-03-22 12:47:30 -040072use_hwc2 := false
73ifeq ($(TARGET_USES_HWC2), true)
74 use_hwc2 := true
75 common_flags += -DVIDEO_MODE_DEFER_RETIRE_FENCE
76endif
77
Naseer Ahmed87895932017-05-30 17:01:44 -040078ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
79 common_flags += -DUSER_DEBUG
80endif
81
Ramakant Singh80a15d72017-07-14 13:52:15 +053082ifeq ($(LLVM_SA), true)
83 common_flags += --compile-and-analyze --analyzer-perf --analyzer-Werror
84endif
85
Naseer Ahmed4d78d032017-03-22 12:47:30 -040086common_includes := system/core/base/include
87CHECK_VERSION_LE = $(shell if [ $(1) -le $(2) ] ; then echo true ; else echo false ; fi)
88PLATFORM_SDK_NOUGAT = 25
89ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
90ifeq ($(call CHECK_VERSION_LE, $(PLATFORM_SDK_VERSION), $(PLATFORM_SDK_NOUGAT)), true)
91version_flag := -D__NOUGAT__
92
93# These include paths are deprecated post N
94common_includes += $(display_top)/libqdutils
95common_includes += $(display_top)/libqservice
96common_includes += $(display_top)/gpu_tonemapper
97ifneq ($(TARGET_IS_HEADLESS), true)
98 common_includes += $(display_top)/libcopybit
Naseer Ahmed4d78d032017-03-22 12:47:30 -040099endif
100
101common_includes += $(display_top)/include
102common_includes += $(display_top)/sdm/include
103common_flags += -isystem $(TARGET_OUT_HEADERS)/qcom/display
104endif
105endif
106
107common_header_export_path := qcom/display
108
109#Common libraries external to display HAL
110common_libs := liblog libutils libcutils libhardware
Naseer Ahmed4d35af82012-07-11 23:43:42 -0700111common_deps :=
112kernel_includes :=
Saurabh Shah56f610d2012-08-07 15:27:06 -0700113
Naseer Ahmedd68b47d2016-04-05 17:40:02 -0400114ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
Naseer Ahmede7ff13f2013-04-15 20:42:08 -0400115# This check is to pick the kernel headers from the right location.
116# If the macro above is defined, we make the assumption that we have the kernel
117# available in the build tree.
118# If the macro is not present, the headers are picked from hardware/qcom/msmXXXX
119# failing which, they are picked from bionic.
Naseer Ahmed4d35af82012-07-11 23:43:42 -0700120 common_deps += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
121 kernel_includes += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
122endif