John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 1 | # |
John Stultz | 18814f6 | 2018-02-22 16:02:49 -0800 | [diff] [blame] | 2 | # Copyright (C) 2016-2017 ARM Limited. All rights reserved. |
John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 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 | |
| 18 | LOCAL_PATH := $(call my-dir) |
| 19 | |
| 20 | # Include platform specific makefiles |
| 21 | include $(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 |
| 30 | MALI_GPU_SUPPORT_AFBC_BASIC?=0 |
| 31 | # GPU support for AFBC 1.1 block split |
| 32 | MALI_GPU_SUPPORT_AFBC_SPLITBLK?=0 |
| 33 | # GPU support for AFBC 1.1 wide block |
| 34 | MALI_GPU_SUPPORT_AFBC_WIDEBLK?=0 |
| 35 | # GPU support for AFBC 1.2 tiled headers |
| 36 | MALI_GPU_SUPPORT_AFBC_TILED_HEADERS?=0 |
| 37 | # GPU support YUV AFBC formats in wide block |
| 38 | MALI_GPU_USE_YUV_AFBC_WIDEBLK?=0 |
| 39 | |
| 40 | # VPU version we support |
| 41 | MALI_VIDEO_VERSION?=0 |
| 42 | # DPU version we support |
| 43 | MALI_DISPLAY_VERSION?=0 |
| 44 | |
| 45 | # |
| 46 | # Software behaviour defines |
| 47 | # |
| 48 | |
John Stultz | 18814f6 | 2018-02-22 16:02:49 -0800 | [diff] [blame] | 49 | # Gralloc1 support |
| 50 | GRALLOC_USE_GRALLOC1_API?=0 |
John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 51 | # Use ION DMA heap for all allocations. Default is system heap. |
| 52 | GRALLOC_USE_ION_DMA_HEAP?=0 |
| 53 | # Use ION Compound heap for all allocations. Default is system heap. |
| 54 | GRALLOC_USE_ION_COMPOUND_PAGE_HEAP?=0 |
| 55 | # Properly initializes an empty AFBC buffer |
| 56 | GRALLOC_INIT_AFBC?=0 |
| 57 | # fbdev bitdepth to use |
| 58 | GRALLOC_DEPTH?=GRALLOC_32_BITS |
| 59 | # When enabled, forces display framebuffer format to BGRA_8888 |
| 60 | GRALLOC_FB_SWAP_RED_BLUE?=1 |
| 61 | # Disables the framebuffer HAL device. When a hwc impl is available. |
| 62 | GRALLOC_DISABLE_FRAMEBUFFER_HAL?=0 |
| 63 | # When enabled, buffers will never be allocated with AFBC |
| 64 | GRALLOC_ARM_NO_EXTERNAL_AFBC?=0 |
| 65 | # Minimum buffer dimensions in pixels when buffer will use AFBC |
| 66 | GRALLOC_DISP_W?=0 |
| 67 | GRALLOC_DISP_H?=0 |
| 68 | # Vsync backend(not used) |
| 69 | GRALLOC_VSYNC_BACKEND?=default |
| 70 | |
| 71 | # HAL module implemenation, not prelinked and stored in |
| 72 | # hw/<OVERLAY_HARDWARE_MODULE_ID>.<ro.product.board>.so |
| 73 | include $(CLEAR_VARS) |
John Stultz | 18814f6 | 2018-02-22 16:02:49 -0800 | [diff] [blame] | 74 | include $(BUILD_SYSTEM)/version_defaults.mk |
John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 75 | |
| 76 | ifeq ($(TARGET_BOARD_PLATFORM), juno) |
| 77 | ifeq ($(MALI_MMSS), 1) |
| 78 | |
| 79 | # Use latest default MMSS build configuration if not already defined |
| 80 | ifeq ($(MALI_DISPLAY_VERSION), 0) |
| 81 | MALI_DISPLAY_VERSION = 650 |
| 82 | endif |
| 83 | ifeq ($(MALI_VIDEO_VERSION), 0) |
| 84 | MALI_VIDEO_VERSION = 550 |
| 85 | endif |
| 86 | |
| 87 | GRALLOC_FB_SWAP_RED_BLUE = 0 |
| 88 | GRALLOC_USE_ION_DMA_HEAP = 1 |
| 89 | endif |
| 90 | endif |
| 91 | |
| 92 | ifeq ($(TARGET_BOARD_PLATFORM), armboard_v7a) |
| 93 | ifeq ($(GRALLOC_MALI_DP),true) |
| 94 | GRALLOC_FB_SWAP_RED_BLUE = 0 |
| 95 | GRALLOC_DISABLE_FRAMEBUFFER_HAL=1 |
| 96 | MALI_DISPLAY_VERSION = 550 |
| 97 | GRALLOC_USE_ION_DMA_HEAP=1 |
| 98 | endif |
| 99 | endif |
| 100 | |
| 101 | ifneq ($(MALI_DISPLAY_VERSION), 0) |
| 102 | #if Mali display is available, should disable framebuffer HAL |
| 103 | GRALLOC_DISABLE_FRAMEBUFFER_HAL := 1 |
| 104 | #if Mali display is available, AFBC buffers should be initialised after allocation |
| 105 | GRALLOC_INIT_AFBC := 1 |
| 106 | endif |
| 107 | |
| 108 | ifeq ($(GRALLOC_USE_ION_DMA_HEAP), 1) |
| 109 | ifeq ($(GRALLOC_USE_ION_COMPOUND_PAGE_HEAP), 1) |
| 110 | $(error GRALLOC_USE_ION_DMA_HEAP and GRALLOC_USE_ION_COMPOUND_PAGE_HEAP can't be enabled at the same time) |
| 111 | endif |
| 112 | endif |
| 113 | |
John Stultz | 18814f6 | 2018-02-22 16:02:49 -0800 | [diff] [blame] | 114 | PLATFORM_SDK_GREATER_THAN_24 := $(shell expr $(PLATFORM_SDK_VERSION) \> 24) |
| 115 | |
| 116 | ifeq ($(PLATFORM_SDK_GREATER_THAN_24), 1) |
| 117 | ifeq ($(GRALLOC_EXPERIMENTAL), 1) |
| 118 | GRALLOC_USE_GRALLOC1_API := 1 |
| 119 | endif |
| 120 | endif |
| 121 | |
John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 122 | LOCAL_C_INCLUDES := $(MALI_LOCAL_PATH) $(MALI_DDK_INCLUDES) |
| 123 | |
| 124 | # General compilation flags |
| 125 | LOCAL_CFLAGS := -Werror -DLOG_TAG=\"gralloc\" -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
| 126 | |
| 127 | # Static hw flags |
| 128 | LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_BASIC=$(MALI_GPU_SUPPORT_AFBC_BASIC) |
| 129 | LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_SPLITBLK=$(MALI_GPU_SUPPORT_AFBC_SPLITBLK) |
| 130 | LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_WIDEBLK=$(MALI_GPU_SUPPORT_AFBC_WIDEBLK) |
| 131 | LOCAL_CFLAGS += -DMALI_GPU_USE_YUV_AFBC_WIDEBLK=$(MALI_GPU_USE_YUV_AFBC_WIDEBLK) |
| 132 | LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_TILED_HEADERS=$(MALI_GPU_SUPPORT_AFBC_TILED_HEADERS) |
| 133 | |
| 134 | LOCAL_CFLAGS += -DMALI_DISPLAY_VERSION=$(MALI_DISPLAY_VERSION) |
| 135 | LOCAL_CFLAGS += -DMALI_VIDEO_VERSION=$(MALI_VIDEO_VERSION) |
| 136 | |
| 137 | # Software behaviour flags |
John Stultz | 18814f6 | 2018-02-22 16:02:49 -0800 | [diff] [blame] | 138 | LOCAL_CFLAGS += -DGRALLOC_USE_GRALLOC1_API=$(GRALLOC_USE_GRALLOC1_API) |
John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 139 | LOCAL_CFLAGS += -DGRALLOC_DISP_W=$(GRALLOC_DISP_W) |
| 140 | LOCAL_CFLAGS += -DGRALLOC_DISP_H=$(GRALLOC_DISP_H) |
| 141 | LOCAL_CFLAGS += -DDISABLE_FRAMEBUFFER_HAL=$(GRALLOC_DISABLE_FRAMEBUFFER_HAL) |
| 142 | LOCAL_CFLAGS += -DGRALLOC_USE_ION_DMA_HEAP=$(GRALLOC_USE_ION_DMA_HEAP) |
| 143 | LOCAL_CFLAGS += -DGRALLOC_USE_ION_COMPOUND_PAGE_HEAP=$(GRALLOC_USE_ION_COMPOUND_PAGE_HEAP) |
| 144 | LOCAL_CFLAGS += -DGRALLOC_INIT_AFBC=$(GRALLOC_INIT_AFBC) |
| 145 | LOCAL_CFLAGS += -D$(GRALLOC_DEPTH) |
| 146 | LOCAL_CFLAGS += -DGRALLOC_FB_SWAP_RED_BLUE=$(GRALLOC_FB_SWAP_RED_BLUE) |
| 147 | LOCAL_CFLAGS += -DGRALLOC_ARM_NO_EXTERNAL_AFBC=$(GRALLOC_ARM_NO_EXTERNAL_AFBC) |
John Stultz | 18814f6 | 2018-02-22 16:02:49 -0800 | [diff] [blame] | 148 | LOCAL_CFLAGS += -DGRALLOC_LIBRARY_BUILD=1 |
John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 149 | |
John Stultz | 18814f6 | 2018-02-22 16:02:49 -0800 | [diff] [blame] | 150 | LOCAL_SHARED_LIBRARIES := libhardware liblog libcutils libGLESv1_CM libion libsync libutils |
John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 151 | |
| 152 | LOCAL_PRELINK_MODULE := false |
| 153 | LOCAL_MODULE_RELATIVE_PATH := hw |
| 154 | LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib |
| 155 | LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 |
John Stultz | 51d2a0d | 2017-05-26 22:06:58 -0700 | [diff] [blame] | 156 | LOCAL_MODULE := gralloc.hikey960 |
John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 157 | |
| 158 | LOCAL_MODULE_TAGS := optional |
| 159 | LOCAL_MULTILIB := both |
| 160 | |
| 161 | LOCAL_SRC_FILES := \ |
John Stultz | 18814f6 | 2018-02-22 16:02:49 -0800 | [diff] [blame] | 162 | mali_gralloc_module.cpp \ |
John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 163 | framebuffer_device.cpp \ |
| 164 | gralloc_buffer_priv.cpp \ |
| 165 | gralloc_vsync_${GRALLOC_VSYNC_BACKEND}.cpp \ |
John Stultz | 18814f6 | 2018-02-22 16:02:49 -0800 | [diff] [blame] | 166 | mali_gralloc_bufferaccess.cpp \ |
| 167 | mali_gralloc_bufferallocation.cpp \ |
| 168 | mali_gralloc_bufferdescriptor.cpp \ |
| 169 | mali_gralloc_ion.cpp \ |
| 170 | mali_gralloc_formats.cpp \ |
| 171 | mali_gralloc_reference.cpp \ |
| 172 | mali_gralloc_debug.cpp |
| 173 | |
| 174 | ifeq ($(GRALLOC_USE_GRALLOC1_API), 1) |
| 175 | LOCAL_SRC_FILES += \ |
| 176 | mali_gralloc_public_interface.cpp \ |
| 177 | mali_gralloc_private_interface.cpp |
| 178 | else |
| 179 | LOCAL_SRC_FILES += legacy/alloc_device.cpp |
| 180 | endif |
John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame] | 181 | |
| 182 | LOCAL_MODULE_OWNER := arm |
| 183 | |
| 184 | include $(BUILD_SHARED_LIBRARY) |