From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
Ben Widawsky <ben@bwidawsk.net>,
Alessandro Suardi <alessandro.suardi@gmail.com>
Subject: Re: [PATCH] drm/i915: Sanitize the enable_ppgtt module option once
Date: Fri, 25 Apr 2014 16:11:52 +0300 [thread overview]
Message-ID: <874n1hv9if.fsf@intel.com> (raw)
In-Reply-To: <87mwfbvwer.fsf@intel.com>
On Thu, 24 Apr 2014, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> On Wed, 23 Apr 2014, Daniel Vetter <daniel@ffwll.ch> wrote:
>> On Wed, Apr 23, 2014 at 11:37:46AM +0300, Jani Nikula wrote:
>>> On Tue, 22 Apr 2014, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
>>> > Otherwise we'll end up spamming dmesg on every context creation on snb
>>> > with vt-d enabled. This regression was introduced in
>>> >
>>> > commit 246cbfb5fb9a1ca0997fbb135464c1ff5bb9c549
>>> > Author: Ben Widawsky <benjamin.widawsky@intel.com>
>>> > Date: Fri Dec 6 14:11:14 2013 -0800
>>> >
>>> > drm/i915: Reorganize intel_enable_ppgtt
>>> >
>>> > References: https://lkml.org/lkml/2014/4/17/599
>>> > Cc: Alessandro Suardi <alessandro.suardi@gmail.com>
>>> > Cc: Ben Widawsky <ben@bwidawsk.net>
>>> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>> > ---
>>> > drivers/gpu/drm/i915/i915_gem_gtt.c | 26 +++++++++++++++++++-------
>>> > 1 file changed, 19 insertions(+), 7 deletions(-)
>>> >
>>> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
>>> > index 0d514ff9b94c..47491c4a1181 100644
>>> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
>>> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
>>> > @@ -34,25 +34,35 @@ static void gen8_setup_private_ppat(struct drm_i915_private *dev_priv);
>>> >
>>> > bool intel_enable_ppgtt(struct drm_device *dev, bool full)
>>> > {
>>> > - if (i915.enable_ppgtt == 0 || !HAS_ALIASING_PPGTT(dev))
>>> > + if (i915.enable_ppgtt == 0)
>>> > return false;
>>> >
>>> > if (i915.enable_ppgtt == 1 && full)
>>> > return false;
>>> >
>>> > + return true;
>>> > +}
>>> > +
>>> > +static int sanitize_enable_ppgtt(struct drm_device *dev, int enable_ppgtt)
>>> > +{
>>> > + if (enable_ppgtt == 0 || !HAS_ALIASING_PPGTT(dev))
>>> > + return 0;
>>> > +
>>> > + if (i915.enable_ppgtt == 1)
>>> > + return 1;
>>> > +
>>> > + if (i915.enable_ppgtt == 2 && HAS_PPGTT(dev))
>>> > + return 2;
>>>
>>> You should probably either pass enable_ppgtt as parameter and use that
>>> exclusively, or not pass it and refer to i915.enable_ppgtt directly, but
>>> not mix them.
>>
>> New patch on its way with Chris' comments also applied.
>>>
>>> > +
>>> > #ifdef CONFIG_INTEL_IOMMU
>>> > /* Disable ppgtt on SNB if VT-d is on. */
>>> > if (INTEL_INFO(dev)->gen == 6 && intel_iommu_gfx_mapped) {
>>> > DRM_INFO("Disabling PPGTT because VT-d is on\n");
>>> > - return false;
>>> > + return 0;
>>> > }
>>> > #endif
>>> >
>>> > - /* Full ppgtt disabled by default for now due to issues. */
>>> > - if (full)
>>> > - return HAS_PPGTT(dev) && (i915.enable_ppgtt == 2);
>>> > - else
>>> > - return HAS_ALIASING_PPGTT(dev);
>>> > + return HAS_ALIASING_PPGTT(dev) ? 1 : 0;
>>>
>>>
>>> This conflicts in -fixes due to
>>> commit 8d214b7d9c45f4af23ce41b2bc74f79c44f760de
>>> Author: Ben Widawsky <benjamin.widawsky@linux.intel.com>
>>> Date: Mon Mar 24 18:06:00 2014 -0700
>>>
>>> drm/i915: Allow full PPGTT with param override
>>>
>>> Should I incorporate that in the conflict resolution for simplicity,
>>> letting 3.15 users also play with full ppgtt with the module param?
>>
>> Yeah I guess it's easiest to just cherry-pick that one to -fixes, too.
>> -Daniel
>
> Pushed v2 to -fixes, along with "drm/i915: Allow full PPGTT with param
> override". Thanks for the patch and review.
And yanked out again due to [1]. Back to the drawing board. Please also
add a ppgtt sanity check BUG_ON before returning true from
intel_enable_ppgtt().
BR,
Jani.
[1] https://bugs.freedesktop.org/show_bug.cgi?id=77916
--
Jani Nikula, Intel Open Source Technology Center
next prev parent reply other threads:[~2014-04-25 13:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-22 20:17 [PATCH] drm/i915: Sanitize the enable_ppgtt module option once Daniel Vetter
2014-04-22 21:22 ` Chris Wilson
2014-04-23 7:18 ` Daniel Vetter
2014-04-23 17:44 ` Ben Widawsky
2014-04-23 8:37 ` Jani Nikula
2014-04-23 18:01 ` Daniel Vetter
2014-04-23 18:02 ` Daniel Vetter
2014-04-24 10:45 ` Jani Nikula
2014-04-25 13:11 ` Jani Nikula [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-04-29 9:53 Daniel Vetter
2014-04-29 10:44 ` Chris Wilson
2014-04-29 12:23 ` Alessandro Suardi
2014-04-29 14:06 ` Daniel Vetter
2014-04-29 15:48 ` Jani Nikula
2014-04-29 13:27 ` Jani Nikula
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=874n1hv9if.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=alessandro.suardi@gmail.com \
--cc=ben@bwidawsk.net \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
/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