Commit 62cbd6d1 authored by Lucas Stach's avatar Lucas Stach Committed by Andres Gomez

etnaviv: only flush resource to self if no scanout buffer exists

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: dda95634 (etnaviv: resolve tile status when flushing resource)
Signed-off-by: Lucas Stach's avatarLucas Stach <>
Reviewed-by: Philipp Zabel's avatarPhilipp Zabel <>
Reviewed-by: Christian Gmeiner's avatarChristian Gmeiner <>
(cherry picked from commit 28550c78)
parent 84f75699
...@@ -603,10 +603,11 @@ etna_flush_resource(struct pipe_context *pctx, struct pipe_resource *prsc) ...@@ -603,10 +603,11 @@ etna_flush_resource(struct pipe_context *pctx, struct pipe_resource *prsc)
{ {
struct etna_resource *rsc = etna_resource(prsc); struct etna_resource *rsc = etna_resource(prsc);
if (rsc->scanout && if (rsc->scanout) {
etna_resource_older(etna_resource(rsc->scanout->prime), rsc)) { if (etna_resource_older(etna_resource(rsc->scanout->prime), rsc)) {
etna_copy_resource(pctx, rsc->scanout->prime, prsc, 0, 0); etna_copy_resource(pctx, rsc->scanout->prime, prsc, 0, 0);
etna_resource(rsc->scanout->prime)->seqno = rsc->seqno; etna_resource(rsc->scanout->prime)->seqno = rsc->seqno;
} else if (etna_resource_needs_flush(rsc)) { } else if (etna_resource_needs_flush(rsc)) {
etna_copy_resource(pctx, prsc, prsc, 0, 0); etna_copy_resource(pctx, prsc, prsc, 0, 0);
rsc->flush_seqno = rsc->seqno; rsc->flush_seqno = rsc->seqno;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment