Camera HAL Vts : Fix usage flag combination during gralloc allocation.

Earlier, for processCaptureRequestInternal, we took into account
producer and consumer usage flags returned by configureSingleStream.
Instead we should be taking into account the producer flag returned by
configureSingleStream and the consumer flag passed into
processCaptureRequestInternal (for output streams).

Bug: 162344072

Test: Use secure camera as secure only camera and run vts
Test: Run camera vts
Test: Vendor testing

Change-Id: I9fbd4db4cff48c25684f097907e7ba995c3edf41
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
This commit is contained in:
Jayant Chowdhary 2020-07-16 12:56:10 -07:00
parent 0857d7caa0
commit ef9374cb20

View file

@ -4453,9 +4453,12 @@ void CameraHidlTest::processCaptureRequestInternal(uint64_t bufferUsage,
nullptr};
} else {
allocateGraphicBuffer(testStream.width, testStream.height,
android_convertGralloc1To0Usage(halStreamConfig.streams[0].producerUsage,
halStreamConfig.streams[0].consumerUsage),
halStreamConfig.streams[0].overrideFormat, &buffer_handle);
/* We don't look at halStreamConfig.streams[0].consumerUsage
* since that is 0 for output streams
*/
android_convertGralloc1To0Usage(
halStreamConfig.streams[0].producerUsage, bufferUsage),
halStreamConfig.streams[0].overrideFormat, &buffer_handle);
outputBuffer = {halStreamConfig.streams[0].id,
bufferId,
buffer_handle,