summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno/freedreno_draw.h
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2013-12-23 09:59:42 -0500
committerRob Clark <robclark@freedesktop.org>2013-12-26 12:13:42 -0500
commit8ab47b435319c05521bdfced6da6ce72850a2dd7 (patch)
tree41ad842a87397da59e7e7dbb756a2e75d57e8ee9 /src/gallium/drivers/freedreno/freedreno_draw.h
parentbe01d7a905d827c3c0c222cab2430c6d4575429a (diff)
downloadexternal_mesa3d-8ab47b435319c05521bdfced6da6ce72850a2dd7.zip
external_mesa3d-8ab47b435319c05521bdfced6da6ce72850a2dd7.tar.gz
external_mesa3d-8ab47b435319c05521bdfced6da6ce72850a2dd7.tar.bz2
freedreno/a3xx: fix blend state corruption issue
Using RMW on banked context registers is not safe. The value read could be the wrong one. So if there has been a DRAW_IDX launched, the RMW must be preceded by a WAIT_FOR_IDLE to ensure the read part of RMW sees the correct value. To avoid unnecessary WFI's, keep track if there is a need for WFI, and only emit one if needed. Furthermore, keep track if we even need to update the register in the first place. And to cut down on the amount of RMW to avoid excessive WFI's, at the tiling/GMEM level we can always overwrite RB_RENDER_CONTROL, as the state at beginning of draw/clear cmds (which we IB to) is always undefined. In the draw/clear commands, we always still use RMW (with WFI if needed), but only if the register value actually changes. (At points where the current value cannot be known, the saved value is reset to ~0, which includes bits outside of RBRC_DRAW_STATE, so there never is chance for confusion.) Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_draw.h')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_draw.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_draw.h b/src/gallium/drivers/freedreno/freedreno_draw.h
index 9ccc246..190c0e5 100644
--- a/src/gallium/drivers/freedreno/freedreno_draw.h
+++ b/src/gallium/drivers/freedreno/freedreno_draw.h
@@ -85,6 +85,8 @@ fd_draw(struct fd_context *ctx, enum pc_di_primtype primtype,
}
emit_marker(ring, 7);
+
+ ctx->rmw.need_wfi = true;
}
#endif /* FREEDRENO_DRAW_H_ */