<div dir="ltr"><div class="gmail_extra"><span class="gmail-im" style="font-size:12.8px">On Wed, Aug 30, 2017 at 4:35 AM, Michel Dänzer <span dir="ltr"><<a href="mailto:michel@daenzer.net" target="_blank">michel@daenzer.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 30/08/17 12:24 AM, Roman Gilg wrote:<br>> This patch adds a new mode to the internal flip mode API, that<br>> enables per window flips on capable hardware platforms.<br>><br>> Pixmap flips are possible for every window with a parent window and<br>> without redirection.<br><br>This sentence is a bit confusing. In rootless mode, a toplevel window<br>has no parent, but may use flips, right?</blockquote><div> </div></span><div style="font-size:12.8px">The restriction to only allow a window W with a parent to flip is there, so that we can use the parent window's window pixmap on unflip to restore W's window pixmap. It was somewhat a late addition to the code because I had problems with "saving" W's original pixmap. Basically I increased the saved pixmap's refcnt when doing that, but on restore this pixmap often was already unreffed by the original creator. So I had to add a condition to only unref in Present for recnt > 1 (otherwise the pixmap would have been freed afterwards and could not act as the window pixmap after unflip).</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">To remove this condition I opted for only allowing window flips for windows with parent. In this case it's clear what to restore: The parent window's window pixmap. I did this because in my test applications (only tested with KWin though) a window requesting pixmap flips never was the toplevel window, so I assumed in this case the restriction is not limiting.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">What could be added in the future is a condition to save the original window's pixmap in the case of windows without parent and otherwise restore from the parent window's window pixmap. </div><span class="gmail-im" style="font-size:12.8px"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> Besides the per window flips the new mode diverges from the old<br>> screen flipping by holding back the PresentIdleNotify event for a<br>> flipped pixmaps of a preceding frame until present_winmode_event_notify<br>> is called once more.<br><br>As discussed before, this should be kept separate from the flip mode, as<br>it would also be useful with per-screen flips.<br><br>My suggestion was to add a PresentCapability* flag for this. If the<br>driver sets this flag, it will call present_event_notify separately when<br>the flip completes for the target CRTC and when the previous buffer can<br>be re-used.</blockquote><div><br></div></span><div style="font-size:12.8px">With the new flip mode API it is easy to add this functionality to screen flip mode later on - and share the code with the window flip mode if applicable. I just did it not yet with this patch set to leave the screen flip mode functionality completely unchanged. Instead, if wished for, this could go in a separate patch.</div></div></div>