1#Common headers
2display_top := $(call my-dir)
3display_config_version := $(shell \
4    if [ -d "$(QC_OPEN_PATH)/interfaces/vendor/display/config/1.1" ];\
5    then echo DISPLAY_CONFIG_1_1; fi)
6display_config_version := $(shell \
7    if [ -d "$(QC_OPEN_PATH)/interfaces/vendor/display/config/1.2" ];\
8    then echo DISPLAY_CONFIG_1_2; fi)
9display_config_version := $(shell \
10    if [ -d "$(QC_OPEN_PATH)/interfaces/vendor/display/config/1.3" ];\
11    then echo DISPLAY_CONFIG_1_3; fi)
12
13#Common C flags
14common_flags := -Wno-missing-field-initializers
15common_flags += -Wconversion -Wall -Werror
16common_flags += -DUSE_GRALLOC1
17ifeq ($(TARGET_IS_HEADLESS), true)
18    common_flags += -DTARGET_HEADLESS
19    LOCAL_CLANG := false
20endif
21
22ifeq ($(display_config_version), DISPLAY_CONFIG_1_1)
23    common_flags += -DDISPLAY_CONFIG_1_1
24endif
25ifeq ($(display_config_version), DISPLAY_CONFIG_1_2)
26    common_flags += -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_1
27endif
28ifeq ($(display_config_version), DISPLAY_CONFIG_1_3)
29    common_flags += -DDISPLAY_CONFIG_1_1 -DDISPLAY_CONFIG_1_2 -DDISPLAY_CONFIG_1_3
30endif
31
32ifeq ($(TARGET_USES_COLOR_METADATA), true)
33    common_flags += -DUSE_COLOR_METADATA
34endif
35
36ifeq ($(TARGET_USES_QCOM_BSP),true)
37    common_flags += -DQTI_BSP
38endif
39
40ifeq ($(ARCH_ARM_HAVE_NEON),true)
41    common_flags += -D__ARM_HAVE_NEON
42endif
43
44ifeq ($(call is-board-platform-in-list, $(MASTER_SIDE_CP_TARGET_LIST)), true)
45    common_flags += -DMASTER_SIDE_CP
46endif
47
48use_hwc2 := false
49ifeq ($(TARGET_USES_HWC2), true)
50    use_hwc2 := true
51    common_flags += -DVIDEO_MODE_DEFER_RETIRE_FENCE
52endif
53
54ifeq ($(TARGET_USES_NV21_CAMERA_PREVIEW),true)
55    common_flags += -DUSE_NV21_CAMERA_PREVIEW
56endif
57
58ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
59    common_flags += -DUSER_DEBUG
60endif
61
62ifeq ($(LLVM_SA), true)
63    common_flags += --compile-and-analyze --analyzer-perf --analyzer-Werror
64endif
65
66common_includes := system/libbase/include
67CHECK_VERSION_LE = $(shell if [ $(1) -le $(2) ] ; then echo true ; else echo false ; fi)
68PLATFORM_SDK_NOUGAT = 25
69ifeq "REL" "$(PLATFORM_VERSION_CODENAME)"
70ifeq ($(call CHECK_VERSION_LE, $(PLATFORM_SDK_VERSION), $(PLATFORM_SDK_NOUGAT)), true)
71version_flag := -D__NOUGAT__
72
73# These include paths are deprecated post N
74common_includes += $(display_top)/libqdutils
75common_includes += $(display_top)/libqservice
76common_includes += $(display_top)/gpu_tonemapper
77ifneq ($(TARGET_IS_HEADLESS), true)
78    common_includes += $(display_top)/libcopybit
79endif
80
81common_includes += $(display_top)/include
82common_includes += $(display_top)/sdm/include
83common_flags += -isystem $(TARGET_OUT_HEADERS)/qcom/display
84endif
85endif
86
87common_header_export_path := qcom/display
88
89#Common libraries external to display HAL
90common_libs := liblog libutils libcutils libhardware
91common_deps  :=
92kernel_includes :=
93
94ifeq ($(TARGET_COMPILE_WITH_MSM_KERNEL),true)
95# This check is to pick the kernel headers from the right location.
96# If the macro above is defined, we make the assumption that we have the kernel
97# available in the build tree.
98# If the macro is not present, the headers are picked from hardware/qcom/msmXXXX
99# failing which, they are picked from bionic.
100    common_deps += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
101    kernel_includes += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
102endif
103