intel: Upload batchbuffer contents even if INTEL_NO_HW is set.
authorEric Anholt <eric@anholt.net>
Wed, 31 Aug 2011 00:36:57 +0000 (17:36 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 2 Sep 2011 19:17:05 +0000 (12:17 -0700)
It is useful for debugging to dump batchbuffers while not actually
executing them.

src/mesa/drivers/dri/intel/intel_batchbuffer.c

index db4343be10c08ffce7b7c436b011a74e1d177f9b..21dd27ce1326c3ec17f79394ccccc251746812f2 100644 (file)
@@ -105,6 +105,14 @@ do_flush_locked(struct intel_context *intel)
    struct intel_batchbuffer *batch = &intel->batch;
    int ret = 0;
 
+   ret = drm_intel_bo_subdata(batch->bo, 0, 4*batch->used, batch->map);
+   if (ret == 0 && batch->state_batch_offset != batch->bo->size) {
+      ret = drm_intel_bo_subdata(batch->bo,
+                                batch->state_batch_offset,
+                                batch->bo->size - batch->state_batch_offset,
+                                (char *)batch->map + batch->state_batch_offset);
+   }
+
    if (!intel->intelScreen->no_hw) {
       int ring;
 
@@ -114,14 +122,6 @@ do_flush_locked(struct intel_context *intel)
         ring = I915_EXEC_BLT;
       }
 
-      ret = drm_intel_bo_subdata(batch->bo, 0, 4*batch->used, batch->map);
-      if (ret == 0 && batch->state_batch_offset != batch->bo->size) {
-        ret = drm_intel_bo_subdata(batch->bo,
-                                   batch->state_batch_offset,
-                                   batch->bo->size - batch->state_batch_offset,
-                                   (char *)batch->map + batch->state_batch_offset);
-      }
-
       if (ret == 0)
         ret = drm_intel_bo_mrb_exec(batch->bo, 4*batch->used, NULL, 0, 0, ring);
    }