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