Mesa (master): i915g: disable scissor in fast clear

Daniel Vetter danvet at kemper.freedesktop.org
Fri Oct 7 12:47:46 UTC 2011


Module: Mesa
Branch: master
Commit: 0a6131b15c874c076781a8dc347b4e51be15801a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a6131b15c874c076781a8dc347b4e51be15801a

Author: Daniel Vetter <daniel.vetter at ffwll.ch>
Date:   Sun Sep 25 18:02:34 2011 +0200

i915g: disable scissor in fast clear

Docs say this is obeyed.

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>

---

 src/gallium/drivers/i915/i915_clear.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_clear.c b/src/gallium/drivers/i915/i915_clear.c
index aa453bc..a0aba02 100644
--- a/src/gallium/drivers/i915/i915_clear.c
+++ b/src/gallium/drivers/i915/i915_clear.c
@@ -102,15 +102,17 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers,
    if (i915->hardware_dirty)
       i915_emit_hardware_state(i915);
 
-   if (!BEGIN_BATCH(7 + 7)) {
+   if (!BEGIN_BATCH(1 + 7 + 7)) {
       FLUSH_BATCH(NULL);
 
       i915_emit_hardware_state(i915);
       i915->vbo_flushed = 1;
 
-      assert(BEGIN_BATCH(7 + 7));
+      assert(BEGIN_BATCH(1 + 7 + 7));
    }
 
+   OUT_BATCH(_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT);
+
    OUT_BATCH(_3DSTATE_CLEAR_PARAMETERS);
    OUT_BATCH(clear_params | CLEARPARAM_CLEAR_RECT);
    /* Used for zone init prim */
@@ -130,8 +132,8 @@ i915_clear_emit(struct pipe_context *pipe, unsigned buffers,
    OUT_BATCH_F(desty);
 
    /* Flush after clear, its expected to be a costly operation.
-    * This is not required, just a heuristic
-    */
+    * This is not required, just a heuristic, but without the flush we'd need to
+    * clobber the SCISSOR_ENABLE dynamic state. */
    FLUSH_BATCH(NULL);
 
    i915->last_fired_vertices = i915->fired_vertices;




More information about the mesa-commit mailing list