etnaviv: stop repeatedly resolving an unchanged resource into its scanout prime buffer
authorPhilipp Zabel <p.zabel@pengutronix.de>
Wed, 12 Apr 2017 14:13:36 +0000 (16:13 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Fri, 14 Apr 2017 22:15:27 +0000 (00:15 +0200)
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@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_clear_blit.c

index d555884d3fe3ef8cafe92641a7efa75eadde8018..a089fed13cee2a39e72f600b9061f615c4c9c52c 100644 (file)
@@ -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