r300g: Fix up a bunch of warnings.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sun, 18 Oct 2009 22:54:39 +0000 (15:54 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sun, 18 Oct 2009 23:09:01 +0000 (16:09 -0700)
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_emit.h
src/gallium/drivers/r300/r300_flush.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_state.c
src/gallium/drivers/r300/r300_state_derived.c

index e6092cda9bf75906a521294e95975625ffc202e2..df2046bd0c3e865ff84fd4e7ce350304279e6e4d 100644 (file)
@@ -320,8 +320,7 @@ void r300_emit_fb_state(struct r300_context* r300,
     END_CS;
 }
 
-void r300_emit_query_start(struct r300_context *r300)
-
+static void r300_emit_query_start(struct r300_context *r300)
 {
     struct r300_capabilities *caps = r300_screen(r300->context.screen)->caps;
     struct r300_query *query = r300->query_current;
@@ -334,9 +333,9 @@ void r300_emit_query_start(struct r300_context *r300)
      * for overlapping queries. */
     BEGIN_CS(4);
     if (caps->family == CHIP_FAMILY_RV530) {
-       OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_ALL);
+        OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_ALL);
     } else {
-       OUT_CS_REG(R300_SU_REG_DEST, R300_RASTER_PIPE_SELECT_ALL);
+        OUT_CS_REG(R300_SU_REG_DEST, R300_RASTER_PIPE_SELECT_ALL);
     }
     OUT_CS_REG(R300_ZB_ZPASS_DATA, 0);
     END_CS;
@@ -345,7 +344,7 @@ void r300_emit_query_start(struct r300_context *r300)
 
 
 static void r300_emit_query_finish(struct r300_context *r300,
-                                  struct r300_query *query)
+                                   struct r300_query *query)
 {
     struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps;
     CS_LOCALS(r300);
@@ -388,7 +387,7 @@ static void r300_emit_query_finish(struct r300_context *r300,
             OUT_CS_REG_SEQ(R300_ZB_ZPASS_ADDR, 1);
             OUT_CS_RELOC(r300->oqbo, query->offset + (sizeof(uint32_t) * 0),
                     0, RADEON_GEM_DOMAIN_GTT, 0);
-           break;
+            break;
         default:
             debug_printf("r300: Implementation error: Chipset reports %d"
                     " pixel pipes!\n", caps->num_frag_pipes);
@@ -398,11 +397,10 @@ static void r300_emit_query_finish(struct r300_context *r300,
     /* And, finally, reset it to normal... */
     OUT_CS_REG(R300_SU_REG_DEST, 0xF);
     END_CS;
-
 }
 
 static void rv530_emit_query_single(struct r300_context *r300,
-                                   struct r300_query *query)
+                                    struct r300_query *query)
 {
     CS_LOCALS(r300);
 
@@ -415,7 +413,7 @@ static void rv530_emit_query_single(struct r300_context *r300,
 }
 
 static void rv530_emit_query_double(struct r300_context *r300,
-                                   struct r300_query *query)
+                                    struct r300_query *query)
 {
     CS_LOCALS(r300);
 
@@ -442,10 +440,10 @@ void r300_emit_query_end(struct r300_context* r300)
         return;
 
     if (caps->family == CHIP_FAMILY_RV530) {
-       if (caps->num_z_pipes == 2)
-           rv530_emit_query_double(r300, query);
-       else
-           rv530_emit_query_single(r300, query);
+        if (caps->num_z_pipes == 2)
+            rv530_emit_query_double(r300, query);
+        else
+            rv530_emit_query_single(r300, query);
     } else 
         r300_emit_query_finish(r300, query);
 }
index b62aa9fec50c929b13baeb2d5aaa5efbac71f68b..7e469ea0c773f32c486141c4cfabff8f2a98a265 100644 (file)
@@ -58,6 +58,7 @@ void r300_emit_fb_state(struct r300_context* r300,
 
 void r300_emit_query_begin(struct r300_context* r300,
                            struct r300_query* query);
+
 void r300_emit_query_end(struct r300_context* r300);
 
 void r300_emit_rs_state(struct r300_context* r300, struct r300_rs_state* rs);
index 241ea71d6b19de0d2cf9930bc2390eb222813381..d60652a02190400236f7948381a0b2a9e5392fb7 100644 (file)
@@ -20,7 +20,9 @@
  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  * USE OR OTHER DEALINGS IN THE SOFTWARE. */
 
+#include "r300_emit.h"
 #include "r300_flush.h"
+#include "r300_state_invariant.h"
 
 static void r300_flush(struct pipe_context* pipe,
                        unsigned flags,
index 44770d1acaa3c1e4d671d5c5ea92d5b630b9c81a..cc499d400a477a383494aa699575d9723c360626 100644 (file)
@@ -311,7 +311,7 @@ r300_get_tex_transfer(struct pipe_screen *screen,
 {
     struct r300_texture *tex = (struct r300_texture *)texture;
     struct r300_transfer *trans;
-    unsigned offset;  /* in bytes */
+    unsigned offset = 0;  /* in bytes */
 
     /* XXX Add support for these things */
     if (texture->target == PIPE_TEXTURE_CUBE) {
index 8359850966b5194835cc1224464f6157b9789a0c..0a982a9d5db372faea856d5d61cbbbb021ebed91 100644 (file)
@@ -329,7 +329,7 @@ static void r300_delete_fs_state(struct pipe_context* pipe, void* shader)
 {
     struct r300_fragment_shader* fs = (struct r300_fragment_shader*)shader;
     rc_constants_destroy(&fs->code.constants);
-    FREE(fs->state.tokens);
+    FREE((void*)fs->state.tokens);
     FREE(shader);
 }
 
@@ -697,7 +697,7 @@ static void r300_delete_vs_state(struct pipe_context* pipe, void* shader)
 
         rc_constants_destroy(&vs->code.constants);
         draw_delete_vertex_shader(r300->draw, vs->draw);
-        FREE(vs->state.tokens);
+        FREE((void*)vs->state.tokens);
         FREE(shader);
     } else {
         draw_delete_vertex_shader(r300->draw,
index 2c624766bb91f32a79635000f030b12089bb7fe3..1468b9d36ed857cff30bc998486e3779fdf8f016 100644 (file)
@@ -265,7 +265,9 @@ static void r300_vertex_psc(struct r300_context* r300,
     }
 
     /* Set the last vector in the PSC. */
-    i--;
+    if (i) {
+        i -= 1;
+    }
     vformat->vap_prog_stream_cntl[i >> 1] |=
         (R300_LAST_VEC << (i & 1 ? 16 : 0));
 }
@@ -336,17 +338,14 @@ static void r300_update_fs_tab(struct r300_context* r300,
  * the rasterization of vertices into fragments. This is also the part of the
  * chipset that locks up if any part of it is even slightly wrong. */
 static void r300_update_rs_block(struct r300_context* r300,
-                                 struct r300_vertex_format* vformat,
                                  struct r300_rs_block* rs)
 {
     struct tgsi_shader_info* info = &r300->fs->info;
-    int* tab = vformat->fs_tab;
     int col_count = 0, fp_offset = 0, i, tex_count = 0;
     int rs_tex_comp = 0;
 
     if (r300_screen(r300->context.screen)->caps->is_r500) {
         for (i = 0; i < info->num_inputs; i++) {
-            assert(tab[i] != -1);
             switch (info->input_semantic_name[i]) {
                 case TGSI_SEMANTIC_COLOR:
                     rs->ip[col_count] |=
@@ -387,7 +386,6 @@ static void r300_update_rs_block(struct r300_context* r300,
         }
     } else {
         for (i = 0; i < info->num_inputs; i++) {
-            assert(tab[i] != -1);
             switch (info->input_semantic_name[i]) {
                 case TGSI_SEMANTIC_COLOR:
                     rs->ip[col_count] |=
@@ -480,7 +478,7 @@ static void r300_update_derived_shader_state(struct r300_context* r300)
         r300_vertex_psc(r300, vformat);
         r300_update_fs_tab(r300, vformat);
 
-        r300_update_rs_block(r300, vformat, rs_block);
+        r300_update_rs_block(r300, rs_block);
 
         value->vformat = vformat;
         value->rs_block = rs_block;