Mir

Code review comment for lp:~vanvugt/mir/async-page-flips

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> The solution is to wait for the page flips in parallel to rendering the next frame

Unless I am missing something, this is not safe. After we schedule a page flip we can't start rendering to the buffer that is currently visible before the page flip is complete. It's important to note that when we flip a buffer, the buffer itself becomes the display framebuffer (i.e. where the display hardware reads from for the whole duration of the frame), its contents are not copied to some other internal framebuffer. Here is a sample run with the proposed changes:

(Front,Back): which buffer is front/back from gbm's point of view

== Initial setup ==

make_current: (A,B) current rendering target is B
draw/clear: (A,B) clearing B
swap: (B,A)
set_crtc: (B,A) B is immediately visible on screen

== First iter ==

make_current: (B,A) current rendering target is A
draw: (B,A) drawing to A
wait_for_page_flip: (B,A) nothing to wait for
swap: (A,B)
schedule_page_flip: (A,B) scheduling for A to become visible on screen

== Second iter ==

make_current: (A,B) current rendering target is B
*** draw: (A,B) drawing to B => there is no guarantee that the page flip has happened, so B may still be visible on screen!

Disapproving, although I do hope I am missing something and thus proved wrong.

review: Disapprove

« Back to merge proposal