[Mesa-dev] [PATCH] etnaviv: only flush resource to self if no scanout buffer exists
Lucas Stach
l.stach at pengutronix.de
Mon Jun 26 11:30:54 UTC 2017
Am Montag, den 26.06.2017, 13:09 +0200 schrieb Christian Gmeiner:
> 2017-06-26 12:25 GMT+02:00 Lucas Stach <l.stach at pengutronix.de>:
> > Currently a resource flush may trigger a self resolve, even if a
> > scanout buffer
> > exists, but is up to date. If a scanout buffer exists we only ever
> > want to
> > flush the resource to the scanout buffer. This fixes a performance
> > regression.
> >
> > Fixes: dda956340ce9 (etnaviv: resolve tile status when flushing
> > resource)
> > Cc: mesa-stable at lists.freedesktop.org
> > Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> > ---
> > src/gallium/drivers/etnaviv/etnaviv_clear_blit.c | 9 +++++----
> > 1 file changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
> > b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
> > index e4620a3015e9..80967be3f93d 100644
> > --- a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
> > +++ b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
> > @@ -602,10 +602,11 @@ etna_flush_resource(struct pipe_context
> > *pctx, struct pipe_resource *prsc)
> > {
> > struct etna_resource *rsc = etna_resource(prsc);
> >
> > - if (rsc->scanout &&
> > - etna_resource_older(etna_resource(rsc->scanout->prime),
> > rsc)) {
> > - etna_copy_resource(pctx, rsc->scanout->prime, prsc, 0, 0);
> > - etna_resource(rsc->scanout->prime)->seqno = rsc->seqno;
> > + if (rsc->scanout) {
> > + if (etna_resource_older(etna_resource(rsc->scanout->prime),
> > rsc)) {
> > + etna_copy_resource(pctx, rsc->scanout->prime, prsc, 0,
> > 0);
> > + etna_resource(rsc->scanout->prime)->seqno = rsc->seqno;
> > + }
> > } else if (etna_resource_needs_flush(rsc)) {
> > etna_copy_resource(pctx, prsc, prsc, 0, 0);
> > rsc->flush_seqno = rsc->seqno;
>
> Maybe I am running out of coffee but I do not see the logical change
> here that
> should fix a performance regression.
>
> before:
> if (x && y) {
> do_stuff
> } else if (...) {
> ..
> }
The change is that we only ever want to enter the else if path if x ==
false. Currently we can also hit the else if path if x == true and y ==
false.
Regards,
Lucas
More information about the mesa-dev
mailing list