i915g: streamline derived state updates of the driver pipeline
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 5 Mar 2011 23:30:12 +0000 (00:30 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 10 Mar 2011 21:47:48 +0000 (22:47 +0100)
Flushing the batch/hw backend doesn't invalidate the derived state.
So kill the unnecessary function calls and add an assert in
emit_hardware_state for paranoia.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
src/gallium/drivers/i915/i915_prim_emit.c
src/gallium/drivers/i915/i915_prim_vbuf.c
src/gallium/drivers/i915/i915_state_emit.c

index 276e33d4b9d6a53555f26dea5743a56a8111853a..85656cd784626ac0436ece27b20772c5bd03f038 100644 (file)
@@ -149,7 +149,6 @@ emit_prim( struct draw_stage *stage,
 
       /* Make sure state is re-emitted after a flush: 
        */
-      i915_update_derived( i915 );
       i915_emit_hardware_state( i915 );
 
       if (!BEGIN_BATCH( 1 + nr * vertex_size / 4)) {
index fb4c0516dd84b5caf62605940f115d6785985228..79db3b650ebebf600cad591bc8cc88b132feb84a 100644 (file)
@@ -470,7 +470,6 @@ draw_arrays_fallback(struct vbuf_render *render,
 
       /* Make sure state is re-emitted after a flush:
        */
-      i915_update_derived(i915);
       i915_emit_hardware_state(i915);
       i915->vbo_flushed = 1;
 
@@ -519,7 +518,6 @@ i915_vbuf_render_draw_arrays(struct vbuf_render *render,
 
       /* Make sure state is re-emitted after a flush:
        */
-      i915_update_derived(i915);
       i915_emit_hardware_state(i915);
       i915->vbo_flushed = 1;
 
@@ -640,7 +638,6 @@ i915_vbuf_render_draw_elements(struct vbuf_render *render,
 
       /* Make sure state is re-emitted after a flush: 
        */
-      i915_update_derived(i915);
       i915_emit_hardware_state(i915);
       i915->vbo_flushed = 1;
 
index 324a8a3e158cfd4161cce6c39f62135108a87356..096aa93cf09f49a2c66c77210b7fdb370eec09be 100644 (file)
@@ -405,6 +405,8 @@ i915_emit_hardware_state(struct i915_context *i915 )
    unsigned batch_space;
    uintptr_t save_ptr;
 
+   assert(i915->dirty == 0);
+
    if (I915_DBG_ON(DBG_ATOMS))
       i915_dump_hardware_dirty(i915, __FUNCTION__);