r300-gallium, radeon: A couple cleanups.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Fri, 8 May 2009 23:50:42 +0000 (16:50 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 9 May 2009 02:41:08 +0000 (19:41 -0700)
Trying to track down goddamn bugs. :C

src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r300/r300_texture.c
src/gallium/winsys/drm/radeon/core/radeon_r300.c

index 6bdf544a05c4d3c7ad36fd3fb5bcd9b30e871058..a4e89c37d1aa3623f085862221feaa2c65838e72 100644 (file)
@@ -34,10 +34,6 @@ static boolean r300_draw_range_elements(struct pipe_context* pipe,
     struct r300_context* r300 = r300_context(pipe);
     int i;
 
-    if (r300->dirty_state) {
-        r300_emit_dirty_state(r300);
-    }
-
     for (i = 0; i < r300->vertex_buffer_count; i++) {
         void* buf = pipe_buffer_map(pipe->screen,
                                     r300->vertex_buffers[i].buffer,
index 184a23c9e6878628e9a2efc0ab7cb35def037420..0143e228c4ec94b44c181875ac3b9db7ac074346 100644 (file)
@@ -562,14 +562,17 @@ static void r300_set_viewport_state(struct pipe_context* pipe,
         r300->viewport_state->vte_control = R300_VTX_W0_FMT;
 
         if (state->scale[0] != 1.0f) {
+            assert(state->scale[0] != 0.0f);
             r300->viewport_state->xscale = state->scale[0];
             r300->viewport_state->vte_control |= R300_VPORT_X_SCALE_ENA;
         }
         if (state->scale[1] != 1.0f) {
+            assert(state->scale[1] != 0.0f);
             r300->viewport_state->yscale = state->scale[1];
             r300->viewport_state->vte_control |= R300_VPORT_Y_SCALE_ENA;
         }
         if (state->scale[2] != 1.0f) {
+            assert(state->scale[2] != 0.0f);
             r300->viewport_state->zscale = state->scale[2];
             r300->viewport_state->vte_control |= R300_VPORT_Z_SCALE_ENA;
         }
index fe91f4e18449399d96b79ed25e5af75ce4675b93..6c9d3b741277b2f8f72e5e79a93376c013757822 100644 (file)
@@ -187,6 +187,7 @@ static struct pipe_texture*
             tex->stride);
 
     pipe_buffer_reference(&tex->buffer, buffer);
+    debug_printf("%p is the buffer\n", tex->buffer);
 
     return (struct pipe_texture*)tex;
 }
index da233203d7d8526183fd549f5741e389767dc99c..5dcce20cd5dc5bf2faba60b5a69e102c6a229fa1 100644 (file)
@@ -62,6 +62,7 @@ static boolean radeon_r300_validate(struct r300_winsys* winsys)
     if (retval == RADEON_CS_SPACE_OP_TO_BIG) {
         /* We might as well HCF, since this is not going to fit in the card,
          * period. */
+        /* XXX just drop it on the floor instead */
        exit(1);
     } else if (retval == RADEON_CS_SPACE_FLUSH) {
         /* We must flush before more rendering can commence. */
@@ -128,14 +129,19 @@ static void radeon_r300_flush_cs(struct r300_winsys* winsys)
 {
     struct radeon_winsys_priv* priv =
         (struct radeon_winsys_priv*)winsys->radeon_winsys;
-    int retval = 0;
+    struct radeon_cs_space_check* sc = priv->sc;
+    int retval = 1;
 
+    /* Emit the CS. */
     retval = radeon_cs_emit(priv->cs);
     if (retval) {
         debug_printf("radeon: Bad CS, dumping...\n");
         radeon_cs_print(priv->cs, stderr);
     }
     radeon_cs_erase(priv->cs);
+
+    /* Clean out BOs. */
+    memset(sc, 0, sizeof(struct radeon_cs_space_check) * RADEON_MAX_BOS);
 }
 
 /* Helper function to do the ioctls needed for setup and init. */