[PATCH libdrm v2] intel: error out on has_error in exec2

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

 



Just like we do for the original exec()

v2: move bo_gem declaration to the top of the function.

Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Emil Velikov <emil.l.velikov@xxxxxxxxx>
---
 intel/intel_bufmgr_gem.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 7303903..5287419 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -2185,10 +2185,14 @@ do_exec2(drm_intel_bo *bo, int used, drm_intel_context *ctx,
 	 unsigned int flags)
 {
 	drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *)bo->bufmgr;
+	drm_intel_bo_gem *bo_gem = (drm_intel_bo_gem *) bo;
 	struct drm_i915_gem_execbuffer2 execbuf;
 	int ret = 0;
 	int i;
 
+	if (bo_gem->has_error)
+		return -ENOMEM;
+
 	switch (flags & 0x7) {
 	default:
 		return -EINVAL;
@@ -2259,8 +2263,7 @@ skip_execution:
 		drm_intel_gem_dump_validation_list(bufmgr_gem);
 
 	for (i = 0; i < bufmgr_gem->exec_count; i++) {
-		drm_intel_bo_gem *bo_gem =
-			(drm_intel_bo_gem *) bufmgr_gem->exec_bos[i];
+		bo_gem = (drm_intel_bo_gem *) bufmgr_gem->exec_bos[i];
 
 		bo_gem->idle = false;
 
-- 
2.5.0

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux