Mesa (master): r300g: take advantage of KEEP_TILING_FLAGS flush flag
Marek Olšák
mareko at kemper.freedesktop.org
Tue Dec 13 20:35:00 UTC 2011
Module: Mesa
Branch: master
Commit: 35d2764f853fa749e36871d11fc22ced2a851702
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=35d2764f853fa749e36871d11fc22ced2a851702
Author: Marek Olšák <maraeo at gmail.com>
Date: Tue Dec 13 20:27:48 2011 +0100
r300g: take advantage of KEEP_TILING_FLAGS flush flag
This fixes at least two multi-context-related races.
---
src/gallium/drivers/r300/r300_flush.c | 4 ++++
src/gallium/drivers/r300/r300_state.c | 8 ++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c
index 8b710c1..9459a95 100644
--- a/src/gallium/drivers/r300/r300_flush.c
+++ b/src/gallium/drivers/r300/r300_flush.c
@@ -72,6 +72,10 @@ void r300_flush(struct pipe_context *pipe,
if (r300->draw && !r300->draw_vbo_locked)
r300_draw_flush_vbuf(r300);
+ if (r300->screen->info.drm_minor >= 12) {
+ flags |= RADEON_FLUSH_KEEP_TILING_FLAGS;
+ }
+
if (rfence) {
/* Create a fence, which is a dummy BO. */
*rfence = r300->rws->buffer_create(r300->rws, 1, 1,
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index b0aae53..d704057 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -872,8 +872,12 @@ r300_set_framebuffer_state(struct pipe_context* pipe,
r300_mark_atom_dirty(r300, &r300->dsa_state);
}
- /* The tiling flags are dependent on the surface miplevel, unfortunately. */
- r300_fb_set_tiling_flags(r300, state);
+ if (r300->screen->info.drm_minor < 12) {
+ /* The tiling flags are dependent on the surface miplevel, unfortunately.
+ * This workarounds a bad design decision in old kernels which were
+ * rewriting tile fields in registers. */
+ r300_fb_set_tiling_flags(r300, state);
+ }
util_copy_framebuffer_state(r300->fb_state.state, state);
More information about the mesa-commit
mailing list