Skip to content

Commit e757a87

Browse files
committed
we need to guarantee that h/w comp set() is called when a buffer has been retired
removed a test that could violate this guarantee. note that we have no proof tha this ever happened, but consequences could be hard lock-ups. the code here was intended to track the region to update for displays that can do partial update. the logic discarded the update entirely if that region was empty. instead we just redraw the whole thing (note that we should never be there with an empty region and retired buffers though). Bug: 5466259 Change-Id: I91ccab3b1a599e729e438eb833939e2236da6854
1 parent bd9d2bc commit e757a87

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ bool SurfaceFlinger::threadLoop()
452452
}
453453

454454
const DisplayHardware& hw(graphicPlane(0).displayHardware());
455-
if (LIKELY(hw.canDraw() && !isFrozen())) {
455+
if (LIKELY(hw.canDraw())) {
456456
// repaint the framebuffer (if needed)
457457

458458
const int index = hw.getCurrentBufferIndex();
@@ -479,15 +479,13 @@ bool SurfaceFlinger::threadLoop()
479479

480480
void SurfaceFlinger::postFramebuffer()
481481
{
482-
if (!mSwapRegion.isEmpty()) {
483-
const DisplayHardware& hw(graphicPlane(0).displayHardware());
484-
const nsecs_t now = systemTime();
485-
mDebugInSwapBuffers = now;
486-
hw.flip(mSwapRegion);
487-
mLastSwapBufferTime = systemTime() - now;
488-
mDebugInSwapBuffers = 0;
489-
mSwapRegion.clear();
490-
}
482+
const DisplayHardware& hw(graphicPlane(0).displayHardware());
483+
const nsecs_t now = systemTime();
484+
mDebugInSwapBuffers = now;
485+
hw.flip(mSwapRegion);
486+
mLastSwapBufferTime = systemTime() - now;
487+
mDebugInSwapBuffers = 0;
488+
mSwapRegion.clear();
491489
}
492490

493491
void SurfaceFlinger::handleConsoleEvents()

0 commit comments

Comments
 (0)