summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2019-01-12 00:56:52 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-01-12 00:56:52 +0000
commit65047e1ab2899cd2b349345a248a4550202e92a3 (patch)
treea6c1b92b32a9423e07099d7e4f8e598514972a53
parent13933bcc0cbad99a6cd4aa87bc37a69b1b8998f0 (diff)
parentf206b66d770b2221384431cd5fd221266b891461 (diff)
Merge "Mark refreshPending as false when calling the fakeVsync"
-rw-r--r--services/surfaceflinger/BufferLayer.h4
-rw-r--r--services/surfaceflinger/BufferQueueLayer.cpp13
-rw-r--r--services/surfaceflinger/BufferQueueLayer.h2
3 files changed, 13 insertions, 6 deletions
diff --git a/services/surfaceflinger/BufferLayer.h b/services/surfaceflinger/BufferLayer.h
index 6eda20de20..e3b7f2f71e 100644
--- a/services/surfaceflinger/BufferLayer.h
+++ b/services/surfaceflinger/BufferLayer.h
@@ -167,6 +167,8 @@ protected:
// from GLES
const uint32_t mTextureName;
+ bool mRefreshPending{false};
+
private:
// Returns true if this layer requires filtering
bool needsFiltering() const;
@@ -184,8 +186,6 @@ private:
// The texture used to draw the layer in GLES composition mode
mutable renderengine::Texture mTexture;
- bool mRefreshPending{false};
-
Rect getBufferSize(const State& s) const override;
};
diff --git a/services/surfaceflinger/BufferQueueLayer.cpp b/services/surfaceflinger/BufferQueueLayer.cpp
index 5a6112258e..42021d118f 100644
--- a/services/surfaceflinger/BufferQueueLayer.cpp
+++ b/services/surfaceflinger/BufferQueueLayer.cpp
@@ -352,6 +352,14 @@ void BufferQueueLayer::setHwcLayerBuffer(DisplayId displayId) {
// Interface implementation for BufferLayerConsumer::ContentsChangedListener
// -----------------------------------------------------------------------
+void BufferQueueLayer::fakeVsync() {
+ mRefreshPending = false;
+ bool ignored = false;
+ latchBuffer(ignored, systemTime(), Fence::NO_FENCE);
+ usleep(16000);
+ releasePendingBuffer(systemTime());
+}
+
void BufferQueueLayer::onFrameAvailable(const BufferItem& item) {
// Add this buffer from our internal queue tracker
{ // Autolock scope
@@ -390,10 +398,7 @@ void BufferQueueLayer::onFrameAvailable(const BufferItem& item) {
// If this layer is orphaned, then we run a fake vsync pulse so that
// dequeueBuffer doesn't block indefinitely.
if (isRemovedFromCurrentState()) {
- bool ignored = false;
- latchBuffer(ignored, systemTime(), Fence::NO_FENCE);
- usleep(16000);
- releasePendingBuffer(systemTime());
+ fakeVsync();
} else {
mFlinger->signalLayerUpdate();
}
diff --git a/services/surfaceflinger/BufferQueueLayer.h b/services/surfaceflinger/BufferQueueLayer.h
index ae0b7054c0..d7c3f6ab78 100644
--- a/services/surfaceflinger/BufferQueueLayer.h
+++ b/services/surfaceflinger/BufferQueueLayer.h
@@ -137,6 +137,8 @@ private:
// thread-safe
std::atomic<int32_t> mQueuedFrames{0};
std::atomic<bool> mSidebandStreamChanged{false};
+
+ void fakeVsync();
};
} // namespace android