summaryrefslogtreecommitdiffstats
path: root/libgralloc/alloc_controller.cpp
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-02-01 14:29:37 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-02-01 14:29:37 -0800
commit09ca40a8d3babe3e653e0fe4961f42fb2ba90e45 (patch)
tree38d531143d96581c85a0526bb3c632b92cb71d22 /libgralloc/alloc_controller.cpp
parent642db195d070785d797699118c20b3858527f148 (diff)
parent81594f6d665941fd9d442273043bd9d6868e3859 (diff)
downloadandroid_hardware_qcom_display-09ca40a8d3babe3e653e0fe4961f42fb2ba90e45.tar.gz
android_hardware_qcom_display-09ca40a8d3babe3e653e0fe4961f42fb2ba90e45.tar.bz2
android_hardware_qcom_display-09ca40a8d3babe3e653e0fe4961f42fb2ba90e45.zip
Merge "gralloc: Allow UBWC for explicitly defined UBWC HAL pixel format"
Diffstat (limited to 'libgralloc/alloc_controller.cpp')
-rw-r--r--libgralloc/alloc_controller.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index 01d0798eb..fd98154c3 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -774,12 +774,15 @@ static bool isUBwcSupported(int format)
bool isUBwcEnabled(int format, int usage)
{
- if (isUBwcFormat(format) ||
- ((usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC) && isUBwcSupported(format)))
- {
- // Allow UBWC, only if GPU supports it and CPU usage flags are not set
- if (AdrenoMemInfo::getInstance().isUBWCSupportedByGPU(format) &&
- !(usage & (GRALLOC_USAGE_SW_READ_MASK |
+ // Allow UBWC, if client is using an explicitly defined UBWC pixel format.
+ if (isUBwcFormat(format))
+ return true;
+
+ // Allow UBWC, if client sets UBWC gralloc usage flag & GPU supports format.
+ if ((usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC) && isUBwcSupported(format) &&
+ AdrenoMemInfo::getInstance().isUBWCSupportedByGPU(format)) {
+ // Allow UBWC, only if CPU usage flags are not set
+ if (!(usage & (GRALLOC_USAGE_SW_READ_MASK |
GRALLOC_USAGE_SW_WRITE_MASK))) {
return true;
}