Mesa (master): r300-gallium: Fix hardlocks on trivial/clear.

Corbin Simpson csimpson at kemper.freedesktop.org
Sat Feb 28 21:28:24 UTC 2009


Module: Mesa
Branch: master
Commit: ba5f1848291e9b34e99aa54cc2c257c85c17728c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ba5f1848291e9b34e99aa54cc2c257c85c17728c

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Sat Feb 28 13:27:28 2009 -0800

r300-gallium: Fix hardlocks on trivial/clear.

I'm so happy I could cry.

---

 src/gallium/drivers/r300/r300_state_inlines.h |   21 +++++++++++++++++++++
 src/gallium/drivers/r300/r300_surface.c       |    3 ++-
 2 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h
index e125405..630ac3b 100644
--- a/src/gallium/drivers/r300/r300_state_inlines.h
+++ b/src/gallium/drivers/r300/r300_state_inlines.h
@@ -323,4 +323,25 @@ static INLINE uint32_t r300_translate_zsformat(enum pipe_format format)
     return 0;
 }
 
+/* Non-CSO state. (For now.) */
+
+static INLINE uint32_t r300_translate_gb_pipes(int pipe_count)
+{
+    switch (pipe_count) {
+        case 1:
+            return R300_GB_TILE_PIPE_COUNT_RV300;
+            break;
+        case 2:
+            return R300_GB_TILE_PIPE_COUNT_R300;
+            break;
+        case 3:
+            return R300_GB_TILE_PIPE_COUNT_R420_3P;
+            break;
+        case 4:
+            return R300_GB_TILE_PIPE_COUNT_R420;
+            break;
+    }
+    return 0;
+}
+
 #endif /* R300_STATE_INLINES_H */
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
index 4380bf4..48f6dfc 100644
--- a/src/gallium/drivers/r300/r300_surface.c
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -97,7 +97,8 @@ static void r300_surface_fill(struct pipe_context* pipe,
     OUT_CS_REG(R300_GB_MSPOS0, 0x66666666);
     OUT_CS_REG(R300_GB_MSPOS1, 0x66666666);
     /* XXX why doesn't classic Mesa write the number of pipes, too? */
-    OUT_CS_REG(R300_GB_TILE_CONFIG, R300_GB_TILE_ENABLE |
+    OUT_CS_REG(R300_GB_TILE_CONFIG, R300_GB_TILE_DISABLE |
+        r300_translate_gb_pipes(caps->num_frag_pipes) |
         R300_GB_TILE_SIZE_16);
     OUT_CS_REG(R300_GB_SELECT, R300_GB_FOG_SELECT_1_1_W);
     OUT_CS_REG(R300_GB_AA_CONFIG, 0x0);




More information about the mesa-commit mailing list