r300: Various flags, small state tracking things.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Tue, 20 Jan 2009 05:03:24 +0000 (21:03 -0800)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Mon, 2 Feb 2009 07:30:23 +0000 (23:30 -0800)
Getting these out of the way so more stuff can be put in.

src/gallium/drivers/r300/r300_context.c
src/gallium/drivers/r300/r300_context.h
src/gallium/drivers/r300/r300_emit.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r300/r300_state.c

index b072179f5be8ab011b4672f13870c7fda7403038..798d6bdc6f5c0ecfef7e679f4eaf37b87b35c791 100644 (file)
@@ -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;
 }
index ad1e4fc7c493fb2e96687af578363729bbda52eb..be6214b7ae6c07497f54619932d49570031d86c3 100644 (file)
@@ -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. */
index 8662830ee27cc4496277a478acc2719f7c22d039..3c59a270b357eeb217696aefe1ea0bb07e41ddc8 100644 (file)
@@ -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);
index 5074e3e6fa473c7e4b685c91889a15dd8353d47f..5c1bab386f7a94a3590ed921ceef2f032f1b54c6 100644 (file)
@@ -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) {
index cff4b30d16db93005ec04af5c799da77021cc2d8..d73f4483dbefda3f2f3f715107a69be890022244 100644 (file)
@@ -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;
 }