From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Wilson Subject: Re: [PATCH 89/89] drm/i915/skl: Disable contexts if execlists aren't enabled Date: Fri, 26 Sep 2014 16:47:02 +0100 Message-ID: <20140926154702.GB19278@nuc-i3427.alporthouse.com> References: <1409830075-11139-1-git-send-email-damien.lespiau@intel.com> <1409830075-11139-90-git-send-email-damien.lespiau@intel.com> <87tx3utn7u.fsf@gaia.fi.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from fireflyinternet.com (mail.fireflyinternet.com [87.106.93.118]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A53A89D1D for ; Fri, 26 Sep 2014 08:47:06 -0700 (PDT) Content-Disposition: inline In-Reply-To: <87tx3utn7u.fsf@gaia.fi.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Mika Kuoppala Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Sep 26, 2014 at 06:28:53PM +0300, Mika Kuoppala wrote: > Damien Lespiau writes: > > > We were hiting a BUG() in get_context_size() with execlist disabled. > > > > "legacy" contexts are not supported on gen9 so we don't have a gen9 > > specific size to add in there. Instead, let's disable legacy contexts > > altogether on gen9, whether we're booting with execlist enabled or not. > > > > Signed-off-by: Damien Lespiau > > Reviewed-by: Mika Kuoppala > > > --- > > drivers/gpu/drm/i915/i915_gem_context.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c > > index a5221d8..ec81d8a 100644 > > --- a/drivers/gpu/drm/i915/i915_gem_context.c > > +++ b/drivers/gpu/drm/i915/i915_gem_context.c > > @@ -320,7 +320,7 @@ int i915_gem_context_init(struct drm_device *dev) > > if (WARN_ON(dev_priv->ring[RCS].default_context)) > > return 0; > > > > - if (i915.enable_execlists) { > > + if (INTEL_INFO(dev)->gen >= 9 || i915.enable_execlists) { > > /* NB: intentionally left blank. We will allocate our own > > * backing objects as we need them, thank you very much */ > > dev_priv->hw_context_size = 0; I wouldn't have written it like this, since this hides the error, and confuddles the intention of that branch, rather than embracing it. diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 102e8a7bcef6..f471b3511d80 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -129,7 +129,10 @@ static int get_context_size(struct drm_device *dev) ret = GEN8_CXT_TOTAL_SIZE; break; default: - BUG(); + WARN("context size not known for gen %d\n", + INTEL_INFO(dev)->gen); + ret = -1; + break; } Would keep the fixme in place and keep the kernel running. -Chris -- Chris Wilson, Intel Open Source Technology Centre