Reset saved state for disasm when we've lost the context.
authorEric Anholt <eric@anholt.net>
Thu, 21 Jun 2007 19:57:15 +0000 (12:57 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 21 Jun 2007 19:57:15 +0000 (12:57 -0700)
src/mesa/drivers/dri/i915tex/i915_disasm.c
src/mesa/drivers/dri/i915tex/i915_disasm.h
src/mesa/drivers/dri/i915tex/intel_context.c

index ebb634654fbd8018ef83c542397bc7567d6d70f5..6ac34a148044d08a90504d8320b27571386210b1 100644 (file)
@@ -731,3 +731,10 @@ i915_disasm(uint32_t *data, int count, uint32_t hw_offset)
 
     return failures;
 }
+
+void i915_disasm_context_reset()
+{
+    saved_s2_set = 0;
+    saved_s4_set = 1;
+}
+
index c74b0360683bb96941534c0dc7db0d1a7f902d01..5eb620f9a4ea9a419b8c1b69a89c9b791f390eee 100644 (file)
@@ -26,3 +26,4 @@
  */
 
 int i915_disasm(uint32_t *data, int count, uint32_t hw_offset);
+void i915_disasm_context_reset();
index 696845a7fc989653134703c15133193b76177236..9d3f94683011f9754839a9f1a292f74112fb4aef 100644 (file)
@@ -59,6 +59,7 @@
 #include "intel_regions.h"
 #include "intel_buffer_objects.h"
 #include "intel_fbo.h"
+#include "i915_disasm.h"
 
 #include "drirenderbuffer.h"
 #include "vblank.h"
@@ -646,6 +647,8 @@ intelContendedLock(struct intel_context *intel, GLuint flags)
    if (!intel->intelScreen->ttm && sarea->texAge != intel->hHWContext) {
       sarea->texAge = intel->hHWContext;
       dri_bufmgr_fake_contended_lock_take(intel->intelScreen->bufmgr);
+      if (INTEL_DEBUG & DEBUG_BATCH)
+        i915_disasm_context_reset();
    }
 
    if (sarea->width != intelScreen->width ||