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_LICENSE_KINDS           := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD legacy_not_a_contribution
9LOCAL_LICENSE_CONDITIONS      := by_exception_only not_allowed notice
10LOCAL_VENDOR_MODULE           := true
11LOCAL_MODULE_RELATIVE_PATH    := hw
12LOCAL_MODULE_TAGS             := optional
13LOCAL_C_INCLUDES              := $(common_includes)
14LOCAL_HEADER_LIBRARIES        := display_headers
15
16LOCAL_CFLAGS                  := -Wno-missing-field-initializers -Wno-unused-parameter \
17                                 -fcolor-diagnostics\
18                                 -DLOG_TAG=\"SDM\" $(common_flags) \
19                                 -I $(display_top)/sdm/libs/hwc
20
21ifeq ($(TARGET_EXCLUDES_DISPLAY_PP), true)
22LOCAL_CFLAGS                  += -DEXCLUDE_DISPLAY_PP
23endif
24LOCAL_CLANG                   := true
25
26# TODO: Remove libui after addressing gpu_tonemapper issues
27LOCAL_SHARED_LIBRARIES        := libsdmcore libqservice libbinder libhardware libhardware_legacy \
28                                 libutils libcutils libsync libqdutils libqdMetaData libdl libdrmutils \
29                                 libsdmutils libc++ liblog libgrallocutils libdl \
30                                 vendor.display.config@1.0 libhidlbase \
31                                 libui libgpu_tonemapper
32
33ifneq ($(TARGET_USES_GRALLOC1), true)
34    LOCAL_SHARED_LIBRARIES += libmemalloc
35endif
36
37# Allow implicit fallthroughs in hwc_display.cpp until they are fixed.
38LOCAL_CFLAGS                  += -Wno-implicit-fallthrough
39
40LOCAL_SRC_FILES               := hwc_session.cpp \
41                                 hwc_session_services.cpp \
42                                 hwc_display.cpp \
43                                 hwc_display_primary.cpp \
44                                 hwc_display_external.cpp \
45                                 hwc_display_virtual.cpp \
46                                 ../hwc/hwc_debugger.cpp \
47                                 ../hwc/hwc_buffer_sync_handler.cpp \
48                                 hwc_color_manager.cpp \
49                                 hwc_layers.cpp \
50                                 hwc_callbacks.cpp \
51                                 ../hwc/cpuhint.cpp \
52                                 ../hwc/hwc_socket_handler.cpp \
53                                 display_null.cpp \
54                                 hwc_tonemapper.cpp
55
56ifneq ($(TARGET_USES_GRALLOC1), true)
57    LOCAL_SRC_FILES += ../hwc/hwc_buffer_allocator.cpp
58else
59    LOCAL_SRC_FILES += hwc_buffer_allocator.cpp
60endif
61
62ifeq ($(TARGET_HAS_WIDE_COLOR_DISPLAY), true)
63    LOCAL_CFLAGS += -DFEATURE_WIDE_COLOR
64endif
65
66include $(BUILD_SHARED_LIBRARY)
67endif
68