OSDN Git Service

Add full color range support
[android-x86/external-IA-Hardware-Composer.git] / Android.common.mk
1 # Copyright (c) 2017 Intel Corporation
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
15
16 ifeq ($(strip $(BOARD_USES_IA_HWCOMPOSER)), true)
17 # Obtain root HWC source path
18 HWC_PATH := $(call my-dir)
19
20 HWC_VERSION_GIT_BRANCH := $(shell pushd $(HWC_PATH) > /dev/null; git rev-parse --abbrev-ref HEAD; popd > /dev/null)
21 HWC_VERSION_GIT_SHA := $(shell pushd $(HWC_PATH) > /dev/null; git rev-parse HEAD; popd > /dev/null)
22
23
24 #------------------------------------------------------------------------
25 #  1. Evaluate ANDROID_VERSION from PLATFORM_VERSION
26 #  2. First letter may be the major version or the dessert letter
27 #------------------------------------------------------------------------
28 ANDROID_M := 6
29 ANDROID_N := 7
30 ANDROID_O := 8
31 ANDROID_P := 9
32 ANDROID_VERSION_6 := $(ANDROID_M)
33 ANDROID_VERSION_7 := $(ANDROID_N)
34 ANDROID_VERSION_8 := $(ANDROID_O)
35 ANDROID_VERSION_9 := $(ANDROID_P)
36 ANDROID_VERSION_O := $(ANDROID_O)
37 ANDROID_VERSION_OMR1 := $(ANDROID_O)
38 ANDROID_SUPPORTED_VERSIONS := 6 7 O 8 OMR1 9
39
40 $(info "PLATFORM_VERSION $(PLATFORM_VERSION)")
41 ANDROID_MAJOR_VERSION := $(word 1, $(subst ., , $(PLATFORM_VERSION)))
42 $(foreach item, $(ANDROID_SUPPORTED_VERSIONS),\
43 $(if $(call streq,$(ANDROID_MAJOR_VERSION),$(item)),\
44 $(eval ANDROID_VERSION := $(ANDROID_VERSION_$(item))),))
45 $(info "ANDROID_VERSION $(ANDROID_VERSION)")
46
47 LOCAL_PATH := $(call my-dir)
48 include $(CLEAR_VARS)
49
50 LOCAL_SHARED_LIBRARIES := \
51         libcutils \
52         libdrm \
53         libEGL \
54         libGLESv2 \
55         libhardware \
56         liblog \
57         libui \
58         libutils \
59         libhwcservice \
60         libbinder
61
62 LOCAL_C_INCLUDES := \
63         system/core/include/utils \
64         frameworks/native/libs/nativewindow/include \
65         frameworks/native/libs/nativewindow \
66         $(LOCAL_PATH)/public \
67         $(LOCAL_PATH)/common/core \
68         $(LOCAL_PATH)/common/compositor \
69         $(LOCAL_PATH)/common/compositor/gl \
70         $(LOCAL_PATH)/common/display \
71         $(LOCAL_PATH)/common/utils \
72         $(LOCAL_PATH)/os \
73         $(LOCAL_PATH)/os/android \
74         $(LOCAL_PATH)/wsi \
75         $(LOCAL_PATH)/wsi/drm
76
77 LOCAL_SRC_FILES := \
78         os/platformcommondrmdefines.cpp \
79         os/android/platformdefines.cpp
80
81 ifeq ($(strip $(TARGET_USES_HWC2)), true)
82 LOCAL_SRC_FILES += os/android/iahwc2.cpp \
83                    os/android/hwcservice.cpp
84 else
85 LOCAL_SRC_FILES += os/android/iahwc1.cpp
86 LOCAL_C_INCLUDES += \
87         system/core/libsync \
88         system/core/libsync/include
89
90 LOCAL_SHARED_LIBRARIES += \
91         libsync
92
93 LOCAL_CPPFLAGS += -DENABLE_DOUBLE_BUFFERING
94 endif
95
96 LOCAL_CPPFLAGS += -DUSE_GRALLOC1
97
98 ifeq ($(strip $(ENABLE_HYPER_DMABUF_SHARING)), true)
99 LOCAL_CPPFLAGS += -DHYPER_DMABUF_SHARING
100 endif
101
102 LOCAL_SRC_FILES += os/android/gralloc1bufferhandler.cpp
103
104 LOCAL_CPPFLAGS += \
105         -DHWC_VERSION_GIT_BRANCH="\"$(HWC_VERSION_GIT_BRANCH)\"" \
106         -DHWC_VERSION_GIT_SHA="\"$(HWC_VERSION_GIT_SHA)\"" \
107         -DHWC2_INCLUDE_STRINGIFICATION \
108         -DHWC2_USE_CPP11 \
109         -Wno-date-time \
110         -DUSE_ANDROID_SHIM \
111         -D_FORTIFY_SOURCE=2 \
112         -fstack-protector-strong \
113         -Wformat -Wformat-security \
114         -std=c++14 -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
115         -Wall -Wsign-compare -Wpointer-arith \
116         -Wcast-qual -Wcast-align \
117         -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
118         -O3 \
119         -Wno-unused-private-field \
120         -Wno-unused-function \
121         -Wno-unused-parameter \
122         -Wno-unused-variable
123
124 LOCAL_CPPFLAGS += -DVA_SUPPORT_COLOR_RANGE
125
126 ifeq ($(strip $(BOARD_USES_VULKAN)), true)
127 LOCAL_SHARED_LIBRARIES += \
128         libvulkan
129
130 LOCAL_CPPFLAGS += \
131         -DUSE_VK \
132         -DDISABLE_EXPLICIT_SYNC
133
134 LOCAL_C_INCLUDES += \
135         $(LOCAL_PATH)/common/compositor/vk \
136         $(LOCAL_PATH)/../mesa/include
137 else
138 LOCAL_CPPFLAGS += \
139         -DUSE_GL \
140         -DENABLE_RBC
141 endif
142
143 ifneq ($(strip $(HWC_DISABLE_VA_DRIVER)), true)
144 LOCAL_C_INCLUDES += \
145         $(LOCAL_PATH)/common/compositor/va
146
147 LOCAL_SHARED_LIBRARIES += \
148         libva \
149         libva-android
150 LOCAL_CPPFLAGS += -DVA_WITH_PAVP
151 else
152 LOCAL_CPPFLAGS += -DDISABLE_VA
153 endif
154
155 LOCAL_C_INCLUDES += \
156         $(INTEL_MINIGBM)/cros_gralloc/
157
158 ifeq ($(shell test $(ANDROID_VERSION) -ge 9; echo $$?), 0)
159 LOCAL_SHARED_LIBRARIES += libnativewindow
160 endif
161
162 ifeq ($(strip $(BOARD_CURSOR_WA)), true)
163 LOCAL_CPPFLAGS += \
164         -DDISABLE_CURSOR_PLANE
165 endif
166
167 ifeq ($(strip $(BOARD_THREEDIS_UNDERRUN_WA)), true)
168 LOCAL_CPPFLAGS += \
169         -DTHREEDIS_UNDERRUN_WA
170 endif
171
172 endif