Mir

Code review comment for lp:~cemil-azizoglu/mir/improve-raii

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

BTW, bypass is weird. And I think kdub's overlay logic requires the same approach.

To avoid tearing the compositor has to briefly hold both (at least 2) of the client's buffers so as to retain the guarantee for the scan-out hardware that whatever is on-screen is not touched by the client till something else is definitely on screen.

// buffer B is on screen
acquire buffer A
scan out buffer A
release buffer B (to the client)
wait for vblank // allows client almost 16ms to render new B
acquire buffer B
scan out buffer B
release buffer A (to the client)
wait for vblank // allows client almost 16ms to render new A
acquire buffer A
scan out buffer A
release buffer B

That's for normal bypass/overlays. If you use "-n" then framedropping mode forces the BufferQueue to have at least 3 buffers {A,B,C}. So the screen can't ever be starved of the newest frame by an unthrottled client (that issue applies to all compositing, not just bypass). But we always guarantee that and that's not the (radeon) bug you're seeing.

« Back to merge proposal