From patchwork Fri Apr 18 21:04:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 4018561 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E83EFBFF02 for ; Fri, 18 Apr 2014 21:04:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1ED0D202E6 for ; Fri, 18 Apr 2014 21:04:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D3E212038D for ; Fri, 18 Apr 2014 21:04:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 62F4A6ECFA; Fri, 18 Apr 2014 14:04:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f174.google.com (mail-pd0-f174.google.com [209.85.192.174]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F95A6ECF5 for ; Fri, 18 Apr 2014 14:04:45 -0700 (PDT) Received: by mail-pd0-f174.google.com with SMTP id y13so1761444pdi.19 for ; Fri, 18 Apr 2014 14:04:45 -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=PW8EvJ0lT1Q3hqctVGG1wWn5PBxlnoUWqSVcRKX39bk=; b=ypFFlJ7ysq1jrlAwueS9Xkef9AgajptIMpUCHromO6NkJZA55R10eu2Z1U69jmGZTF tgufvDtZbYVm6jqyl+xhXwWkzBPndU5YX7aifr/yOh07oifwSQqg69BSz5bY0wJSp5/N xHr0oXtA0F3TKkFn/dXpJ1V+7sIaaObis8SSSZbDg2eNg8/hYFVD12thgm7HJrcTJB0k MTm+B8aND/7QXwBSm7ewXS6fTzDkyXlldNOla2tZp4T86gpVtly5uIqrcOjORnkSb8aE 7grLQFcFYRjbn+njl9z5iQ+CX/tYO4xHLdtG5M0vIgENDM8JMORuAur/svZwvh/hS2rg aDCQ== X-Received: by 10.68.231.35 with SMTP id td3mr23921596pbc.137.1397855085110; Fri, 18 Apr 2014 14:04:45 -0700 (PDT) Received: from localhost (jfdmzpr03-ext.jf.intel.com. [134.134.139.72]) by mx.google.com with ESMTPSA id tk5sm61773599pbc.63.2014.04.18.14.04.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Apr 2014 14:04:44 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Fri, 18 Apr 2014 18:04:24 -0300 Message-Id: <1397855070-4480-9-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1397855070-4480-1-git-send-email-rodrigo.vivi@gmail.com> References: <1397855070-4480-1-git-send-email-rodrigo.vivi@gmail.com> Subject: [Intel-gfx] [PATCH 08/14] drm/i915: Upgrade execbuffer fail after resume failure to EIO X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 From: Chris Wilson If we try to execute on a known ring, but it has failed to be initialised correctly, report that the GPU is hung rather than the command invalid. This leaves us reporting EINVAL only if the user requests execution on a ring that is not supported by the device. This should prevent UXA from getting stuck in a null render loop after a failed resume. Reported-by: Jiri Kosina References: https://bugs.freedesktop.org/show_bug.cgi?id=76554 Signed-off-by: Chris Wilson Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_gem_execbuffer.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 0ec8621..d9a54a1 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -999,6 +999,18 @@ i915_reset_gen7_sol_offsets(struct drm_device *dev, return 0; } +static bool +intel_ring_valid(struct intel_ring_buffer *ring) +{ + switch (ring->id) { + case RCS: return true; + case VCS: return HAS_BSD(ring->dev); + case BCS: return HAS_BLT(ring->dev); + case VECS: return HAS_VEBOX(ring->dev); + default: return false; + } +} + static int i915_gem_do_execbuffer(struct drm_device *dev, void *data, struct drm_file *file, @@ -1049,7 +1061,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, if (!intel_ring_initialized(ring)) { DRM_DEBUG("execbuf with invalid ring: %d\n", (int)(args->flags & I915_EXEC_RING_MASK)); - return -EINVAL; + return intel_ring_valid(ring) ? -EIO : -EINVAL; } mode = args->flags & I915_EXEC_CONSTANTS_MASK;