summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEino-Ville Talvala2017-03-29 14:06:36 -0500
committerEino-Ville Talvala2017-03-29 14:08:55 -0500
commit944e5e0c5276e9149180c316a7d30ad7ef44a284 (patch)
tree02bda6966bbb1d4b279b5a28a663c2ccb5c0448d /libgrallocusage
parentdf937b8255d86d97c97fd8d9ca7ea5352e2d8975 (diff)
downloadplatform-system-core-944e5e0c5276e9149180c316a7d30ad7ef44a284.tar.gz
platform-system-core-944e5e0c5276e9149180c316a7d30ad7ef44a284.tar.xz
platform-system-core-944e5e0c5276e9149180c316a7d30ad7ef44a284.zip
Include vendor gralloc0 flags in gralloc1 conversion.
Map GRALLOC_USAGE_PRIVATE_* fields into bits 28-31 of both producer and consumer usage for gralloc1. Test: Camera output works as normal, CTS not regressed Bug: 35215313 Change-Id: I0736e0f513b193373b822830dbb0efe3f4263770
Diffstat (limited to 'libgrallocusage')
-rw-r--r--libgrallocusage/GrallocUsageConversion.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libgrallocusage/GrallocUsageConversion.cpp b/libgrallocusage/GrallocUsageConversion.cpp
index 8164beb80..10e728d52 100644
--- a/libgrallocusage/GrallocUsageConversion.cpp
+++ b/libgrallocusage/GrallocUsageConversion.cpp
@@ -30,13 +30,17 @@ void android_convertGralloc0To1Usage(int32_t usage, uint64_t* producerUsage,
30 /* ProducerUsage::CPU_WRITE_OFTEN | */ 30 /* ProducerUsage::CPU_WRITE_OFTEN | */
31 ProducerUsage::GPU_RENDER_TARGET | ProducerUsage::PROTECTED | 31 ProducerUsage::GPU_RENDER_TARGET | ProducerUsage::PROTECTED |
32 ProducerUsage::CAMERA | ProducerUsage::VIDEO_DECODER | 32 ProducerUsage::CAMERA | ProducerUsage::VIDEO_DECODER |
33 ProducerUsage::SENSOR_DIRECT_DATA; 33 ProducerUsage::SENSOR_DIRECT_DATA |
34 /* Private flags may be consumer or producer */
35 GRALLOC_USAGE_PRIVATE_MASK;
34 constexpr uint64_t CONSUMER_MASK = ConsumerUsage::CPU_READ | 36 constexpr uint64_t CONSUMER_MASK = ConsumerUsage::CPU_READ |
35 /* ConsumerUsage::CPU_READ_OFTEN | */ 37 /* ConsumerUsage::CPU_READ_OFTEN | */
36 ConsumerUsage::GPU_TEXTURE | ConsumerUsage::HWCOMPOSER | 38 ConsumerUsage::GPU_TEXTURE | ConsumerUsage::HWCOMPOSER |
37 ConsumerUsage::CLIENT_TARGET | ConsumerUsage::CURSOR | 39 ConsumerUsage::CLIENT_TARGET | ConsumerUsage::CURSOR |
38 ConsumerUsage::VIDEO_ENCODER | ConsumerUsage::CAMERA | 40 ConsumerUsage::VIDEO_ENCODER | ConsumerUsage::CAMERA |
39 ConsumerUsage::RENDERSCRIPT | ConsumerUsage::GPU_DATA_BUFFER; 41 ConsumerUsage::RENDERSCRIPT | ConsumerUsage::GPU_DATA_BUFFER |
42 /* Private flags may be consumer or producer */
43 GRALLOC_USAGE_PRIVATE_MASK;
40 *producerUsage = static_cast<uint64_t>(usage) & PRODUCER_MASK; 44 *producerUsage = static_cast<uint64_t>(usage) & PRODUCER_MASK;
41 *consumerUsage = static_cast<uint64_t>(usage) & CONSUMER_MASK; 45 *consumerUsage = static_cast<uint64_t>(usage) & CONSUMER_MASK;
42 if ((static_cast<uint32_t>(usage) & GRALLOC_USAGE_SW_READ_OFTEN) == GRALLOC_USAGE_SW_READ_OFTEN) { 46 if ((static_cast<uint32_t>(usage) & GRALLOC_USAGE_SW_READ_OFTEN) == GRALLOC_USAGE_SW_READ_OFTEN) {