From ef9374cb20606aac529bc3fd56794c34fb1ee747 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Thu, 16 Jul 2020 12:56:10 -0700 Subject: [PATCH] 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 --- .../functional/VtsHalCameraProviderV2_4TargetTest.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index f235235ab7..b0aae8e04d 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -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,