summaryrefslogtreecommitdiff
path: root/gralloc/gr_utils.cpp
diff options
context:
space:
mode:
authorNaseer Ahmed <naseer@codeaurora.org>2019-01-28 19:02:40 -0500
committerGerrit - the friendly Code Review server <code-review@localhost>2019-02-11 13:45:38 -0800
commit2023cf3db72ed267bda7486727b154ac1d4c89f7 (patch)
treeac0fdf1c992c6f68998c5baa35133197d91f5254 /gralloc/gr_utils.cpp
parent771fcd2787f0cbed682f70a8d98b7aa6a246fe37 (diff)
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
Diffstat (limited to 'gralloc/gr_utils.cpp')
-rw-r--r--gralloc/gr_utils.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 3ba38c7f..eb455ff1 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2018, 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
@@ -617,7 +617,9 @@ 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) || (usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC_PI))
+ if (((usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC) ||
+ (usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC_PI) ||
+ (usage & BufferUsage::COMPOSER_CLIENT_TARGET))
&& IsUBwcSupported(format)) {
bool enable = true;
// Query GPU for UBWC only if buffer is intended to be used by GPU.
@@ -1031,6 +1033,8 @@ int 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