diff options
| author | 2019-06-07 15:00:32 -0700 | |
|---|---|---|
| committer | 2019-06-10 15:49:31 -0700 | |
| commit | 12536a8fdae818ec39ae274d7da561480f4e1d61 (patch) | |
| tree | 5e7c9ccd262147ae958b09708a47f791435c1d10 /libs/gui/Surface.cpp | |
| parent | 29d4e9ce5a5b909050c593c4124220e2b9d5f6e0 (diff) | |
Cache NATIVE_WINDOW_MAX_BUFFER_COUNT in Surface
To avoid the sync binder call to BufferQueue everytime
vkGetPhysicalDeviceSurfaceCapabilitiesKHR is called, we cache the
NATIVE_WINDOW_MAX_BUFFER_COUNT at the Surface each time the client
connects.
Bug: 133187007
Test: Vulkan cts tests
Change-Id: I1942ff75ceb539c4904dc98c2e488c4d4cade31d
Diffstat (limited to 'libs/gui/Surface.cpp')
| -rw-r--r-- | libs/gui/Surface.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index e6eb327c6f..2e8a5d005b 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -96,6 +96,7 @@ Surface::Surface(const sp<IGraphicBufferProducer>& bufferProducer, bool controll mConnectedToCpu = false; mProducerControlledByApp = controlledByApp; mSwapIntervalZero = false; + mMaxBufferCount = 0; } Surface::~Surface() { @@ -961,6 +962,10 @@ int Surface::query(int what, int* value) const { *value = static_cast<int>(mDataSpace); return NO_ERROR; } + case NATIVE_WINDOW_MAX_BUFFER_COUNT: { + *value = mMaxBufferCount; + return NO_ERROR; + } } } return mGraphicBufferProducer->query(what, value); @@ -1298,6 +1303,7 @@ int Surface::connect( mDefaultWidth = output.width; mDefaultHeight = output.height; mNextFrameNumber = output.nextFrameNumber; + mMaxBufferCount = output.maxBufferCount; // Ignore transform hint if sticky transform is set or transform to display inverse flag is // set. Transform hint should be ignored if the client is expected to always submit buffers |