summaryrefslogtreecommitdiff
path: root/intel
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2015-08-15 15:43:46 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2015-09-04 21:38:56 +0100
commit94425f627221c0f67503a9aa4dff3502725905b3 (patch)
tree0566f988561484a0870aaeb7b9c980f0fc6a1c99 /intel
parentcf7e32bdf99740ae3249f100b5cb2f0de54a20ef (diff)
downloadlibdrm-94425f627221c0f67503a9aa4dff3502725905b3.tar.gz
libdrm-94425f627221c0f67503a9aa4dff3502725905b3.tar.bz2
libdrm-94425f627221c0f67503a9aa4dff3502725905b3.zip
intel: error out on has_error in exec2
Just like we do for the original exec() v2: move bo_gem declaration to the top of the function. Cc: intel-gfx@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'intel')
-rw-r--r--intel/intel_bufmgr_gem.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 7303903b..52874192 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;