Naseer Ahmed | 4d35af8 | 2012-07-11 23:43:42 -0700 | [diff] [blame] | 1 | #Common headers |
Naseer Ahmed | d68b47d | 2016-04-05 17:40:02 -0400 | [diff] [blame] | 2 | display_top := $(call my-dir) |
Naseer Ahmed | 30d3f1c | 2018-10-24 20:53:13 -0400 | [diff] [blame] | 3 | |
| 4 | #Get the highest display config version available |
Yuchao Ma | da4d97a | 2018-09-20 15:33:43 +0800 | [diff] [blame] | 5 | display_config_version := $(shell \ |
Dileep Marchya | afa45bc | 2019-06-21 17:05:31 +0530 | [diff] [blame] | 6 | if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.10" ];\ |
| 7 | then echo DISPLAY_CONFIG_1_10; fi) |
| 8 | |
| 9 | ifeq ($(display_config_version),) |
| 10 | display_config_version := $(shell \ |
Archit Srivastava | a59c4ff | 2019-05-20 10:54:22 +0530 | [diff] [blame] | 11 | if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.9" ];\ |
| 12 | then echo DISPLAY_CONFIG_1_9; fi) |
Dileep Marchya | afa45bc | 2019-06-21 17:05:31 +0530 | [diff] [blame] | 13 | endif |
Archit Srivastava | a59c4ff | 2019-05-20 10:54:22 +0530 | [diff] [blame] | 14 | ifeq ($(display_config_version),) |
| 15 | display_config_version := $(shell \ |
Ramkumar Radhakrishnan | 44c6436 | 2018-12-12 13:03:59 -0800 | [diff] [blame] | 16 | if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.8" ];\ |
| 17 | then echo DISPLAY_CONFIG_1_8; fi) |
Archit Srivastava | a59c4ff | 2019-05-20 10:54:22 +0530 | [diff] [blame] | 18 | endif |
Ramkumar Radhakrishnan | 44c6436 | 2018-12-12 13:03:59 -0800 | [diff] [blame] | 19 | ifeq ($(display_config_version),) |
| 20 | display_config_version := $(shell \ |
Dileep Marchya | e1c7c8d | 2018-12-06 15:27:45 +0530 | [diff] [blame] | 21 | if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.7" ];\ |
| 22 | then echo DISPLAY_CONFIG_1_7; fi) |
Ramkumar Radhakrishnan | 44c6436 | 2018-12-12 13:03:59 -0800 | [diff] [blame] | 23 | endif |
Dileep Marchya | e1c7c8d | 2018-12-06 15:27:45 +0530 | [diff] [blame] | 24 | ifeq ($(display_config_version),) |
| 25 | display_config_version := $(shell \ |
| 26 | if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.6" ];\ |
| 27 | then echo DISPLAY_CONFIG_1_6; fi) |
| 28 | endif |
| 29 | ifeq ($(display_config_version),) |
| 30 | display_config_version := $(shell \ |
Yuchao Ma | da4d97a | 2018-09-20 15:33:43 +0800 | [diff] [blame] | 31 | if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.5" ];\ |
| 32 | then echo DISPLAY_CONFIG_1_5; fi) |
Dileep Marchya | e1c7c8d | 2018-12-06 15:27:45 +0530 | [diff] [blame] | 33 | endif |
Naseer Ahmed | 30d3f1c | 2018-10-24 20:53:13 -0400 | [diff] [blame] | 34 | ifeq ($(display_config_version),) |
| 35 | display_config_version := $(shell \ |
| 36 | if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.4" ];\ |
| 37 | then echo DISPLAY_CONFIG_1_4; fi) |
| 38 | endif |
| 39 | ifeq ($(display_config_version),) |
| 40 | display_config_version := $(shell \ |
| 41 | if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.3" ];\ |
| 42 | then echo DISPLAY_CONFIG_1_3; fi) |
| 43 | endif |
| 44 | ifeq ($(display_config_version),) |
| 45 | display_config_version := $(shell \ |
| 46 | if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.2" ];\ |
| 47 | then echo DISPLAY_CONFIG_1_2; fi) |
| 48 | endif |
| 49 | ifeq ($(display_config_version),) |
| 50 | display_config_version := $(shell \ |
| 51 | if [ -d "$(TOP)/vendor/qcom/opensource/interfaces/display/config/1.1" ];\ |
| 52 | then echo DISPLAY_CONFIG_1_1; fi) |
| 53 | endif |
| 54 | |
Naseer Ahmed | b6b936d | 2016-08-05 16:23:32 -0400 | [diff] [blame] | 55 | #Common C flags |
Saurabh Shah | 546f77b | 2017-12-13 14:10:39 -0800 | [diff] [blame] | 56 | common_flags := -Wno-missing-field-initializers |
Rajavenu Kyatham | 42d11cb | 2019-04-16 13:03:29 +0530 | [diff] [blame] | 57 | common_flags += -Wall -Werror -std=c++14 |
Naseer Ahmed | 8502008 | 2017-05-17 14:36:46 -0400 | [diff] [blame] | 58 | common_flags += -DUSE_GRALLOC1 |
Saurabh Shah | f84c412 | 2017-04-07 10:34:40 -0700 | [diff] [blame] | 59 | ifeq ($(TARGET_IS_HEADLESS), true) |
Naseer Ahmed | 4d78d03 | 2017-03-22 12:47:30 -0400 | [diff] [blame] | 60 | common_flags += -DTARGET_HEADLESS |
| 61 | LOCAL_CLANG := false |
Saurabh Shah | 7d476ed | 2016-06-27 16:40:58 -0700 | [diff] [blame] | 62 | endif |
Naseer Ahmed | b6b936d | 2016-08-05 16:23:32 -0400 | [diff] [blame] | 63 | |
Naseer Ahmed | a699e79 | 2017-11-09 15:08:31 -0500 | [diff] [blame] | 64 | ifeq ($(display_config_version), DISPLAY_CONFIG_1_1) |
| 65 | common_flags += -DDISPLAY_CONFIG_1_1 |
| 66 | endif |
Dileep Marchya | f3ce11f | 2018-04-30 23:35:46 +0530 | [diff] [blame] | 67 | ifeq ($(display_config_version), DISPLAY_CONFIG_1_2) |
| 68 | common_flags += -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1 |
| 69 | endif |
Ramkumar Radhakrishnan | f985d48 | 2018-07-23 18:10:41 -0700 | [diff] [blame] | 70 | ifeq ($(display_config_version), DISPLAY_CONFIG_1_3) |
| 71 | common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3 |
| 72 | endif |
Ramakant Singh | dbe738a | 2018-08-23 23:57:07 +0530 | [diff] [blame] | 73 | ifeq ($(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 |
| 76 | endif |
Yuchao Ma | da4d97a | 2018-09-20 15:33:43 +0800 | [diff] [blame] | 77 | ifeq ($(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 |
| 80 | endif |
Dileep Marchya | e1c7c8d | 2018-12-06 15:27:45 +0530 | [diff] [blame] | 81 | ifeq ($(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 |
| 84 | endif |
| 85 | ifeq ($(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 |
| 89 | endif |
Ramkumar Radhakrishnan | 44c6436 | 2018-12-12 13:03:59 -0800 | [diff] [blame] | 90 | ifeq ($(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 |
| 94 | endif |
Archit Srivastava | a59c4ff | 2019-05-20 10:54:22 +0530 | [diff] [blame] | 95 | ifeq ($(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 |
| 99 | endif |
Dileep Marchya | afa45bc | 2019-06-21 17:05:31 +0530 | [diff] [blame] | 100 | ifeq ($(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 |
| 105 | endif |
Naseer Ahmed | a699e79 | 2017-11-09 15:08:31 -0500 | [diff] [blame] | 106 | |
Arun Kumar K.R | ca196fc | 2016-12-07 19:28:30 -0800 | [diff] [blame] | 107 | ifeq ($(TARGET_USES_COLOR_METADATA), true) |
Naseer Ahmed | 4d78d03 | 2017-03-22 12:47:30 -0400 | [diff] [blame] | 108 | common_flags += -DUSE_COLOR_METADATA |
Arun Kumar K.R | b2771bf | 2016-10-03 21:38:23 -0700 | [diff] [blame] | 109 | endif |
| 110 | |
Naseer Ahmed | 4d78d03 | 2017-03-22 12:47:30 -0400 | [diff] [blame] | 111 | ifeq ($(TARGET_USES_QCOM_BSP),true) |
| 112 | common_flags += -DQTI_BSP |
Praveena Pachipulusu | 734118a | 2014-12-04 14:53:12 +0530 | [diff] [blame] | 113 | endif |
| 114 | |
Naseer Ahmed | 4d35af8 | 2012-07-11 23:43:42 -0700 | [diff] [blame] | 115 | ifeq ($(ARCH_ARM_HAVE_NEON),true) |
| 116 | common_flags += -D__ARM_HAVE_NEON |
| 117 | endif |
| 118 | |
Shalaj Jain | 3c49041 | 2015-04-22 16:52:03 -0700 | [diff] [blame] | 119 | ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)), true) |
| 120 | common_flags += -DMASTER_SIDE_CP |
| 121 | endif |
| 122 | |
Naseer Ahmed | 4d78d03 | 2017-03-22 12:47:30 -0400 | [diff] [blame] | 123 | use_hwc2 := false |
| 124 | ifeq ($(TARGET_USES_HWC2), true) |
| 125 | use_hwc2 := true |
| 126 | common_flags += -DVIDEO_MODE_DEFER_RETIRE_FENCE |
| 127 | endif |
| 128 | |
Naseer Ahmed | 8789593 | 2017-05-30 17:01:44 -0400 | [diff] [blame] | 129 | ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) |
| 130 | common_flags += -DUSER_DEBUG |
| 131 | endif |
| 132 | |
Ramakant Singh | 80a15d7 | 2017-07-14 13:52:15 +0530 | [diff] [blame] | 133 | ifeq ($(LLVM_SA), true) |
| 134 | common_flags += --compile-and-analyze --analyzer-perf --analyzer-Werror |
| 135 | endif |
| 136 | |
Naseer Ahmed | 4d78d03 | 2017-03-22 12:47:30 -0400 | [diff] [blame] | 137 | common_includes := system/core/base/include |
| 138 | CHECK_VERSION_LE = $(shell if [ $(1) -le $(2) ] ; then echo true ; else echo false ; fi) |
| 139 | PLATFORM_SDK_NOUGAT = 25 |
| 140 | ifeq "REL" "$(PLATFORM_VERSION_CODENAME)" |
| 141 | ifeq ($(call CHECK_VERSION_LE, $(PLATFORM_SDK_VERSION), $(PLATFORM_SDK_NOUGAT)), true) |
| 142 | version_flag := -D__NOUGAT__ |
| 143 | |
| 144 | # These include paths are deprecated post N |
| 145 | common_includes += $(display_top)/libqdutils |
| 146 | common_includes += $(display_top)/libqservice |
| 147 | common_includes += $(display_top)/gpu_tonemapper |
| 148 | ifneq ($(TARGET_IS_HEADLESS), true) |
| 149 | common_includes += $(display_top)/libcopybit |
Naseer Ahmed | 4d78d03 | 2017-03-22 12:47:30 -0400 | [diff] [blame] | 150 | endif |
| 151 | |
| 152 | common_includes += $(display_top)/include |
| 153 | common_includes += $(display_top)/sdm/include |
| 154 | common_flags += -isystem $(TARGET_OUT_HEADERS)/qcom/display |
| 155 | endif |
| 156 | endif |
| 157 | |
| 158 | common_header_export_path := qcom/display |
| 159 | |
| 160 | #Common libraries external to display HAL |
| 161 | common_libs := liblog libutils libcutils libhardware |
Naseer Ahmed | 4d35af8 | 2012-07-11 23:43:42 -0700 | [diff] [blame] | 162 | common_deps := |
| 163 | kernel_includes := |
Saurabh Shah | 56f610d | 2012-08-07 15:27:06 -0700 | [diff] [blame] | 164 | |
Naseer Ahmed | d68b47d | 2016-04-05 17:40:02 -0400 | [diff] [blame] | 165 | ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true) |
Naseer Ahmed | e7ff13f | 2013-04-15 20:42:08 -0400 | [diff] [blame] | 166 | # 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 Ahmed | 4d35af8 | 2012-07-11 23:43:42 -0700 | [diff] [blame] | 171 | common_deps += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr |
| 172 | kernel_includes += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include |
| 173 | endif |