From patchwork Thu Jun 25 13:42:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 6675221 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 6B3D4C05AC for ; Thu, 25 Jun 2015 13:42:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B8102061A for ; Thu, 25 Jun 2015 13:42:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B45EF20630 for ; Thu, 25 Jun 2015 13:42:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B6496E705; Thu, 25 Jun 2015 06:42:54 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from fireflyinternet.com (mail.fireflyinternet.com [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id 112146E705 for ; Thu, 25 Jun 2015 06:42:52 -0700 (PDT) X-Default-Received-SPF: pass (skip=forwardok (res=PASS)) x-ip-name=78.156.65.138; Received: from nuc-i3427.alporthouse.com (unverified [78.156.65.138]) by fireflyinternet.com (Firefly Internet (M1)) with ESMTP id 41496530-1500048 for multiple; Thu, 25 Jun 2015 14:43:34 +0100 Received: by nuc-i3427.alporthouse.com (sSMTP sendmail emulation); Thu, 25 Jun 2015 14:42:48 +0100 Date: Thu, 25 Jun 2015 14:42:48 +0100 From: Chris Wilson To: Zhi Wang Message-ID: <20150625134248.GN30757@nuc-i3427.alporthouse.com> Mail-Followup-To: Chris Wilson , Zhi Wang , "Niu, Bing" , "intel-gfx@lists.freedesktop.org" References: <1435243215-13283-1-git-send-email-bing.niu@intel.com> <20150625081313.GG30757@nuc-i3427.alporthouse.com> <20150625123716.GK30757@nuc-i3427.alporthouse.com> <558B27AA.9020404@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <558B27AA.9020404@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "intel-gfx@lists.freedesktop.org" , "Niu, Bing" Subject: Re: [Intel-gfx] [PATCH] drm/i915: Also perform gpu reset under execlist mode. 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 On Thu, Jun 25, 2015 at 05:56:58AM +0800, Zhi Wang wrote: > Hi Chris: > Thanks for the reply! I just dig the code. It looks there is no > special code path for execlist shutdown. It has init_rings(), but > doesn't have cleanup_rings(), only clean_ring(), which are called > for each ring one by one when i915_gem_cleanup_ringbuffer() gets > called. > > Do you have any advice? :) The quick and dirty version would be: diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 111c5cb2aa99..254c8e28963c 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -5096,6 +5096,14 @@ i915_gem_cleanup_ringbuffer(struct drm_device *dev) for_each_ring(ring, dev_priv, i) dev_priv->gt.cleanup_ring(ring); + + if (i915.enable_execlists) + /* + * Neither the BIOS, ourselves or any other kernel + * expects the system to be in execlists mode on startup, + * so we need to reset the GPU back to legacy mode. + */ + intel_gpu_reset(dev); } -Chris