blob: 9d615f9d4b4e167a106a3b486629f62195140e57 [file] [log] [blame]
John Stultz16100f62017-05-03 11:12:18 -07001#
2# Copyright (C) 2016 ARM Limited. All rights reserved.
3#
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
John Stultz51d2a0d2017-05-26 22:06:58 -070018ifeq ($(TARGET_PRODUCT),hikey960)
John Stultz16100f62017-05-03 11:12:18 -070019LOCAL_PATH := $(call my-dir)
20
21# Include platform specific makefiles
22include $(if $(wildcard $(LOCAL_PATH)/Android.$(TARGET_BOARD_PLATFORM).mk), $(LOCAL_PATH)/Android.$(TARGET_BOARD_PLATFORM).mk,)
23
24#
25# Static hardware defines
26#
27# These defines are used in case runtime detection does not find the
28# user-space driver to read out hardware capabilities
29
30# GPU support for AFBC 1.0
31MALI_GPU_SUPPORT_AFBC_BASIC?=0
32# GPU support for AFBC 1.1 block split
33MALI_GPU_SUPPORT_AFBC_SPLITBLK?=0
34# GPU support for AFBC 1.1 wide block
35MALI_GPU_SUPPORT_AFBC_WIDEBLK?=0
36# GPU support for AFBC 1.2 tiled headers
37MALI_GPU_SUPPORT_AFBC_TILED_HEADERS?=0
38# GPU support YUV AFBC formats in wide block
39MALI_GPU_USE_YUV_AFBC_WIDEBLK?=0
40
41# VPU version we support
42MALI_VIDEO_VERSION?=0
43# DPU version we support
44MALI_DISPLAY_VERSION?=0
45
46#
47# Software behaviour defines
48#
49
50# Use ION DMA heap for all allocations. Default is system heap.
51GRALLOC_USE_ION_DMA_HEAP?=0
52# Use ION Compound heap for all allocations. Default is system heap.
53GRALLOC_USE_ION_COMPOUND_PAGE_HEAP?=0
54# Properly initializes an empty AFBC buffer
55GRALLOC_INIT_AFBC?=0
56# fbdev bitdepth to use
57GRALLOC_DEPTH?=GRALLOC_32_BITS
58# When enabled, forces display framebuffer format to BGRA_8888
59GRALLOC_FB_SWAP_RED_BLUE?=1
60# Disables the framebuffer HAL device. When a hwc impl is available.
61GRALLOC_DISABLE_FRAMEBUFFER_HAL?=0
62# When enabled, buffers will never be allocated with AFBC
63GRALLOC_ARM_NO_EXTERNAL_AFBC?=0
64# Minimum buffer dimensions in pixels when buffer will use AFBC
65GRALLOC_DISP_W?=0
66GRALLOC_DISP_H?=0
67# Vsync backend(not used)
68GRALLOC_VSYNC_BACKEND?=default
69
70# HAL module implemenation, not prelinked and stored in
71# hw/<OVERLAY_HARDWARE_MODULE_ID>.<ro.product.board>.so
72include $(CLEAR_VARS)
73include $(BUILD_SYSTEM)/version_defaults.mk
74
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
113LOCAL_C_INCLUDES := $(MALI_LOCAL_PATH) $(MALI_DDK_INCLUDES)
114
115# General compilation flags
116LOCAL_CFLAGS := -Werror -DLOG_TAG=\"gralloc\" -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION)
117
118# Static hw flags
119LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_BASIC=$(MALI_GPU_SUPPORT_AFBC_BASIC)
120LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_SPLITBLK=$(MALI_GPU_SUPPORT_AFBC_SPLITBLK)
121LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_WIDEBLK=$(MALI_GPU_SUPPORT_AFBC_WIDEBLK)
122LOCAL_CFLAGS += -DMALI_GPU_USE_YUV_AFBC_WIDEBLK=$(MALI_GPU_USE_YUV_AFBC_WIDEBLK)
123LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_TILED_HEADERS=$(MALI_GPU_SUPPORT_AFBC_TILED_HEADERS)
124
125LOCAL_CFLAGS += -DMALI_DISPLAY_VERSION=$(MALI_DISPLAY_VERSION)
126LOCAL_CFLAGS += -DMALI_VIDEO_VERSION=$(MALI_VIDEO_VERSION)
127
128# Software behaviour flags
129LOCAL_CFLAGS += -DGRALLOC_DISP_W=$(GRALLOC_DISP_W)
130LOCAL_CFLAGS += -DGRALLOC_DISP_H=$(GRALLOC_DISP_H)
131LOCAL_CFLAGS += -DDISABLE_FRAMEBUFFER_HAL=$(GRALLOC_DISABLE_FRAMEBUFFER_HAL)
132LOCAL_CFLAGS += -DGRALLOC_USE_ION_DMA_HEAP=$(GRALLOC_USE_ION_DMA_HEAP)
133LOCAL_CFLAGS += -DGRALLOC_USE_ION_COMPOUND_PAGE_HEAP=$(GRALLOC_USE_ION_COMPOUND_PAGE_HEAP)
134LOCAL_CFLAGS += -DGRALLOC_INIT_AFBC=$(GRALLOC_INIT_AFBC)
135LOCAL_CFLAGS += -D$(GRALLOC_DEPTH)
136LOCAL_CFLAGS += -DGRALLOC_FB_SWAP_RED_BLUE=$(GRALLOC_FB_SWAP_RED_BLUE)
137LOCAL_CFLAGS += -DGRALLOC_ARM_NO_EXTERNAL_AFBC=$(GRALLOC_ARM_NO_EXTERNAL_AFBC)
138
139LOCAL_SHARED_LIBRARIES := libhardware liblog libcutils libGLESv1_CM libion
140
141LOCAL_PRELINK_MODULE := false
142LOCAL_MODULE_RELATIVE_PATH := hw
143LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib
144LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64
John Stultz51d2a0d2017-05-26 22:06:58 -0700145
146LOCAL_MODULE := gralloc.hikey960
John Stultz16100f62017-05-03 11:12:18 -0700147
148LOCAL_MODULE_TAGS := optional
149LOCAL_MULTILIB := both
150
151LOCAL_SRC_FILES := \
152 gralloc_module.cpp \
153 alloc_device.cpp \
154 alloc_ion.cpp \
155 gralloc_module_ion.cpp \
156 framebuffer_device.cpp \
157 gralloc_buffer_priv.cpp \
158 gralloc_vsync_${GRALLOC_VSYNC_BACKEND}.cpp \
159 mali_gralloc_formats.cpp
160
161LOCAL_MODULE_OWNER := arm
162
163include $(BUILD_SHARED_LIBRARY)
John Stultz51d2a0d2017-05-26 22:06:58 -0700164
165endif