1LOCAL_PATH := $(call my-dir)
2include $(CLEAR_VARS)
3include $(LOCAL_PATH)/../../../common.mk
4
5ifeq ($(use_hwc2),true)
6
7LOCAL_MODULE                  := hwcomposer.$(TARGET_BOARD_PLATFORM)
8LOCAL_VENDOR_MODULE           := true
9LOCAL_MODULE_RELATIVE_PATH    := hw
10LOCAL_MODULE_TAGS             := optional
11LOCAL_C_INCLUDES              := $(common_includes)
12LOCAL_HEADER_LIBRARIES        := display_headers
13
14LOCAL_CFLAGS                  := -Wno-missing-field-initializers -Wno-unused-parameter \
15                                 -std=c++11 -fcolor-diagnostics\
16                                 -DLOG_TAG=\"SDM\" $(common_flags) \
17                                 -I $(display_top)/sdm/libs/hwc
18ifeq ($(TARGET_EXCLUDES_DISPLAY_PP), true)
19LOCAL_CFLAGS += -DEXCLUDE_DISPLAY_PP
20endif
21
22LOCAL_CLANG                   := true
23
24# For enabling the fake display
25ifneq ($(TARGET_HAS_NO_DISPLAY),true)
26
27# TODO: Remove libui after addressing gpu_tonemapper issues
28LOCAL_SHARED_LIBRARIES        := libsdmcore libqservice libbinder libhardware libhardware_legacy \
29                                 libutils libcutils libsync libqdutils libqdMetaData libdl libdrmutils \
30                                 libsdmutils libc++ liblog libgrallocutils libdl \
31                                 vendor.display.config@1.0 libhidlbase \
32                                 libui libgpu_tonemapper
33
34ifneq ($(TARGET_USES_GRALLOC1), true)
35    LOCAL_SHARED_LIBRARIES += libmemalloc
36endif
37
38ifeq ($(display_config_version), DISPLAY_CONFIG_1_1)
39LOCAL_SHARED_LIBRARIES        += vendor.display.config@1.1
40endif
41
42# Allow implicit fallthroughs in hwc_display.cpp until they are fixed.
43LOCAL_CFLAGS                  += -Wno-implicit-fallthrough
44
45LOCAL_SRC_FILES               := hwc_session.cpp \
46                                 hwc_session_services.cpp \
47                                 hwc_display.cpp \
48                                 hwc_display_primary.cpp \
49                                 hwc_display_external.cpp \
50                                 hwc_display_virtual.cpp \
51                                 ../hwc/hwc_debugger.cpp \
52                                 ../hwc/hwc_buffer_sync_handler.cpp \
53                                 hwc_color_manager.cpp \
54                                 hwc_layers.cpp \
55                                 hwc_callbacks.cpp \
56                                 ../hwc/cpuhint.cpp \
57                                 ../hwc/hwc_socket_handler.cpp \
58                                 display_null.cpp \
59                                 hwc_tonemapper.cpp \
60                                 hwc_display_external_test.cpp
61
62ifneq ($(TARGET_USES_GRALLOC1), true)
63    LOCAL_SRC_FILES += ../hwc/hwc_buffer_allocator.cpp
64else
65    LOCAL_SRC_FILES += hwc_buffer_allocator.cpp
66endif
67
68ifeq ($(TARGET_HAS_WIDE_COLOR_DISPLAY), true)
69    LOCAL_CFLAGS += -DFEATURE_WIDE_COLOR
70endif
71
72else #Target does not have display
73LOCAL_SHARED_LIBRARIES :=  libc++ liblog libutils
74LOCAL_SRC_FILES := hwcomposer.cpp
75endif #ifneq ($(TARGET_HAS_NO_DISPLAY),true)
76
77include $(BUILD_SHARED_LIBRARY)
78endif
79