diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2018-11-13 06:04:04 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-11-13 06:04:04 +0000 |
commit | 26c492aad74f69b712307db0e62321fb2e62892f (patch) | |
tree | 6e32c089baa65840d9f4a9071439ed2a5a03547e /gralloc | |
parent | 1c1e57eb933b8dab2831cf7cbc7e21a2ecd8a5c4 (diff) | |
parent | f04c4c02559224c7d6e2e15b10e8b1de3d1e77f8 (diff) | |
download | display-26c492aad74f69b712307db0e62321fb2e62892f.tar.gz |
Merge "Allow GRALLOC_USAGE_HW_FB as usage hint for UBWC."
Diffstat (limited to 'gralloc')
-rw-r--r-- | gralloc/gr_utils.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp index 48d8bb53..c2371575 100644 --- a/gralloc/gr_utils.cpp +++ b/gralloc/gr_utils.cpp @@ -558,10 +558,12 @@ bool IsUBwcEnabled(int format, uint64_t 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 ((usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC) && IsUBwcSupported(format)) { - bool enable = true; + if (IsUBwcSupported(format)) { + bool enable = + (usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC) | (usage & BufferUsage::COMPOSER_CLIENT_TARGET); // Query GPU for UBWC only if buffer is intended to be used by GPU. - if ((usage & BufferUsage::GPU_TEXTURE) || (usage & BufferUsage::GPU_RENDER_TARGET)) { + if (enable && + ((usage & BufferUsage::GPU_TEXTURE) || (usage & BufferUsage::GPU_RENDER_TARGET))) { if (AdrenoMemInfo::GetInstance()) { enable = AdrenoMemInfo::GetInstance()->IsUBWCSupportedByGPU(format); } @@ -969,6 +971,8 @@ void GetGpuResourceSizeAndDimensions(const BufferInfo &info, unsigned int *size, int is_ubwc_enabled = IsUBwcEnabled(info.format, info.usage); if (!is_ubwc_enabled) { adreno_usage &= ~(GRALLOC_USAGE_PRIVATE_ALLOC_UBWC); + } else { + adreno_usage |= GRALLOC_USAGE_PRIVATE_ALLOC_UBWC; } // Call adreno api for populating metadata blob |