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 ifeq ($(strip $(ENABLE_HYPER_DMABUF_SHARING)), true)
51 LOCAL_CPPFLAGS += -DENABLE_PANORAMA
54 LOCAL_SHARED_LIBRARIES := \
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 \
77 $(LOCAL_PATH)/os/android \
82 os/platformcommondrmdefines.cpp \
83 os/android/platformdefines.cpp
85 ifeq ($(strip $(TARGET_USES_HWC2)), true)
86 LOCAL_SRC_FILES += os/android/iahwc2.cpp \
87 os/android/hwcservice.cpp
89 LOCAL_SRC_FILES += os/android/iahwc1.cpp
92 system/core/libsync/include
94 LOCAL_SHARED_LIBRARIES += \
97 LOCAL_CPPFLAGS += -DENABLE_DOUBLE_BUFFERING
100 LOCAL_CPPFLAGS += -DUSE_GRALLOC1
102 ifeq ($(strip $(ENABLE_HYPER_DMABUF_SHARING)), true)
103 LOCAL_CPPFLAGS += -DHYPER_DMABUF_SHARING
106 LOCAL_SRC_FILES += os/android/gralloc1bufferhandler.cpp
109 -DHWC_VERSION_GIT_BRANCH="\"$(HWC_VERSION_GIT_BRANCH)\"" \
110 -DHWC_VERSION_GIT_SHA="\"$(HWC_VERSION_GIT_SHA)\"" \
111 -DHWC2_INCLUDE_STRINGIFICATION \
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 \
123 -Wno-unused-private-field \
124 -Wno-unused-function \
125 -Wno-unused-parameter \
128 LOCAL_CPPFLAGS += -DVA_SUPPORT_COLOR_RANGE
130 ifeq ($(strip $(BOARD_USES_VULKAN)), true)
131 LOCAL_SHARED_LIBRARIES += \
136 -DDISABLE_EXPLICIT_SYNC
138 LOCAL_C_INCLUDES += \
139 $(LOCAL_PATH)/common/compositor/vk \
140 $(LOCAL_PATH)/../mesa/include
147 ifneq ($(strip $(HWC_DISABLE_VA_DRIVER)), true)
148 LOCAL_C_INCLUDES += \
149 $(LOCAL_PATH)/common/compositor/va
151 LOCAL_SHARED_LIBRARIES += \
158 LOCAL_CPPFLAGS += -DDISABLE_VA
161 LOCAL_C_INCLUDES += \
162 $(INTEL_MINIGBM)/cros_gralloc/
164 ifeq ($(shell test $(ANDROID_VERSION) -ge 9; echo $$?), 0)
165 LOCAL_SHARED_LIBRARIES += libnativewindow