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