[PATCH i-g-t] lib: Show the actual error from submitting the rendercopy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
---
 lib/gpu_cmds.c        | 13 ++++++-------
 lib/rendercopy_gen4.c | 13 ++++++-------
 lib/rendercopy_gen6.c | 13 ++++++-------
 lib/rendercopy_gen7.c | 13 ++++++-------
 lib/rendercopy_gen8.c | 13 ++++++-------
 lib/rendercopy_gen9.c | 13 ++++++-------
 6 files changed, 36 insertions(+), 42 deletions(-)

diff --git a/lib/gpu_cmds.c b/lib/gpu_cmds.c
index 79412725a..dc0ae96c6 100644
--- a/lib/gpu_cmds.c
+++ b/lib/gpu_cmds.c
@@ -39,13 +39,12 @@ gen7_render_flush(struct intel_batchbuffer *batch, uint32_t batch_end)
 void
 gen7_render_context_flush(struct intel_batchbuffer *batch, uint32_t batch_end)
 {
-	int ret;
-
-	ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
-	if (ret == 0)
-		ret = drm_intel_gem_bo_context_exec(batch->bo, batch->ctx,
-				batch_end, 0);
-	igt_assert(ret == 0);
+	igt_assert_eq(drm_intel_bo_subdata(batch->bo,
+					   0, 4096, batch->buffer),
+		      0);
+	igt_assert_eq(drm_intel_gem_bo_context_exec(batch->bo, batch->ctx,
+						    batch_end, 0),
+		      0);
 }
 
 uint32_t
diff --git a/lib/rendercopy_gen4.c b/lib/rendercopy_gen4.c
index d07b8e488..413e33578 100644
--- a/lib/rendercopy_gen4.c
+++ b/lib/rendercopy_gen4.c
@@ -124,13 +124,12 @@ static void
 gen4_render_flush(struct intel_batchbuffer *batch,
 		  drm_intel_context *context, uint32_t batch_end)
 {
-	int ret;
-
-	ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
-	if (ret == 0)
-		ret = drm_intel_gem_bo_context_exec(batch->bo, context,
-						    batch_end, 0);
-	assert(ret == 0);
+	igt_assert_eq(drm_intel_bo_subdata(batch->bo,
+					   0, 4096, batch->buffer),
+		      0);
+	igt_assert_eq(drm_intel_gem_bo_context_exec(batch->bo, context,
+						    batch_end, 0),
+		      0);
 }
 
 static uint32_t
diff --git a/lib/rendercopy_gen6.c b/lib/rendercopy_gen6.c
index 870347748..16cbb679b 100644
--- a/lib/rendercopy_gen6.c
+++ b/lib/rendercopy_gen6.c
@@ -62,13 +62,12 @@ static void
 gen6_render_flush(struct intel_batchbuffer *batch,
 		  drm_intel_context *context, uint32_t batch_end)
 {
-	int ret;
-
-	ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
-	if (ret == 0)
-		ret = drm_intel_gem_bo_context_exec(batch->bo, context,
-						    batch_end, 0);
-	igt_assert(ret == 0);
+	igt_assert_eq(drm_intel_bo_subdata(batch->bo,
+					   0, 4096, batch->buffer),
+		      0);
+	igt_assert_eq(drm_intel_gem_bo_context_exec(batch->bo,
+						    context, batch_end, 0),
+		      0);
 }
 
 static uint32_t
diff --git a/lib/rendercopy_gen7.c b/lib/rendercopy_gen7.c
index b88b75e98..93b4da720 100644
--- a/lib/rendercopy_gen7.c
+++ b/lib/rendercopy_gen7.c
@@ -36,13 +36,12 @@ static void
 gen7_render_flush(struct intel_batchbuffer *batch,
 		  drm_intel_context *context, uint32_t batch_end)
 {
-	int ret;
-
-	ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
-	if (ret == 0)
-		ret = drm_intel_gem_bo_context_exec(batch->bo, context,
-						    batch_end, 0);
-	igt_assert(ret == 0);
+	igt_assert_eq(drm_intel_bo_subdata(batch->bo,
+					   0, 4096, batch->buffer),
+		      0);
+	igt_assert_eq(drm_intel_gem_bo_context_exec(batch->bo, context,
+						    batch_end, 0),
+		      0);
 }
 
 static uint32_t
diff --git a/lib/rendercopy_gen8.c b/lib/rendercopy_gen8.c
index bace64a7a..75005d0b9 100644
--- a/lib/rendercopy_gen8.c
+++ b/lib/rendercopy_gen8.c
@@ -132,13 +132,12 @@ static void
 gen6_render_flush(struct intel_batchbuffer *batch,
 		  drm_intel_context *context, uint32_t batch_end)
 {
-	int ret;
-
-	ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
-	if (ret == 0)
-		ret = drm_intel_gem_bo_context_exec(batch->bo, context,
-						    batch_end, 0);
-	igt_assert(ret == 0);
+	igt_assert_eq(drm_intel_bo_subdata(batch->bo,
+					   0, 4096, batch->buffer),
+		      0);
+	igt_assert_eq(drm_intel_gem_bo_context_exec(batch->bo, context,
+						    batch_end, 0),
+		      0);
 }
 
 /* Mostly copy+paste from gen6, except height, width, pitch moved */
diff --git a/lib/rendercopy_gen9.c b/lib/rendercopy_gen9.c
index f364c2b9e..85ae4cabc 100644
--- a/lib/rendercopy_gen9.c
+++ b/lib/rendercopy_gen9.c
@@ -182,13 +182,12 @@ static void
 gen6_render_flush(struct intel_batchbuffer *batch,
 		  drm_intel_context *context, uint32_t batch_end)
 {
-	int ret;
-
-	ret = drm_intel_bo_subdata(batch->bo, 0, 4096, batch->buffer);
-	if (ret == 0)
-		ret = drm_intel_gem_bo_context_exec(batch->bo, context,
-						    batch_end, 0);
-	assert(ret == 0);
+	igt_assert_eq(drm_intel_bo_subdata(batch->bo,
+					   0, 4096, batch->buffer),
+		      0);
+	igt_assert_eq(drm_intel_gem_bo_context_exec(batch->bo,
+						    context, batch_end, 0),
+		      0);
 }
 
 /* Mostly copy+paste from gen6, except height, width, pitch moved */
-- 
2.26.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux