From patchwork Mon Aug 31 18:14:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Velikov X-Patchwork-Id: 7100771 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A08A2BEEC1 for ; Mon, 31 Aug 2015 18:09:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD9D920697 for ; Mon, 31 Aug 2015 18:09:58 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0880120695 for ; Mon, 31 Aug 2015 18:09:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 550106E445; Mon, 31 Aug 2015 11:09:57 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id DE0D16E445; Mon, 31 Aug 2015 11:09:55 -0700 (PDT) Received: by wibz8 with SMTP id z8so8291138wib.1; Mon, 31 Aug 2015 11:09:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xY1DprZuHeeoRseAyp6mPrqdY9fY/iVvnBZxSUbwOkk=; b=FkAuwR0PKJHqwBk8R58cerEfhe89lWAUYviMJRwlLKtqj9GSJPxPWxGyEBW//0FCbs 7CEj87C0nKWmp77y12X//ZZ0NpX7yK1Q4Lx9UQVqsqiwx670Xs9blAoD4VGxTmZRdgV0 ks6Esy4DXEz+DFFPHqqrxH5uy+v+uGS/COWqpCRKe1c8oxAGjQeu+tYUzclts4iA3RB5 iFXZIrEXnief89/NA7PDmntMXLo30wHPMHjkld+4WBGIBjh/taJ5PCGMYEkGOkrAmPL6 JF+lhpBrf66ypfeNPHhOK/IOaySltGOpPSw8ZgVRpJQG/y4ter+8otgUfIuEKC6g+vFx Tl1g== X-Received: by 10.180.80.138 with SMTP id r10mr20711220wix.18.1441044594207; Mon, 31 Aug 2015 11:09:54 -0700 (PDT) Received: from arch-x220.localdomain (cpc12-croy20-2-0-cust52.croy.cable.virginm.net. [82.44.54.53]) by smtp.gmail.com with ESMTPSA id uc12sm10137350wib.13.2015.08.31.11.09.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Aug 2015 11:09:53 -0700 (PDT) From: Emil Velikov To: dri-devel@lists.freedesktop.org Date: Mon, 31 Aug 2015 19:14:12 +0100 Message-Id: <1441044852-14089-1-git-send-email-emil.l.velikov@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1440434060-31347-4-git-send-email-emil.l.velikov@gmail.com> References: <1440434060-31347-4-git-send-email-emil.l.velikov@gmail.com> Cc: intel-gfx@lists.freedesktop.org, emil.l.velikov@gmail.com Subject: [Intel-gfx] [PATCH libdrm v2] intel: error out on has_error in exec2 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just like we do for the original exec() v2: move bo_gem declaration to the top of the function. Cc: Chris Wilson Cc: intel-gfx@lists.freedesktop.org Signed-off-by: Emil Velikov --- 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;