1 # Copyright (c) 2017 Intel Corporation
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 ifeq ($(strip $(BOARD_USES_IA_HWCOMPOSER)), true)
17 # Obtain root HWC source path
18 HWC_PATH := $(call my-dir)
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)
24 #------------------------------------------------------------------------
25 # 1. Evaluate ANDROID_VERSION from PLATFORM_VERSION
26 # 2. First letter may be the major version or the dessert letter
27 #------------------------------------------------------------------------
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
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)")
47 LOCAL_PATH := $(call my-dir)
50 LOCAL_SHARED_LIBRARIES := \
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 \
73 $(LOCAL_PATH)/os/android \
78 os/platformcommondrmdefines.cpp \
79 os/android/platformdefines.cpp
81 ifeq ($(strip $(TARGET_USES_HWC2)), true)
82 LOCAL_SRC_FILES += os/android/iahwc2.cpp \
83 os/android/hwcservice.cpp
85 LOCAL_SRC_FILES += os/android/iahwc1.cpp
88 system/core/libsync/include
90 LOCAL_SHARED_LIBRARIES += \
93 LOCAL_CPPFLAGS += -DENABLE_DOUBLE_BUFFERING
96 LOCAL_CPPFLAGS += -DUSE_GRALLOC1
98 ifeq ($(strip $(ENABLE_HYPER_DMABUF_SHARING)), true)
99 LOCAL_CPPFLAGS += -DHYPER_DMABUF_SHARING
102 LOCAL_SRC_FILES += os/android/gralloc1bufferhandler.cpp
105 -DHWC_VERSION_GIT_BRANCH="\"$(HWC_VERSION_GIT_BRANCH)\"" \
106 -DHWC_VERSION_GIT_SHA="\"$(HWC_VERSION_GIT_SHA)\"" \
107 -DHWC2_INCLUDE_STRINGIFICATION \
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 \
119 -Wno-unused-private-field \
120 -Wno-unused-function \
121 -Wno-unused-parameter \
124 LOCAL_CPPFLAGS += -DVA_SUPPORT_COLOR_RANGE
126 ifeq ($(strip $(BOARD_USES_VULKAN)), true)
127 LOCAL_SHARED_LIBRARIES += \
132 -DDISABLE_EXPLICIT_SYNC
134 LOCAL_C_INCLUDES += \
135 $(LOCAL_PATH)/common/compositor/vk \
136 $(LOCAL_PATH)/../mesa/include
143 ifneq ($(strip $(HWC_DISABLE_VA_DRIVER)), true)
144 LOCAL_C_INCLUDES += \
145 $(LOCAL_PATH)/common/compositor/va
147 LOCAL_SHARED_LIBRARIES += \
150 LOCAL_CPPFLAGS += -DVA_WITH_PAVP
152 LOCAL_CPPFLAGS += -DDISABLE_VA
155 LOCAL_C_INCLUDES += \
156 $(INTEL_MINIGBM)/cros_gralloc/
158 ifeq ($(shell test $(ANDROID_VERSION) -ge 9; echo $$?), 0)
159 LOCAL_SHARED_LIBRARIES += libnativewindow
162 ifeq ($(strip $(BOARD_CURSOR_WA)), true)
164 -DDISABLE_CURSOR_PLANE
167 ifeq ($(strip $(BOARD_THREEDIS_UNDERRUN_WA)), true)
169 -DTHREEDIS_UNDERRUN_WA