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