<p dir="ltr"></p>
<p dir="ltr">On Sep 5, 2016 8:43 PM, "Michel Dänzer" <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>> wrote:<br>
><br>
> On 06/09/16 12:08 PM, Jason Ekstrand wrote:<br>
> > On Mon, Sep 5, 2016 at 7:39 PM, Michel Dänzer <<a href="mailto:michel@daenzer.net">michel@daenzer.net</a><br>
> > <mailto:<a href="mailto:michel@daenzer.net">michel@daenzer.net</a>>> wrote:<br>
> ><br>
> > From: Michel Dänzer <<a href="mailto:michel.daenzer@amd.com">michel.daenzer@amd.com</a><br>
> > <mailto:<a href="mailto:michel.daenzer@amd.com">michel.daenzer@amd.com</a>>><br>
> ><br>
> > This can make a significant difference for performance with some extreme<br>
> > test cases such as vblank_mode=0 glxgears.<br>
> ><br>
> > Fixes: 1e3218bc5ba2 ("loader/dri3: Overhaul dri3_update_num_back")<br>
> > Cc: "12.0 11.2" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a><br>
> > <mailto:<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.freedesktop.org</a>>><br>
> > Bugzilla: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=97549">https://bugs.freedesktop.org/show_bug.cgi?id=97549</a><br>
> > <<a href="https://bugs.freedesktop.org/show_bug.cgi?id=97549">https://bugs.freedesktop.org/show_bug.cgi?id=97549</a>><br>
> > Signed-off-by: Michel Dänzer <<a href="mailto:michel.daenzer@amd.com">michel.daenzer@amd.com</a><br>
> > <mailto:<a href="mailto:michel.daenzer@amd.com">michel.daenzer@amd.com</a>>><br>
> > ---<br>
> ><br>
> > I could swear I tested vblank_mode=0 glxgears with my previous change<br>
> > and couldn't measure any difference, but I can now, so I must have<br>
> > messed up my previous testing somehow... Apologies for any inconvenience<br>
> > this caused.<br>
> ><br>
> > src/loader/loader_dri3_helper.c | 4 +---<br>
> > 1 file changed, 1 insertion(+), 3 deletions(-)<br>
> ><br>
> > diff --git a/src/loader/loader_dri3_helper.c<br>
> > b/src/loader/loader_dri3_helper.c<br>
> > index 86ae5ae..3ce0352 100644<br>
> > --- a/src/loader/loader_dri3_helper.c<br>
> > +++ b/src/loader/loader_dri3_helper.c<br>
> > @@ -70,10 +70,8 @@ dri3_update_num_back(struct loader_dri3_drawable<br>
> > *draw)<br>
> > {<br>
> > if (draw->flipping)<br>
> > draw->num_back = 3;<br>
> > - else if (draw->vtable->get_swap_interval(draw) != 0)<br>
> > - draw->num_back = 2;<br>
> > else<br>
> > - draw->num_back = 1;<br>
> > + draw->num_back = 2;<br>
> ><br>
> ><br>
> > With this change, the function is logically identical to the old<br>
> > function with the async flipping case removed.<br>
><br>
> Not sure what you mean exactly, but I hope we can agree that the code is<br>
> easier to understand and reason about now. :)</p>
<p dir="ltr">I mean that you original patch made two functional changes: One was to drop quadbuffering and the second was to single-buffer in the swapinterval==0 case. This effectively reverts the second functional change while leaving the first intact.</p>
<p dir="ltr">Yes, it's much easier to read now. One could argue that the "counting buffers" approach of the original code had it's merits, but it is much easier to look at the new code and see what it will do in any particular case.</p>
<p dir="ltr">> > I'm still not sure why we aren't getting a stall with 3 butters in the<br>
> > swapinterval=0 flipping case, but if it doesn't have a perf impact, it must<br>
> > not be a problem.<br>
><br>
> Right, there is a stall, but it doesn't seem significant, at least on my<br>
> setup.<br>
><br>
><br>
> > Reviewed-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a><br>
> > <mailto:<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>>><br>
><br>
> Thanks!<br>
><br>
><br>
> --<br>
> Earthling Michel Dänzer | <a href="http://www.amd.com">http://www.amd.com</a><br>
> Libre software enthusiast | Mesa and X developer<br></p>