diff options
| author | Naseer Ahmed <naseer@codeaurora.org> | 2019-01-28 19:02:40 -0500 |
|---|---|---|
| committer | Baldev Sahu <bsahu@codeaurora.org> | 2019-05-28 14:08:42 +0530 |
| commit | f9a86151056d02043c2c100806a84ab5f1983b14 (patch) | |
| tree | 6538c2f500e207011ae3ce66238d28d1cfebf8d3 | |
| parent | 722c9c9e63b6872a4644b9142c2cae5cc73d1fa6 (diff) | |
| download | hardware_qcom_display-f9a86151056d02043c2c100806a84ab5f1983b14.tar.gz hardware_qcom_display-f9a86151056d02043c2c100806a84ab5f1983b14.tar.bz2 hardware_qcom_display-f9a86151056d02043c2c100806a84ab5f1983b14.zip | |
gralloc: Enable UBWC for client target by default
A recent change in the framework requires us to enable UBWC
for the client target implicitly, since the buffer does not
get tagged by EGL.
Bug: 120537504
Change-Id: I8d7c8a13f981f4c4f1dab8fa25e2dd2304ee5da0
| -rw-r--r-- | gralloc/Android.mk | 12 | ||||
| -rw-r--r-- | gralloc/gr_utils.cpp | 5 | ||||
| -rw-r--r-- | gralloc/gr_utils.h | 3 |
3 files changed, 11 insertions, 9 deletions
diff --git a/gralloc/Android.mk b/gralloc/Android.mk index 3176aee37..19cb87be9 100644 --- a/gralloc/Android.mk +++ b/gralloc/Android.mk @@ -1,18 +1,18 @@ # Gralloc module LOCAL_PATH := $(call my-dir) -include $(LOCAL_PATH)/../common.mk include $(CLEAR_VARS) +include $(LOCAL_PATH)/../common.mk LOCAL_MODULE := gralloc.$(TARGET_BOARD_PLATFORM) LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_MODULE_TAGS := optional -LOCAL_C_INCLUDES := $(common_includes) \ - external/libcxx/include/ +LOCAL_C_INCLUDES := $(common_includes) LOCAL_HEADER_LIBRARIES := display_headers -LOCAL_SHARED_LIBRARIES := $(common_libs) libqdMetaData libsync libgrallocutils -LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdgralloc\" -Wall -std=c++11 -Werror +LOCAL_SHARED_LIBRARIES := $(common_libs) libqdMetaData libsync libgrallocutils \ + android.hardware.graphics.common@1.1 +LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"qdgralloc\" -Wall -Werror LOCAL_CFLAGS += -isystem $(kernel_includes) LOCAL_CLANG := true LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps) $(kernel_deps) @@ -36,7 +36,7 @@ LOCAL_VENDOR_MODULE := true LOCAL_MODULE_TAGS := optional LOCAL_C_INCLUDES := $(common_includes) $(kernel_includes) LOCAL_HEADER_LIBRARIES := display_headers -LOCAL_SHARED_LIBRARIES := $(common_libs) libqdMetaData libdl +LOCAL_SHARED_LIBRARIES := $(common_libs) libqdMetaData libdl android.hardware.graphics.common@1.1 LOCAL_CFLAGS := $(common_flags) -DLOG_TAG=\"grallocutils\" -Wno-sign-conversion LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps) $(kernel_deps) LOCAL_SRC_FILES := gr_utils.cpp gr_adreno_info.cpp diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp index 6661589e5..36f7469db 100644 --- a/gralloc/gr_utils.cpp +++ b/gralloc/gr_utils.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -508,7 +508,8 @@ bool IsUBwcEnabled(int format, gralloc1_producer_usage_t prod_usage, // Allow UBWC, if an OpenGL client sets UBWC usage flag and GPU plus MDP // support the format. OR if a non-OpenGL client like Rotator, sets UBWC // usage flag and MDP supports the format. - if ((prod_usage & GRALLOC1_PRODUCER_USAGE_PRIVATE_ALLOC_UBWC) && IsUBwcSupported(format)) { + if (((prod_usage & GRALLOC1_PRODUCER_USAGE_PRIVATE_ALLOC_UBWC) || + (cons_usage & BufferUsage::COMPOSER_CLIENT_TARGET)) && IsUBwcSupported(format)) { bool enable = true; // Query GPU for UBWC only if buffer is intended to be used by GPU. if ((cons_usage & GRALLOC1_CONSUMER_USAGE_GPU_TEXTURE) || diff --git a/gralloc/gr_utils.h b/gralloc/gr_utils.h index 07dab73e7..e2e8248a7 100644 --- a/gralloc/gr_utils.h +++ b/gralloc/gr_utils.h @@ -30,6 +30,7 @@ #ifndef __GR_UTILS_H__ #define __GR_UTILS_H__ +#include <android/hardware/graphics/common/1.1/types.h> #include "gralloc_priv.h" #define SZ_2M 0x200000 @@ -41,7 +42,7 @@ #define INT(exp) static_cast<int>(exp) #define UINT(exp) static_cast<unsigned int>(exp) - +using android::hardware::graphics::common::V1_1::BufferUsage; namespace gralloc1 { struct BufferInfo { |
