[Mesa-dev] [PATCH 1/2] etnaviv: stop repeatedly resolving an unchanged resource into its scanout prime buffer

Lucas Stach l.stach at pengutronix.de
Wed Apr 12 14:13:36 UTC 2017


From: Philipp Zabel <p.zabel at pengutronix.de>

Before resolving a resource into its scanout prime buffer, check that
the prime resource is actually older. If it is not, the resolve is an
expensive no-op, and we better skip it.

Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
---
 src/gallium/drivers/etnaviv/etnaviv_clear_blit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
index d555884d3fe3..a089fed13cee 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_clear_blit.c
@@ -593,8 +593,11 @@ etna_flush_resource(struct pipe_context *pctx, struct pipe_resource *prsc)
 {
    struct etna_resource *rsc = etna_resource(prsc);
 
-   if (rsc->scanout)
+   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;
+   }
 }
 
 void
-- 
2.11.0



More information about the mesa-dev mailing list