summaryrefslogtreecommitdiff
path: root/gralloc/gr_utils.cpp
diff options
context:
space:
mode:
authorSaurabh Dubey <sdubey@codeaurora.org>2018-06-15 16:31:23 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-07-01 22:59:03 -0700
commit52eb7a638f0ac6d2cf9fbeb7b6c0ce194c4cbaec (patch)
tree240e0f1ec5fdc19deba8c718471fb424628b8e66 /gralloc/gr_utils.cpp
parent731bc931e63df7aad56bbb7edf6192c0da9fecb7 (diff)
Gralloc: Do not use adreno for secure camera and secure display
Avoid using adreno size calculations for secure camera and secure display buffers. Change-Id: Ib61d893cbcc57b10070250a63b8fa79106de4af3 CRs-Fixed: 2262355
Diffstat (limited to 'gralloc/gr_utils.cpp')
-rw-r--r--gralloc/gr_utils.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/gralloc/gr_utils.cpp b/gralloc/gr_utils.cpp
index 282bcc2c..10bbf27a 100644
--- a/gralloc/gr_utils.cpp
+++ b/gralloc/gr_utils.cpp
@@ -998,6 +998,19 @@ void GetGpuResourceSizeAndDimensions(const BufferInfo &info, unsigned int *size,
*size = adreno_mem_info->AdrenoGetAlignedGpuBufferSize(graphics_metadata->data);
}
+bool CanUseAdrenoForSize(int buffer_type, uint64_t usage) {
+ if (buffer_type == BUFFER_TYPE_VIDEO || !GetAdrenoSizeAPIStatus()) {
+ return false;
+ }
+
+ if ((usage & BufferUsage::PROTECTED) && ((usage & BufferUsage::CAMERA_OUTPUT) ||
+ (usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY))) {
+ return false;
+ }
+
+ return true;
+}
+
bool GetAdrenoSizeAPIStatus() {
AdrenoMemInfo* adreno_mem_info = AdrenoMemInfo::GetInstance();
if (adreno_mem_info) {