swapchain: add query for MaxBufferCount
The current vkCreateSwapchainKHR use the hard coded maxImageCount from
GetPhysicalDeviceSurfaceCapabilitiesKHR, which results in possible
conflicts with the maxBufferCount set by BufferQueueConsumer. Thus add
a query to grab the consumer set maxBufferCount into maxImageCount of
surface capability.
Test: adb shell setprop debug.hwui.renderer skiavk
Test: open Play store search and click on apps
Bug: b/71894146
Change-Id: Iba75d977b13a849b62e6c4f259f7ca519ac26db8
diff --git a/libs/gui/BufferQueueProducer.cpp b/libs/gui/BufferQueueProducer.cpp
index 1e8d94c..c8021e4 100644
--- a/libs/gui/BufferQueueProducer.cpp
+++ b/libs/gui/BufferQueueProducer.cpp
@@ -1121,6 +1121,9 @@
case NATIVE_WINDOW_CONSUMER_IS_PROTECTED:
value = static_cast<int32_t>(mCore->mConsumerIsProtected);
break;
+ case NATIVE_WINDOW_MAX_BUFFER_COUNT:
+ value = static_cast<int32_t>(mCore->mMaxBufferCount);
+ break;
default:
return BAD_VALUE;
}