blob: 89f5857caa523caf079ff15378f2cee1ba8a6f83 [file] [log] [blame]
John Stultz16100f62017-05-03 11:12:18 -07001#
John Stultz18814f62018-02-22 16:02:49 -08002# Copyright (C) 2016-2017 ARM Limited. All rights reserved.
John Stultz16100f62017-05-03 11:12:18 -07003#
4# Copyright (C) 2008 The Android Open Source Project
5#
6# Licensed under the Apache License, Version 2.0 (the "License");
7# you may not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an "AS IS" BASIS,
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17
18LOCAL_PATH := $(call my-dir)
19
20# Include platform specific makefiles
21include $(if $(wildcard $(LOCAL_PATH)/Android.$(TARGET_BOARD_PLATFORM).mk), $(LOCAL_PATH)/Android.$(TARGET_BOARD_PLATFORM).mk,)
22
23#
24# Static hardware defines
25#
26# These defines are used in case runtime detection does not find the
27# user-space driver to read out hardware capabilities
28
29# GPU support for AFBC 1.0
30MALI_GPU_SUPPORT_AFBC_BASIC?=0
31# GPU support for AFBC 1.1 block split
32MALI_GPU_SUPPORT_AFBC_SPLITBLK?=0
33# GPU support for AFBC 1.1 wide block
34MALI_GPU_SUPPORT_AFBC_WIDEBLK?=0
35# GPU support for AFBC 1.2 tiled headers
36MALI_GPU_SUPPORT_AFBC_TILED_HEADERS?=0
37# GPU support YUV AFBC formats in wide block
38MALI_GPU_USE_YUV_AFBC_WIDEBLK?=0
39
40# VPU version we support
41MALI_VIDEO_VERSION?=0
42# DPU version we support
43MALI_DISPLAY_VERSION?=0
44
45#
46# Software behaviour defines
47#
48
John Stultz18814f62018-02-22 16:02:49 -080049# Gralloc1 support
50GRALLOC_USE_GRALLOC1_API?=0
John Stultz16100f62017-05-03 11:12:18 -070051# Use ION DMA heap for all allocations. Default is system heap.
52GRALLOC_USE_ION_DMA_HEAP?=0
53# Use ION Compound heap for all allocations. Default is system heap.
54GRALLOC_USE_ION_COMPOUND_PAGE_HEAP?=0
55# Properly initializes an empty AFBC buffer
56GRALLOC_INIT_AFBC?=0
57# fbdev bitdepth to use
58GRALLOC_DEPTH?=GRALLOC_32_BITS
59# When enabled, forces display framebuffer format to BGRA_8888
60GRALLOC_FB_SWAP_RED_BLUE?=1
61# Disables the framebuffer HAL device. When a hwc impl is available.
62GRALLOC_DISABLE_FRAMEBUFFER_HAL?=0
63# When enabled, buffers will never be allocated with AFBC
64GRALLOC_ARM_NO_EXTERNAL_AFBC?=0
65# Minimum buffer dimensions in pixels when buffer will use AFBC
66GRALLOC_DISP_W?=0
67GRALLOC_DISP_H?=0
68# Vsync backend(not used)
69GRALLOC_VSYNC_BACKEND?=default
70
71# HAL module implemenation, not prelinked and stored in
72# hw/<OVERLAY_HARDWARE_MODULE_ID>.<ro.product.board>.so
73include $(CLEAR_VARS)
John Stultz16100f62017-05-03 11:12:18 -070074
75ifeq ($(TARGET_BOARD_PLATFORM), juno)
76ifeq ($(MALI_MMSS), 1)
77
78# Use latest default MMSS build configuration if not already defined
79ifeq ($(MALI_DISPLAY_VERSION), 0)
80MALI_DISPLAY_VERSION = 650
81endif
82ifeq ($(MALI_VIDEO_VERSION), 0)
83MALI_VIDEO_VERSION = 550
84endif
85
86GRALLOC_FB_SWAP_RED_BLUE = 0
87GRALLOC_USE_ION_DMA_HEAP = 1
88endif
89endif
90
91ifeq ($(TARGET_BOARD_PLATFORM), armboard_v7a)
92ifeq ($(GRALLOC_MALI_DP),true)
93 GRALLOC_FB_SWAP_RED_BLUE = 0
94 GRALLOC_DISABLE_FRAMEBUFFER_HAL=1
95 MALI_DISPLAY_VERSION = 550
96 GRALLOC_USE_ION_DMA_HEAP=1
97endif
98endif
99
100ifneq ($(MALI_DISPLAY_VERSION), 0)
101#if Mali display is available, should disable framebuffer HAL
102GRALLOC_DISABLE_FRAMEBUFFER_HAL := 1
103#if Mali display is available, AFBC buffers should be initialised after allocation
104GRALLOC_INIT_AFBC := 1
105endif
106
107ifeq ($(GRALLOC_USE_ION_DMA_HEAP), 1)
108ifeq ($(GRALLOC_USE_ION_COMPOUND_PAGE_HEAP), 1)
109$(error GRALLOC_USE_ION_DMA_HEAP and GRALLOC_USE_ION_COMPOUND_PAGE_HEAP can't be enabled at the same time)
110endif
111endif
112
John Stultz18814f62018-02-22 16:02:49 -0800113PLATFORM_SDK_GREATER_THAN_24 := $(shell expr $(PLATFORM_SDK_VERSION) \> 24)
114
115ifeq ($(PLATFORM_SDK_GREATER_THAN_24), 1)
116ifeq ($(GRALLOC_EXPERIMENTAL), 1)
117 GRALLOC_USE_GRALLOC1_API := 1
118endif
119endif
120
John Stultz16100f62017-05-03 11:12:18 -0700121LOCAL_C_INCLUDES := $(MALI_LOCAL_PATH) $(MALI_DDK_INCLUDES)
122
123# General compilation flags
124LOCAL_CFLAGS := -Werror -DLOG_TAG=\"gralloc\" -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
125
126# Static hw flags
127LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_BASIC=$(MALI_GPU_SUPPORT_AFBC_BASIC)
128LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_SPLITBLK=$(MALI_GPU_SUPPORT_AFBC_SPLITBLK)
129LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_WIDEBLK=$(MALI_GPU_SUPPORT_AFBC_WIDEBLK)
130LOCAL_CFLAGS += -DMALI_GPU_USE_YUV_AFBC_WIDEBLK=$(MALI_GPU_USE_YUV_AFBC_WIDEBLK)
131LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_TILED_HEADERS=$(MALI_GPU_SUPPORT_AFBC_TILED_HEADERS)
132
133LOCAL_CFLAGS += -DMALI_DISPLAY_VERSION=$(MALI_DISPLAY_VERSION)
134LOCAL_CFLAGS += -DMALI_VIDEO_VERSION=$(MALI_VIDEO_VERSION)
135
136# Software behaviour flags
John Stultz18814f62018-02-22 16:02:49 -0800137LOCAL_CFLAGS += -DGRALLOC_USE_GRALLOC1_API=$(GRALLOC_USE_GRALLOC1_API)
John Stultz16100f62017-05-03 11:12:18 -0700138LOCAL_CFLAGS += -DGRALLOC_DISP_W=$(GRALLOC_DISP_W)
139LOCAL_CFLAGS += -DGRALLOC_DISP_H=$(GRALLOC_DISP_H)
140LOCAL_CFLAGS += -DDISABLE_FRAMEBUFFER_HAL=$(GRALLOC_DISABLE_FRAMEBUFFER_HAL)
141LOCAL_CFLAGS += -DGRALLOC_USE_ION_DMA_HEAP=$(GRALLOC_USE_ION_DMA_HEAP)
142LOCAL_CFLAGS += -DGRALLOC_USE_ION_COMPOUND_PAGE_HEAP=$(GRALLOC_USE_ION_COMPOUND_PAGE_HEAP)
143LOCAL_CFLAGS += -DGRALLOC_INIT_AFBC=$(GRALLOC_INIT_AFBC)
144LOCAL_CFLAGS += -D$(GRALLOC_DEPTH)
145LOCAL_CFLAGS += -DGRALLOC_FB_SWAP_RED_BLUE=$(GRALLOC_FB_SWAP_RED_BLUE)
146LOCAL_CFLAGS += -DGRALLOC_ARM_NO_EXTERNAL_AFBC=$(GRALLOC_ARM_NO_EXTERNAL_AFBC)
John Stultz18814f62018-02-22 16:02:49 -0800147LOCAL_CFLAGS += -DGRALLOC_LIBRARY_BUILD=1
John Stultz16100f62017-05-03 11:12:18 -0700148
John Stultz18814f62018-02-22 16:02:49 -0800149LOCAL_SHARED_LIBRARIES := libhardware liblog libcutils libGLESv1_CM libion libsync libutils
John Stultz16100f62017-05-03 11:12:18 -0700150
151LOCAL_PRELINK_MODULE := false
152LOCAL_MODULE_RELATIVE_PATH := hw
153LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
154LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
John Stultz51d2a0d2017-05-26 22:06:58 -0700155LOCAL_MODULE := gralloc.hikey960
Bob Badour61897682021-02-12 19:52:52 -0800156LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL-2.0
157LOCAL_LICENSE_CONDITIONS := notice restricted
John Stultz16100f62017-05-03 11:12:18 -0700158
159LOCAL_MODULE_TAGS := optional
160LOCAL_MULTILIB := both
161
162LOCAL_SRC_FILES := \
John Stultz18814f62018-02-22 16:02:49 -0800163 mali_gralloc_module.cpp \
John Stultz16100f62017-05-03 11:12:18 -0700164 framebuffer_device.cpp \
165 gralloc_buffer_priv.cpp \
166 gralloc_vsync_${GRALLOC_VSYNC_BACKEND}.cpp \
John Stultz18814f62018-02-22 16:02:49 -0800167 mali_gralloc_bufferaccess.cpp \
168 mali_gralloc_bufferallocation.cpp \
169 mali_gralloc_bufferdescriptor.cpp \
170 mali_gralloc_ion.cpp \
171 mali_gralloc_formats.cpp \
172 mali_gralloc_reference.cpp \
173 mali_gralloc_debug.cpp
174
175ifeq ($(GRALLOC_USE_GRALLOC1_API), 1)
176LOCAL_SRC_FILES += \
177 mali_gralloc_public_interface.cpp \
178 mali_gralloc_private_interface.cpp
179else
180LOCAL_SRC_FILES += legacy/alloc_device.cpp
181endif
John Stultz16100f62017-05-03 11:12:18 -0700182
183LOCAL_MODULE_OWNER := arm
184
185include $(BUILD_SHARED_LIBRARY)