From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Mateo Lozano, Oscar" Subject: Re: [PATCH] drm/i915: Unpin last_context at reset Date: Thu, 19 Jun 2014 16:21:50 +0000 Message-ID: <92648605EABDA246B775AAB04C95A7A301320F9E@IRSMSX103.ger.corp.intel.com> References: <1403118289-19550-1-git-send-email-ville.syrjala@linux.intel.com> <20140619074722.GC10572@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id E1F3E6E8F1 for ; Thu, 19 Jun 2014 09:22:17 -0700 (PDT) In-Reply-To: <20140619074722.GC10572@nuc-i3427.alporthouse.com> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , "ville.syrjala@linux.intel.com" Cc: "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org > -----Original Message----- > From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf > Of Chris Wilson > Sent: Thursday, June 19, 2014 8:47 AM > To: ville.syrjala@linux.intel.com > Cc: intel-gfx@lists.freedesktop.org > Subject: Re: [Intel-gfx] [PATCH] drm/i915: Unpin last_context at reset > = > On Wed, Jun 18, 2014 at 10:04:48PM +0300, ville.syrjala@linux.intel.com > wrote: > > From: Ville Syrj=E4l=E4 > > > > We're forgetting to unpin the last_context from the ggtt at GPU reset > > time. This leads to the vma pin_count leaking at every reset if the > > last context wasn't the ring default context. Further use of the same > > context will trigger the pin_count check in i915_gem_object_pin() and > > userspace will be faced with EBUSY as a result. > > > > This plaques kms_flip rather badly since it performs lots of resets, > > and every fd has its own default context these days. > > > > Fix the problem by properly unpinning the last context at reset. > = > Ah, the context reset here is faked because we never restore the default > context state. Hmm, in fact, I get the impression that we should just de= lete > i915_gem_context_reset(), and make i915_gem_context_enable() function > correctly after the GPU is reset. > -Chris I=B4m doing something similar in a parallel conversation (see http://lists.= freedesktop.org/archives/intel-gfx/2014-June/047744.html). My proposal was = to make both the APPGTT switch and default context switch completely synchr= onous (RING_PP_DIR_BASE/GEN8_RING_PDP for the PPGTT, CCID for the context) = in i915_gem_context_enable(). That way we get rid of i915_gem_context_reset= () and we don=B4t need all the gpu reset special casing inside ppgtt->switc= h_mm. Daniel wants a completely asynchronous thing, which seems complex without i= ntel_ring_begin, ring->flush, intel_ring_advance, etc..