gralloc1: Support GPU_DATA_BUFFER and SENSOR_DIRECT_DATA

* These buffers can have any RGB format
* Should not use UBWC
* Should be uncached
* 4k aligned

CRs-Fixed: 2037674
Change-Id: I49c88b1914f8a4247137ae5b64276f0346977a71
This commit is contained in:
Naseer Ahmed
2017-04-20 16:52:40 -04:00
parent 8651417754
commit fe6342e5bc
3 changed files with 19 additions and 14 deletions

View File

@@ -454,7 +454,7 @@ int BufferManager::GetHandleFlags(int format, gralloc1_producer_usage_t prod_usa
flags |= private_handle_t::PRIV_FLAGS_DISP_CONSUMER;
}
if (!allocator_->UseUncached(prod_usage)) {
if (!allocator_->UseUncached(prod_usage, cons_usage)) {
flags |= private_handle_t::PRIV_FLAGS_CACHED;
}
@@ -499,7 +499,7 @@ int BufferManager::AllocateBuffer(const BufferDescriptor &descriptor, buffer_han
data.align = GetDataAlignment(format, prod_usage, cons_usage);
data.size = ALIGN(size, data.align);
data.handle = (uintptr_t) handle;
data.uncached = allocator_->UseUncached(prod_usage);
data.uncached = allocator_->UseUncached(prod_usage, cons_usage);
// Allocate buffer memory
err = allocator_->AllocateMem(&data, prod_usage, cons_usage);