John Stultz | 16100f6 | 2017-05-03 11:12:18 -0700 | [diff] [blame^] | 1 | # |
| 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 | |
| 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 | |
| 49 | # Use ION DMA heap for all allocations. Default is system heap. |
| 50 | GRALLOC_USE_ION_DMA_HEAP?=0 |
| 51 | # Use ION Compound heap for all allocations. Default is system heap. |
| 52 | GRALLOC_USE_ION_COMPOUND_PAGE_HEAP?=0 |
| 53 | # Properly initializes an empty AFBC buffer |
| 54 | GRALLOC_INIT_AFBC?=0 |
| 55 | # fbdev bitdepth to use |
| 56 | GRALLOC_DEPTH?=GRALLOC_32_BITS |
| 57 | # When enabled, forces display framebuffer format to BGRA_8888 |
| 58 | GRALLOC_FB_SWAP_RED_BLUE?=1 |
| 59 | # Disables the framebuffer HAL device. When a hwc impl is available. |
| 60 | GRALLOC_DISABLE_FRAMEBUFFER_HAL?=0 |
| 61 | # When enabled, buffers will never be allocated with AFBC |
| 62 | GRALLOC_ARM_NO_EXTERNAL_AFBC?=0 |
| 63 | # Minimum buffer dimensions in pixels when buffer will use AFBC |
| 64 | GRALLOC_DISP_W?=0 |
| 65 | GRALLOC_DISP_H?=0 |
| 66 | # Vsync backend(not used) |
| 67 | GRALLOC_VSYNC_BACKEND?=default |
| 68 | |
| 69 | # HAL module implemenation, not prelinked and stored in |
| 70 | # hw/<OVERLAY_HARDWARE_MODULE_ID>.<ro.product.board>.so |
| 71 | include $(CLEAR_VARS) |
| 72 | include $(BUILD_SYSTEM)/version_defaults.mk |
| 73 | |
| 74 | ifeq ($(TARGET_BOARD_PLATFORM), juno) |
| 75 | ifeq ($(MALI_MMSS), 1) |
| 76 | |
| 77 | # Use latest default MMSS build configuration if not already defined |
| 78 | ifeq ($(MALI_DISPLAY_VERSION), 0) |
| 79 | MALI_DISPLAY_VERSION = 650 |
| 80 | endif |
| 81 | ifeq ($(MALI_VIDEO_VERSION), 0) |
| 82 | MALI_VIDEO_VERSION = 550 |
| 83 | endif |
| 84 | |
| 85 | GRALLOC_FB_SWAP_RED_BLUE = 0 |
| 86 | GRALLOC_USE_ION_DMA_HEAP = 1 |
| 87 | endif |
| 88 | endif |
| 89 | |
| 90 | ifeq ($(TARGET_BOARD_PLATFORM), armboard_v7a) |
| 91 | ifeq ($(GRALLOC_MALI_DP),true) |
| 92 | GRALLOC_FB_SWAP_RED_BLUE = 0 |
| 93 | GRALLOC_DISABLE_FRAMEBUFFER_HAL=1 |
| 94 | MALI_DISPLAY_VERSION = 550 |
| 95 | GRALLOC_USE_ION_DMA_HEAP=1 |
| 96 | endif |
| 97 | endif |
| 98 | |
| 99 | ifneq ($(MALI_DISPLAY_VERSION), 0) |
| 100 | #if Mali display is available, should disable framebuffer HAL |
| 101 | GRALLOC_DISABLE_FRAMEBUFFER_HAL := 1 |
| 102 | #if Mali display is available, AFBC buffers should be initialised after allocation |
| 103 | GRALLOC_INIT_AFBC := 1 |
| 104 | endif |
| 105 | |
| 106 | ifeq ($(GRALLOC_USE_ION_DMA_HEAP), 1) |
| 107 | ifeq ($(GRALLOC_USE_ION_COMPOUND_PAGE_HEAP), 1) |
| 108 | $(error GRALLOC_USE_ION_DMA_HEAP and GRALLOC_USE_ION_COMPOUND_PAGE_HEAP can't be enabled at the same time) |
| 109 | endif |
| 110 | endif |
| 111 | |
| 112 | LOCAL_C_INCLUDES := $(MALI_LOCAL_PATH) $(MALI_DDK_INCLUDES) |
| 113 | |
| 114 | # General compilation flags |
| 115 | LOCAL_CFLAGS := -Werror -DLOG_TAG=\"gralloc\" -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) |
| 116 | |
| 117 | # Static hw flags |
| 118 | LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_BASIC=$(MALI_GPU_SUPPORT_AFBC_BASIC) |
| 119 | LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_SPLITBLK=$(MALI_GPU_SUPPORT_AFBC_SPLITBLK) |
| 120 | LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_WIDEBLK=$(MALI_GPU_SUPPORT_AFBC_WIDEBLK) |
| 121 | LOCAL_CFLAGS += -DMALI_GPU_USE_YUV_AFBC_WIDEBLK=$(MALI_GPU_USE_YUV_AFBC_WIDEBLK) |
| 122 | LOCAL_CFLAGS += -DMALI_GPU_SUPPORT_AFBC_TILED_HEADERS=$(MALI_GPU_SUPPORT_AFBC_TILED_HEADERS) |
| 123 | |
| 124 | LOCAL_CFLAGS += -DMALI_DISPLAY_VERSION=$(MALI_DISPLAY_VERSION) |
| 125 | LOCAL_CFLAGS += -DMALI_VIDEO_VERSION=$(MALI_VIDEO_VERSION) |
| 126 | |
| 127 | # Software behaviour flags |
| 128 | LOCAL_CFLAGS += -DGRALLOC_DISP_W=$(GRALLOC_DISP_W) |
| 129 | LOCAL_CFLAGS += -DGRALLOC_DISP_H=$(GRALLOC_DISP_H) |
| 130 | LOCAL_CFLAGS += -DDISABLE_FRAMEBUFFER_HAL=$(GRALLOC_DISABLE_FRAMEBUFFER_HAL) |
| 131 | LOCAL_CFLAGS += -DGRALLOC_USE_ION_DMA_HEAP=$(GRALLOC_USE_ION_DMA_HEAP) |
| 132 | LOCAL_CFLAGS += -DGRALLOC_USE_ION_COMPOUND_PAGE_HEAP=$(GRALLOC_USE_ION_COMPOUND_PAGE_HEAP) |
| 133 | LOCAL_CFLAGS += -DGRALLOC_INIT_AFBC=$(GRALLOC_INIT_AFBC) |
| 134 | LOCAL_CFLAGS += -D$(GRALLOC_DEPTH) |
| 135 | LOCAL_CFLAGS += -DGRALLOC_FB_SWAP_RED_BLUE=$(GRALLOC_FB_SWAP_RED_BLUE) |
| 136 | LOCAL_CFLAGS += -DGRALLOC_ARM_NO_EXTERNAL_AFBC=$(GRALLOC_ARM_NO_EXTERNAL_AFBC) |
| 137 | |
| 138 | LOCAL_SHARED_LIBRARIES := libhardware liblog libcutils libGLESv1_CM libion |
| 139 | |
| 140 | LOCAL_PRELINK_MODULE := false |
| 141 | LOCAL_MODULE_RELATIVE_PATH := hw |
| 142 | LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib |
| 143 | LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 |
| 144 | ifeq ($(TARGET_BOARD_PLATFORM),) |
| 145 | LOCAL_MODULE := gralloc.default |
| 146 | else |
| 147 | LOCAL_MODULE := gralloc.$(TARGET_BOARD_PLATFORM) |
| 148 | endif |
| 149 | |
| 150 | LOCAL_MODULE_TAGS := optional |
| 151 | LOCAL_MULTILIB := both |
| 152 | |
| 153 | LOCAL_SRC_FILES := \ |
| 154 | gralloc_module.cpp \ |
| 155 | alloc_device.cpp \ |
| 156 | alloc_ion.cpp \ |
| 157 | gralloc_module_ion.cpp \ |
| 158 | framebuffer_device.cpp \ |
| 159 | gralloc_buffer_priv.cpp \ |
| 160 | gralloc_vsync_${GRALLOC_VSYNC_BACKEND}.cpp \ |
| 161 | mali_gralloc_formats.cpp |
| 162 | |
| 163 | LOCAL_MODULE_OWNER := arm |
| 164 | |
| 165 | include $(BUILD_SHARED_LIBRARY) |