From mboxrd@z Thu Jan 1 00:00:00 1970 From: Damien Lespiau Subject: Re: [PATCH 34/43] drm/i915/bdw: Make sure gpu reset still works with Execlists Date: Fri, 1 Aug 2014 15:42:22 +0100 Message-ID: <20140801144222.GN8840@strange.ger.corp.intel.com> References: <1406217891-8912-1-git-send-email-thomas.daniel@intel.com> <1406217891-8912-35-git-send-email-thomas.daniel@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 84BC56E77A for ; Fri, 1 Aug 2014 07:42:25 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1406217891-8912-35-git-send-email-thomas.daniel@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Thomas Daniel Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Thu, Jul 24, 2014 at 05:04:42PM +0100, Thomas Daniel wrote: > From: Oscar Mateo > > If we reset a ring after a hang, we have to make sure that we clear > out all queued Execlists requests. > > v2: The ring is, at this point, already being correctly re-programmed > for Execlists, and the hangcheck counters cleared. > > v3: Daniel suggests to drop the "if (execlists)" because the Execlists > queue should be empty in legacy mode (which is true, if we do the > INIT_LIST_HEAD). > > v4: Do the pending intel_runtime_pm_put I don't see a intel_runtime_pm_get() that put() would correspond to. > > Signed-off-by: Oscar Mateo > --- > drivers/gpu/drm/i915/i915_gem.c | 12 ++++++++++++ > drivers/gpu/drm/i915/intel_ringbuffer.c | 1 + > 2 files changed, 13 insertions(+) > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c > index 1c83b9c..143cff7 100644 > --- a/drivers/gpu/drm/i915/i915_gem.c > +++ b/drivers/gpu/drm/i915/i915_gem.c > @@ -2567,6 +2567,18 @@ static void i915_gem_reset_ring_cleanup(struct drm_i915_private *dev_priv, > i915_gem_free_request(request); > } > > + while (!list_empty(&ring->execlist_queue)) { > + struct intel_ctx_submit_request *submit_req; > + > + submit_req = list_first_entry(&ring->execlist_queue, > + struct intel_ctx_submit_request, > + execlist_link); > + list_del(&submit_req->execlist_link); > + intel_runtime_pm_put(dev_priv); > + i915_gem_context_unreference(submit_req->ctx); > + kfree(submit_req); > + } > + > /* These may not have been flush before the reset, do so now */ > kfree(ring->preallocated_lazy_request); > ring->preallocated_lazy_request = NULL; > diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c > index 3188403..6e604c9 100644 > --- a/drivers/gpu/drm/i915/intel_ringbuffer.c > +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c > @@ -1587,6 +1587,7 @@ static int intel_init_ring_buffer(struct drm_device *dev, > ring->dev = dev; > INIT_LIST_HEAD(&ring->active_list); > INIT_LIST_HEAD(&ring->request_list); > + INIT_LIST_HEAD(&ring->execlist_queue); > ringbuf->size = 32 * PAGE_SIZE; > ringbuf->ring = ring; > ringbuf->ctx = ring->default_context; > -- > 1.7.9.5 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx