[Mesa-dev] [PATCH] egl/wayland: break double/tripple buffering feedback loops

Lucas Stach l.stach at pengutronix.de
Wed Jan 16 11:35:04 UTC 2019


Am Dienstag, den 15.01.2019, 10:35 -0600 schrieb Derek Foreman:
> On 1/15/19 8:02 AM, Daniel Stone wrote:
> > Hi,
> > 
> > > > On Tue, 18 Dec 2018 at 17:59, Lucas Stach <l.stach at pengutronix.de> wrote:
> > > Am Dienstag, den 18.12.2018, 17:43 +0000 schrieb Emil Velikov:
> > > > > On Tue, 18 Dec 2018 at 11:16, Lucas Stach <l.stach at pengutronix.de> wrote:
> > > > >           if (dri2_surf->back == NULL)
> > > > >              dri2_surf->back = &dri2_surf->color_buffers[i];
> > > > > -         else if (dri2_surf->back->dri_image == NULL)
> > > > > +         else if (dri2_surf->back->dri_image == NULL && dri2_surf->color_buffers[i].dri_image)
> > > > >              dri2_surf->back = &dri2_surf->color_buffers[i];
> > > > > +         age = dri2_surf->back->age;
> > > > >        }
> > > > > 
> > > > 
> > > > AFAICT this is the wayland equivalent of
> > > > 4f1d27a406478d405eac6f9894ccc46a80034adb
> > > > Where the exact same logic/commit message applies.
> > > 
> > > No it isn't. It's exactly what it says in the commit log. It's keeping
> > > the tripple buffer around for a bit, even if we don't strictly need it
> > > when the client is currently doing double buffering.
> 
> I'm having a bit of a hard time following the logic in this first hunk
> myself...
> 
> The dri2_surf->color_buffers[i].age < age check looks like it's intended
> to skip buffers younger than the one currently in hand - ie) pick the
> oldest buffer.  But doing so would break the second hunk because we'd
> never end up with a very old buffer to trim.  (It doesn't actually cause
> the oldest buffer to be picked though, because of the other tests involved)
> 
> I would like to at least see a comment explaining what's going on,
> because it looks kind of like a bug on a casual read.

The age check is really bogus and I believe I messed this up when
cleaning this up from a previous version of the patch. Thanks for
taking a close look. I'll fix this.

Regards,
Lucas



More information about the mesa-dev mailing list