etnaviv: slim down resource waiting
[mesa.git] / src / gallium / drivers / etnaviv / etnaviv_transfer.c
index 4809b04ff95f0bf549f055bbb4a4c1179d5ed9c0..269bd498f89f1975a6996ff07156e85bb26f9bde 100644 (file)
@@ -199,8 +199,9 @@ etna_transfer_map(struct pipe_context *pctx, struct pipe_resource *prsc,
    /* Always sync if we have the temporary resource.  The PIPE_TRANSFER_READ
     * case could be optimised if we knew whether the resource has outstanding
     * rendering. */
-   if (usage & PIPE_TRANSFER_READ || trans->rsc)
-      etna_resource_wait(pctx, rsc);
+   if ((usage & PIPE_TRANSFER_READ || trans->rsc) &&
+       rsc->status & ETNA_PENDING_WRITE)
+      pctx->flush(pctx, NULL, 0);
 
    /* XXX we don't handle PIPE_TRANSFER_FLUSH_EXPLICIT; this flag can be ignored
     * when mapping in-place,