iris: fix decoding and undo testing code
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 3 May 2018 05:01:10 +0000 (22:01 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Feb 2019 18:26:06 +0000 (10:26 -0800)
src/gallium/drivers/iris/iris_batch.c

index e3e38b2c27d042f85f69f7ef70307633bd999ac5..a1fbd3e31833c800709b48dbdbf2d716774ec9c6 100644 (file)
@@ -321,6 +321,9 @@ iris_batch_emit(struct iris_batch *batch, const void *data, unsigned size)
 static void
 iris_finish_batch(struct iris_batch *batch)
 {
+   if (batch->bo == batch->exec_bos[0])
+      batch->primary_batch_size = batch_bytes_used(batch);
+
    // XXX: ISP DIS
 
    /* Emit MI_BATCH_BUFFER_END to finish our batch.  Note that execbuf2
@@ -357,8 +360,7 @@ submit_batch(struct iris_batch *batch, int in_fence_fd, int *out_fence_fd)
       .buffers_ptr = (uintptr_t) batch->validation_list,
       .buffer_count = batch->exec_count,
       .batch_start_offset = 0,
-      .batch_len = batch->bo == batch->exec_bos[0] ? batch_bytes_used(batch)
-                                                   : batch->primary_batch_size,
+      .batch_len = batch->primary_batch_size,
       .flags = batch->ring |
                I915_EXEC_NO_RELOC |
                I915_EXEC_BATCH_FIRST |