OSDN Git Service

Fix a misstike when LogicalDisplaymanager do present
[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 ifeq ($(strip $(ENABLE_HYPER_DMABUF_SHARING)), true)
51 LOCAL_CPPFLAGS += -DENABLE_PANORAMA
52 endif
53
54 LOCAL_SHARED_LIBRARIES := \
55         libcutils \
56         libdrm \
57         libEGL \
58         libGLESv2 \
59         libhardware \
60         liblog \
61         libui \
62         libutils \
63         libhwcservice \
64         libbinder
65
66 LOCAL_C_INCLUDES := \
67         system/core/include/utils \
68         frameworks/native/libs/nativewindow/include \
69         frameworks/native/libs/nativewindow \
70         $(LOCAL_PATH)/public \
71         $(LOCAL_PATH)/common/core \
72         $(LOCAL_PATH)/common/compositor \
73         $(LOCAL_PATH)/common/compositor/gl \
74         $(LOCAL_PATH)/common/display \
75         $(LOCAL_PATH)/common/utils \
76         $(LOCAL_PATH)/os \
77         $(LOCAL_PATH)/os/android \
78         $(LOCAL_PATH)/wsi \
79         $(LOCAL_PATH)/wsi/drm
80
81 LOCAL_SRC_FILES := \
82         os/platformcommondrmdefines.cpp \
83         os/android/platformdefines.cpp
84
85 ifeq ($(strip $(TARGET_USES_HWC2)), true)
86 LOCAL_SRC_FILES += os/android/iahwc2.cpp \
87                    os/android/hwcservice.cpp
88 else
89 LOCAL_SRC_FILES += os/android/iahwc1.cpp
90 LOCAL_C_INCLUDES += \
91         system/core/libsync \
92         system/core/libsync/include
93
94 LOCAL_SHARED_LIBRARIES += \
95         libsync
96
97 LOCAL_CPPFLAGS += -DENABLE_DOUBLE_BUFFERING
98 endif
99
100 LOCAL_CPPFLAGS += -DUSE_GRALLOC1
101
102 ifeq ($(strip $(ENABLE_HYPER_DMABUF_SHARING)), true)
103 LOCAL_CPPFLAGS += -DHYPER_DMABUF_SHARING
104 endif
105
106 LOCAL_SRC_FILES += os/android/gralloc1bufferhandler.cpp
107
108 LOCAL_CPPFLAGS += \
109         -DHWC_VERSION_GIT_BRANCH="\"$(HWC_VERSION_GIT_BRANCH)\"" \
110         -DHWC_VERSION_GIT_SHA="\"$(HWC_VERSION_GIT_SHA)\"" \
111         -DHWC2_INCLUDE_STRINGIFICATION \
112         -DHWC2_USE_CPP11 \
113         -Wno-date-time \
114         -DUSE_ANDROID_SHIM \
115         -D_FORTIFY_SOURCE=2 \
116         -fstack-protector-strong \
117         -Wformat -Wformat-security \
118         -std=c++14 -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
119         -Wall -Wsign-compare -Wpointer-arith \
120         -Wcast-qual -Wcast-align \
121         -D_GNU_SOURCE=1 -D_FILE_OFFSET_BITS=64 \
122         -O3 \
123         -Wno-unused-private-field \
124         -Wno-unused-function \
125         -Wno-unused-parameter \
126         -Wno-unused-variable
127
128 LOCAL_CPPFLAGS += -DVA_SUPPORT_COLOR_RANGE
129
130 ifeq ($(strip $(BOARD_USES_VULKAN)), true)
131 LOCAL_SHARED_LIBRARIES += \
132         libvulkan
133
134 LOCAL_CPPFLAGS += \
135         -DUSE_VK \
136         -DDISABLE_EXPLICIT_SYNC
137
138 LOCAL_C_INCLUDES += \
139         $(LOCAL_PATH)/common/compositor/vk \
140         $(LOCAL_PATH)/../mesa/include
141 else
142 LOCAL_CPPFLAGS += \
143         -DUSE_GL \
144         -DENABLE_RBC
145 endif
146
147 ifneq ($(strip $(HWC_DISABLE_VA_DRIVER)), true)
148 LOCAL_C_INCLUDES += \
149         $(LOCAL_PATH)/common/compositor/va
150
151 LOCAL_SHARED_LIBRARIES += \
152         libva \
153         libva-android
154 LOCAL_CPPFLAGS += \
155         -DVA_WITH_PAVP \
156         -DVA_WITH_VPP
157 else
158 LOCAL_CPPFLAGS += -DDISABLE_VA
159 endif
160
161 LOCAL_C_INCLUDES += \
162         $(INTEL_MINIGBM)/cros_gralloc/
163
164 ifeq ($(shell test $(ANDROID_VERSION) -ge 9; echo $$?), 0)
165 LOCAL_SHARED_LIBRARIES += libnativewindow
166 endif
167
168 LOCAL_CPPFLAGS += \
169        -DMODIFICATOR_WA
170
171 endif