[Mesa-dev] [PATCH] loader/dri3: Always use at least two back buffers

Jason Ekstrand jason at jlekstrand.net
Tue Sep 6 03:08:21 UTC 2016


On Mon, Sep 5, 2016 at 7:39 PM, Michel Dänzer <michel at daenzer.net> wrote:

> From: Michel Dänzer <michel.daenzer at amd.com>
>
> This can make a significant difference for performance with some extreme
> test cases such as vblank_mode=0 glxgears.
>
> Fixes: 1e3218bc5ba2 ("loader/dri3: Overhaul dri3_update_num_back")
> Cc: "12.0 11.2" <mesa-stable at lists.freedesktop.org>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97549
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> ---
>
> I could swear I tested vblank_mode=0 glxgears with my previous change
> and couldn't measure any difference, but I can now, so I must have
> messed up my previous testing somehow... Apologies for any inconvenience
> this caused.
>
>  src/loader/loader_dri3_helper.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_
> helper.c
> index 86ae5ae..3ce0352 100644
> --- a/src/loader/loader_dri3_helper.c
> +++ b/src/loader/loader_dri3_helper.c
> @@ -70,10 +70,8 @@ dri3_update_num_back(struct loader_dri3_drawable *draw)
>  {
>     if (draw->flipping)
>        draw->num_back = 3;
> -   else if (draw->vtable->get_swap_interval(draw) != 0)
> -      draw->num_back = 2;
>     else
> -      draw->num_back = 1;
> +      draw->num_back = 2;
>

With this change, the function is logically identical to the old function
with the async flipping case removed.  I'm still not sure why we aren't
getting a stall with 3 butters in the swapinterval=0 flipping case, but if
it doesn't have a perf impact, it must not be a problem.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

Thanks for digging into it to find the real problem. :-)

--Jason


>  }
>
>  void
> --
> 2.9.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160905/24e0b993/attachment.html>


More information about the mesa-dev mailing list