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

Emil Velikov emil.l.velikov at gmail.com
Mon Aug 31 11:14:12 PDT 2015


Just like we do for the original exec()

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

Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: intel-gfx at lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 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



More information about the dri-devel mailing list