blob: 82d247f0497d9ac021d1461f3f49414e62e844dc [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 Ahmeda699e792017-11-09 15:08:31 -05003display_config_version := $(shell \
4 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.1" ];\
5 then echo DISPLAY_CONFIG_1_1; fi)
Dileep Marchyaf3ce11f2018-04-30 23:35:46 +05306display_config_version := $(shell \
7 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.2" ];\
8 then echo DISPLAY_CONFIG_1_2; fi)
Ramkumar Radhakrishnanf985d482018-07-23 18:10:41 -07009display_config_version := $(shell \
10 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.3" ];\
11 then echo DISPLAY_CONFIG_1_3; fi)
Ramakant Singhdbe738a2018-08-23 23:57:07 +053012display_config_version := $(shell \
13 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.4" ];\
14 then echo DISPLAY_CONFIG_1_4; fi)
Yuchao Mada4d97a2018-09-20 15:33:43 +080015display_config_version := $(shell \
16 if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.5" ];\
17 then echo DISPLAY_CONFIG_1_5; fi)
Naseer Ahmedb6b936d2016-08-05 16:23:32 -040018#Common C flags
Saurabh Shah546f77b2017-12-13 14:10:39 -080019common_flags := -Wno-missing-field-initializers
Dileep Marchya6860b2b2017-04-07 15:56:47 +053020common_flags += -Wconversion -Wall -Werror -std=c++14
Naseer Ahmed85020082017-05-17 14:36:46 -040021common_flags += -DUSE_GRALLOC1
Saurabh Shahf84c4122017-04-07 10:34:40 -070022ifeq ($(TARGET_IS_HEADLESS), true)
Naseer Ahmed4d78d032017-03-22 12:47:30 -040023 common_flags += -DTARGET_HEADLESS
24 LOCAL_CLANG := false
Saurabh Shah7d476ed2016-06-27 16:40:58 -070025endif
Naseer Ahmedb6b936d2016-08-05 16:23:32 -040026
Naseer Ahmeda699e792017-11-09 15:08:31 -050027ifeq ($(display_config_version), DISPLAY_CONFIG_1_1)
28 common_flags += -DDISPLAY_CONFIG_1_1
29endif
Dileep Marchyaf3ce11f2018-04-30 23:35:46 +053030ifeq ($(display_config_version), DISPLAY_CONFIG_1_2)
31 common_flags += -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
32endif
Ramkumar Radhakrishnanf985d482018-07-23 18:10:41 -070033ifeq ($(display_config_version), DISPLAY_CONFIG_1_3)
34 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
35endif
Ramakant Singhdbe738a2018-08-23 23:57:07 +053036ifeq ($(display_config_version), DISPLAY_CONFIG_1_4)
37 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2
38 common_flags += -DDISPLAY_CONFIG_1_3 -DDISPLAY_CONFIG_1_4
39endif
Yuchao Mada4d97a2018-09-20 15:33:43 +080040ifeq ($(display_config_version), DISPLAY_CONFIG_1_5)
41 common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
42 common_flags += -DDISPLAY_CONFIG_1_4 -DDISPLAY_CONFIG_1_5
43endif
Naseer Ahmeda699e792017-11-09 15:08:31 -050044
Arun Kumar K.Rca196fc2016-12-07 19:28:30 -080045ifeq ($(TARGET_USES_COLOR_METADATA), true)
Naseer Ahmed4d78d032017-03-22 12:47:30 -040046 common_flags += -DUSE_COLOR_METADATA
Arun Kumar K.Rb2771bf2016-10-03 21:38:23 -070047endif
48
Naseer Ahmed4d78d032017-03-22 12:47:30 -040049ifeq ($(TARGET_USES_QCOM_BSP),true)
50 common_flags += -DQTI_BSP
Praveena Pachipulusu734118a2014-12-04 14:53:12 +053051endif
52
Naseer Ahmed4d35af82012-07-11 23:43:42 -070053ifeq ($(ARCH_ARM_HAVE_NEON),true)
54 common_flags += -D__ARM_HAVE_NEON
55endif
56
Shalaj Jain3c490412015-04-22 16:52:03 -070057ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)), true)
58 common_flags += -DMASTER_SIDE_CP
59endif
60
Naseer Ahmed4d78d032017-03-22 12:47:30 -040061use_hwc2 := false
62ifeq ($(TARGET_USES_HWC2), true)
63 use_hwc2 := true
64 common_flags += -DVIDEO_MODE_DEFER_RETIRE_FENCE
65endif
66
Naseer Ahmed87895932017-05-30 17:01:44 -040067ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
68 common_flags += -DUSER_DEBUG
69endif
70
Ramakant Singh80a15d72017-07-14 13:52:15 +053071ifeq ($(LLVM_SA), true)
72 common_flags += --compile-and-analyze --analyzer-perf --analyzer-Werror
73endif
74
Naseer Ahmed4d78d032017-03-22 12:47:30 -040075common_includes := system/core/base/include
76CHECK_VERSION_LE = $(shell if [ $(1) -le $(2) ] ; then echo true ; else echo false ; fi)
77PLATFORM_SDK_NOUGAT = 25
78ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
79ifeq ($(call CHECK_VERSION_LE, $(PLATFORM_SDK_VERSION), $(PLATFORM_SDK_NOUGAT)), true)
80version_flag := -D__NOUGAT__
81
82# These include paths are deprecated post N
83common_includes += $(display_top)/libqdutils
84common_includes += $(display_top)/libqservice
85common_includes += $(display_top)/gpu_tonemapper
86ifneq ($(TARGET_IS_HEADLESS), true)
87 common_includes += $(display_top)/libcopybit
Naseer Ahmed4d78d032017-03-22 12:47:30 -040088endif
89
90common_includes += $(display_top)/include
91common_includes += $(display_top)/sdm/include
92common_flags += -isystem $(TARGET_OUT_HEADERS)/qcom/display
93endif
94endif
95
96common_header_export_path := qcom/display
97
98#Common libraries external to display HAL
99common_libs := liblog libutils libcutils libhardware
Naseer Ahmed4d35af82012-07-11 23:43:42 -0700100common_deps :=
101kernel_includes :=
Saurabh Shah56f610d2012-08-07 15:27:06 -0700102
Naseer Ahmedd68b47d2016-04-05 17:40:02 -0400103ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
Naseer Ahmede7ff13f2013-04-15 20:42:08 -0400104# This check is to pick the kernel headers from the right location.
105# If the macro above is defined, we make the assumption that we have the kernel
106# available in the build tree.
107# If the macro is not present, the headers are picked from hardware/qcom/msmXXXX
108# failing which, they are picked from bionic.
Naseer Ahmed4d35af82012-07-11 23:43:42 -0700109 common_deps += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
110 kernel_includes += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
111endif