1# Copyright (C) 2015 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#      http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15ifeq ($(strip $(BOARD_USES_DRM_HWCOMPOSER)),true)
16
17LOCAL_PATH := $(call my-dir)
18
19common_drm_hwcomposer_cflags := \
20    -Wall \
21    -Werror \
22    -Wno-unused-function \
23    -Wno-unused-label \
24    -Wno-unused-parameter \
25    -Wno-unused-private-field \
26    -Wno-unused-variable \
27
28# =====================
29# libdrmhwc_utils.a
30# =====================
31include $(CLEAR_VARS)
32
33LOCAL_SRC_FILES := \
34	worker.cpp
35
36LOCAL_CFLAGS := $(common_drm_hwcomposer_cflags)
37
38LOCAL_MODULE := libdrmhwc_utils
39
40include $(BUILD_STATIC_LIBRARY)
41
42# =====================
43# hwcomposer.drm.so
44# =====================
45include $(CLEAR_VARS)
46
47LOCAL_SHARED_LIBRARIES := \
48	libcutils \
49	libdrm \
50	libEGL \
51	libGLESv2 \
52	libhardware \
53	liblog \
54	libsync \
55	libui \
56	libutils
57
58LOCAL_STATIC_LIBRARIES := libdrmhwc_utils
59
60LOCAL_C_INCLUDES := \
61	external/drm_gralloc \
62	external/libdrm \
63	external/libdrm/include/drm \
64	system/core/include/utils \
65	system/core/libsync \
66	system/core/libsync/include \
67
68LOCAL_SRC_FILES := \
69	drmresources.cpp \
70	drmcomposition.cpp \
71	drmcompositor.cpp \
72	drmconnector.cpp \
73	drmcrtc.cpp \
74	drmdisplaycomposition.cpp \
75	drmdisplaycompositor.cpp \
76	drmencoder.cpp \
77	drmeventlistener.cpp \
78	drmhwctwo.cpp \
79	drmmode.cpp \
80	drmplane.cpp \
81	drmproperty.cpp \
82	glworker.cpp \
83	hwcutils.cpp \
84	platform.cpp \
85	separate_rects.cpp \
86	virtualcompositorworker.cpp \
87	vsyncworker.cpp
88
89LOCAL_CFLAGS := $(common_drm_hwcomposer_cflags)
90
91LOCAL_CPPFLAGS += \
92	-DHWC2_USE_CPP11 \
93	-DHWC2_INCLUDE_STRINGIFICATION
94
95ifeq ($(strip $(BOARD_DRM_HWCOMPOSER_BUFFER_IMPORTER)),nvidia-gralloc)
96LOCAL_CPPFLAGS += -DUSE_NVIDIA_IMPORTER
97LOCAL_SRC_FILES += platformnv.cpp
98else
99LOCAL_CPPFLAGS += -DUSE_DRM_GENERIC_IMPORTER
100LOCAL_SRC_FILES += platformdrmgeneric.cpp
101endif
102
103LOCAL_MODULE := hwcomposer.drm
104LOCAL_MODULE_TAGS := optional
105LOCAL_MODULE_RELATIVE_PATH := hw
106LOCAL_MODULE_CLASS := SHARED_LIBRARIES
107LOCAL_MODULE_SUFFIX := $(TARGET_SHLIB_SUFFIX)
108include $(BUILD_SHARED_LIBRARY)
109
110include $(call all-makefiles-under,$(LOCAL_PATH))
111endif
112