diff options
Diffstat (limited to 'gralloc/gr_utils.cpp')
-rw-r--r-- | gralloc/gr_utils.cpp | 19 |
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; } |