summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/r300/r300_context.c3
-rw-r--r--src/gallium/drivers/r300/r300_context.h3
-rw-r--r--src/gallium/drivers/r300/r300_emit.c5
-rw-r--r--src/gallium/drivers/r300/r300_screen.c1
-rw-r--r--src/gallium/drivers/r300/r300_state.c4
5 files changed, 15 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index b072179f5be..798d6bdc6f5 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -56,5 +56,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
r300_init_state_functions(r300);
+ r300->dirty_state = R300_NEW_KITCHEN_SINK;
+ r300->dirty_hw++;
+
return &r300->context;
}
diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h
index ad1e4fc7c49..be6214b7ae6 100644
--- a/src/gallium/drivers/r300/r300_context.h
+++ b/src/gallium/drivers/r300/r300_context.h
@@ -55,6 +55,7 @@ struct r300_dsa_state {
};
struct r300_rs_state {
+ uint32_t vap_control_status; /* R300_VAP_CNTL_STATUS: 0x2140 */
uint32_t depth_scale_front; /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */
uint32_t depth_offset_front; /* R300_SU_POLY_OFFSET_FRONT_OFFSET: 0x42a8 */
uint32_t depth_scale_back; /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */
@@ -98,6 +99,8 @@ struct r300_context {
/* Bitmask of dirty state objects. */
uint32_t dirty_state;
+ /* Flag indicating whether or not the HW is dirty. */
+ uint32_t dirty_hw;
};
/* Convenience cast wrapper. */
diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c
index 8662830ee27..3c59a270b35 100644
--- a/src/gallium/drivers/r300/r300_emit.c
+++ b/src/gallium/drivers/r300/r300_emit.c
@@ -31,6 +31,10 @@ static void r300_emit_dirty_state(struct r300_context* r300)
struct r300_screen* r300screen = (struct r300_screen*)r300->context.screen;
CS_LOCALS(r300);
+ if (!(r300->dirty_state) && !(r300->dirty_hw)) {
+ return;
+ }
+
/* XXX check size */
if (r300->dirty_state & R300_NEW_BLEND) {
@@ -72,6 +76,7 @@ static void r300_emit_dirty_state(struct r300_context* r300)
if (r300->dirty_state & R300_NEW_RS) {
struct r300_rs_state* rs = r300->rs_state;
+ OUT_CS_REG(R300_VAP_CNTL_STATUS, rs->vap_control_status);
/* XXX next six are contiguous regs */
OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_SCALE, rs->depth_scale_front);
OUT_CS_REG(R300_SU_POLY_OFFSET_FRONT_OFFSET, rs->depth_offset_front);
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 5074e3e6fa4..5c1bab386f7 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -123,7 +123,6 @@ static void* r300_surface_map(struct pipe_screen* screen,
struct pipe_surface* surface,
unsigned flags)
{
- /* XXX this is not quite right */
char* map = pipe_buffer_map(screen, surface->buffer, flags);
if (!map) {
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index cff4b30d16d..d73f4483dbe 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -434,6 +434,10 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
pack_float_32(state->offset_scale);
}
+ /* XXX this is part of HW TCL */
+ /* XXX endian control */
+ rs->vap_control_status = R300_VAP_TCL_BYPASS;
+
return (void*)rs;
}