summaryrefslogtreecommitdiff
path: root/gralloc/gr_utils.cpp
diff options
context:
space:
mode:
authorSaurabh Dubey <sdubey@codeaurora.org>2018-06-27 09:41:31 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-07-01 23:00:20 -0700
commit81aef9332bf35e2a88ca1284b3764343499fb1a4 (patch)
tree1f90c23202cfaa1c3bd0f2fd77f4a95f56d9fea6 /gralloc/gr_utils.cpp
parentefd7f9e29d4801d1d9bde521f58f0a2a2fec5ee3 (diff)
Gralloc: Move GRALLOC_USAGE_PRIVATE_ALLOC_UBWC_PI to lower 32 bits
1) Move GRALLOC_USAGE_PRIVATE_ALLOC_UBWC_PI to bit 30. Custom formats like HAL_PIXEL_FORMAT_YCbCr_420_P010_VENUS and HAL_PIXEL_FORMAT_YCbCr_420_TP10_UBWC can now be used directly without needing gralloc flags to be set therby freeing bit 27 and bit 30. 2) Add PRIV_FLAGS_SECURE_BUFFER and PRIV_FLAGS_USES_ION to GetCustomFormatFlags API. Change-Id: Iee14af2f1a3774ef9922aa380c204ca5ebf60147 CRs-Fixed: 2255171
Diffstat (limited to 'gralloc/gr_utils.cpp')
-rw-r--r--gralloc/gr_utils.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 7c480dc1..d91da928 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -1116,18 +1116,7 @@ int GetImplDefinedFormat(uint64_t usage, int format) {
if (format == HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED ||
format == HAL_PIXEL_FORMAT_YCbCr_420_888) {
if (usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC || usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC_PI) {
- // Use of 10BIT_TP and 10BIT bits is supposed to be mutually exclusive.
- // Each bit maps to only one format. Here we will check one of the bits
- // and ignore the other.
- if (usage & GRALLOC_USAGE_PRIVATE_10BIT_TP) {
- gr_format = HAL_PIXEL_FORMAT_YCbCr_420_TP10_UBWC;
- } else if (usage & GRALLOC_USAGE_PRIVATE_10BIT) {
- gr_format = HAL_PIXEL_FORMAT_YCbCr_420_P010_UBWC;
- } else {
- gr_format = HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC;
- }
- } else if (usage & GRALLOC_USAGE_PRIVATE_10BIT) {
- gr_format = HAL_PIXEL_FORMAT_YCbCr_420_P010_VENUS;
+ gr_format = HAL_PIXEL_FORMAT_YCbCr_420_SP_VENUS_UBWC;
} else if (usage & BufferUsage::VIDEO_ENCODER) {
if (usage & GRALLOC_USAGE_PRIVATE_VIDEO_NV21_ENCODER) {
gr_format = HAL_PIXEL_FORMAT_NV21_ENCODEABLE; // NV21
@@ -1165,6 +1154,12 @@ int GetCustomFormatFlags(int format, uint64_t usage,
*custom_format = GetImplDefinedFormat(usage, format);
*priv_flags = GetHandleFlags(*custom_format, usage);
+ if (usage & GRALLOC_USAGE_PROTECTED) {
+ *priv_flags |= private_handle_t::PRIV_FLAGS_SECURE_BUFFER;
+ }
+
+ *priv_flags |= private_handle_t::PRIV_FLAGS_USES_ION;
+
return 0;
}