blast: fix 30Hz wake up issue
When playing 30Hz video, SurfaceFlinger was waking up at a rate of
60Hz. This is because hasFrameUpdate returned true after the update
was already applied. mCurrentStateModified was being cleared after
the frame was sent to HWC instead of when the buffer was latched.
By moving "mCurrentStateModified = false" to latch, the hasFrameUpdate
returns false so SurfaceFlinger doesn't schedule the extra wake up.
Test: SurfaceFlinger_test
Bug: 128520233
Change-Id: I2f18c6d03b81affb1235d6b466d665e711b1db8c
diff --git a/services/surfaceflinger/BufferStateLayer.cpp b/services/surfaceflinger/BufferStateLayer.cpp
index 1ca0b02..0fc7333 100644
--- a/services/surfaceflinger/BufferStateLayer.cpp
+++ b/services/surfaceflinger/BufferStateLayer.cpp
@@ -551,6 +551,8 @@
mFlinger->mTimeStats->setAcquireFence(layerID, getFrameNumber(), getCurrentFenceTime());
mFlinger->mTimeStats->setLatchTime(layerID, getFrameNumber(), latchTime);
+ mCurrentStateModified = false;
+
return NO_ERROR;
}
@@ -600,7 +602,6 @@
s.buffer->handle, to_string(error).c_str(), static_cast<int32_t>(error));
}
- mCurrentStateModified = false;
mFrameNumber++;
}