Mesa (master): r300-gallium: Various cleanups leftover from before.

Corbin Simpson csimpson at kemper.freedesktop.org
Sat May 16 17:08:10 UTC 2009


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

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Sat May 16 08:47:36 2009 -0700

r300-gallium: Various cleanups leftover from before.

BEGIN/END_CS pair, a few asserts, and a slightly more correct VTE setup.

---

 src/gallium/drivers/r300/r300_emit.c    |    6 ++++--
 src/gallium/drivers/r300/r300_state.c   |    2 +-
 src/gallium/drivers/r300/r300_surface.c |    3 +++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index cd5c38a..3beb1b8 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -163,6 +163,7 @@ void r300_emit_fb_state(struct r300_context* r300,
     BEGIN_CS((8 * fb->nr_cbufs) + (fb->zsbuf ? 8 : 0) + 4);
     for (i = 0; i < fb->nr_cbufs; i++) {
         tex = (struct r300_texture*)fb->cbufs[i]->texture;
+        assert(tex && tex->buffer && "cbuf is marked, but NULL!");
         pixpitch = tex->stride / tex->tex.block.size;
 
         OUT_CS_REG_SEQ(R300_RB3D_COLOROFFSET0 + (4 * i), 1);
@@ -177,7 +178,8 @@ void r300_emit_fb_state(struct r300_context* r300,
 
     if (fb->zsbuf) {
         tex = (struct r300_texture*)fb->zsbuf->texture;
-        pixpitch = (tex->stride / tex->tex.block.size);
+        assert(tex && tex->buffer && "zsbuf is marked, but NULL!");
+        pixpitch = tex->stride / tex->tex.block.size;
 
         OUT_CS_REG_SEQ(R300_ZB_DEPTHOFFSET, 1);
         OUT_CS_RELOC(tex->buffer, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0);
@@ -473,7 +475,7 @@ void r300_emit_dirty_state(struct r300_context* r300)
     /* ...textures... */
     for (i = 0; i < r300->texture_count; i++) {
         tex = r300->textures[i];
-        assert(tex && tex->buffer && "zsbuf is marked, but NULL!");
+        assert(tex && tex->buffer && "texture is marked, but NULL!");
         r300->winsys->add_buffer(r300->winsys, tex->buffer,
                 RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM, 0);
     }
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 2118f77..49b93a4 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -562,7 +562,7 @@ static void r300_set_viewport_state(struct pipe_context* pipe,
 
     if (r300_screen(r300->context.screen)->caps->has_tcl) {
         /* Do the transform in HW. */
-        r300->viewport_state->vte_control = R300_VTX_W0_FMT;
+        r300->viewport_state->vte_control = R300_VTX_XY_FMT | R300_VTX_Z_FMT;
 
         if (state->scale[0] != 1.0f) {
             assert(state->scale[0] != 0.0f);
diff --git a/src/gallium/drivers/r300/r300_surface.c b/src/gallium/drivers/r300/r300_surface.c
index 00eb4eb..17b4250 100644
--- a/src/gallium/drivers/r300/r300_surface.c
+++ b/src/gallium/drivers/r300/r300_surface.c
@@ -264,6 +264,7 @@ static void r300_surface_copy(struct pipe_context* pipe,
         r300_emit_rs_block_state(r300, &r300_rs_block_copy_state);
     }
 
+    BEGIN_CS(28);
     /* VAP stream control, mapping from input memory to PVS/RS memory */
     if (caps->has_tcl) {
         OUT_CS_REG(R300_VAP_PROG_STREAM_CNTL_0,
@@ -313,6 +314,8 @@ static void r300_surface_copy(struct pipe_context* pipe,
 
     OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, 0xA);
 
+    END_CS;
+
     r300->dirty_hw++;
 }
 




More information about the mesa-commit mailing list