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