summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/r300/r300_emit.c24
-rw-r--r--src/gallium/drivers/r300/r300_emit.h1
-rw-r--r--src/gallium/drivers/r300/r300_flush.c2
-rw-r--r--src/gallium/drivers/r300/r300_screen.c2
-rw-r--r--src/gallium/drivers/r300/r300_state.c4
-rw-r--r--src/gallium/drivers/r300/r300_state_derived.c10
6 files changed, 21 insertions, 22 deletions
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index e6092cda9bf..df2046bd0c3 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -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);
}
diff --git a/src/gallium/drivers/r300/r300_emit.h b/src/gallium/drivers/r300/r300_emit.h
index b62aa9fec50..7e469ea0c77 100644
--- a/src/gallium/drivers/r300/r300_emit.h
+++ b/src/gallium/drivers/r300/r300_emit.h
@@ -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);
diff --git a/src/gallium/drivers/r300/r300_flush.c b/src/gallium/drivers/r300/r300_flush.c
index 241ea71d6b1..d60652a0219 100644
--- a/src/gallium/drivers/r300/r300_flush.c
+++ b/src/gallium/drivers/r300/r300_flush.c
@@ -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,
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 44770d1acaa..cc499d400a4 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -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) {
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 8359850966b..0a982a9d5db 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -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,
diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index 2c624766bb9..1468b9d36ed 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -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;