From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
Intel graphics driver community testing & development
<intel-gfx@lists.freedesktop.org>
Cc: intel-gvt-dev@lists.freedesktop.org,
Paulo Zanoni <paulo.r.zanoni@intel.com>,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v2] drm/i915: Sanitize engine context sizes
Date: Thu, 27 Apr 2017 11:53:33 +0300 [thread overview]
Message-ID: <1493283213.7266.2.camel@linux.intel.com> (raw)
In-Reply-To: <3d3e34c2-fa93-375e-be90-3b96d38bcae2@linux.intel.com>
On ke, 2017-04-26 at 14:16 +0100, Tvrtko Ursulin wrote:
> On 26/04/2017 13:20, Joonas Lahtinen wrote:
> >
> > @@ -443,21 +417,6 @@ int i915_gem_context_init(struct drm_i915_private *dev_priv)
> > BUILD_BUG_ON(MAX_CONTEXT_HW_ID > INT_MAX);
> > ida_init(&dev_priv->context_hw_ida);
> >
> > - if (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;
> > - } else if (HAS_HW_CONTEXTS(dev_priv)) {
> > - dev_priv->hw_context_size =
> > - round_up(get_context_size(dev_priv),
> > - I915_GTT_PAGE_SIZE);
>
> Is this rounding up lost when used from __create_hw_context?
Added it back for Gen 7 and 6 where it could do something. Others have
been rounded up in the heads of engineers already.
> > +static u32
> > +__intel_engine_context_size(struct drm_i915_private *dev_priv, u8 class)
> Very minor, but Chris has been trying to establish i915 instead of
> dev_priv in new code.
It'd shadow the global i915 in this case, so leaving it as is :/
> > @@ -134,6 +208,10 @@ intel_engine_setup(struct drm_i915_private *dev_priv,
> > engine->irq_shift = info->irq_shift;
> > engine->class = info->class;
> > engine->instance = info->instance;
> > + engine->context_size = __intel_engine_context_size(dev_priv,
> > + engine->class);
> > + if (WARN_ON(engine->context_size > BIT(20)))
> > + engine->context_size = 0;
>
> Don't know the history to tell whether upgrade of DRM_DEBUG_DRIVER to a
> WARN_ON is ok.
Talked with Chris, if it triggers, it should definitely be WARN_ON :)
Never seen in the past.
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2017-04-27 8:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-26 12:20 [PATCH v2] drm/i915: Sanitize engine context sizes Joonas Lahtinen
2017-04-26 12:43 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-04-26 13:16 ` [PATCH v2] " Tvrtko Ursulin
2017-04-26 13:40 ` Tvrtko Ursulin
2017-04-27 8:53 ` Joonas Lahtinen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1493283213.7266.2.camel@linux.intel.com \
--to=joonas.lahtinen@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-gvt-dev@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=tvrtko.ursulin@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox