From: "Summers, Stuart" <stuart.summers@intel.com>
To: "chris@chris-wilson.co.uk" <chris@chris-wilson.co.uk>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 2/2] drm/i915: Add ring_mask module parameter
Date: Wed, 28 Aug 2019 15:13:58 +0000 [thread overview]
Message-ID: <5ff328729ecd95b4638e6d0e906c2e05f2422e18.camel@intel.com> (raw)
In-Reply-To: <156698488624.15406.699757792829856983@skylake-alporthouse-com>
[-- Attachment #1.1: Type: text/plain, Size: 3559 bytes --]
On Wed, 2019-08-28 at 10:34 +0100, Chris Wilson wrote:
> Quoting Stuart Summers (2019-08-28 00:14:35)
> > Add a new module parameter, ring_mask, to allow for disabling
> > engines during i915 load. This mask follows the intel_engine_id
> > enum and can be used to hide specified engines from i915 and
> > from userspace.
> >
> > Signed-off-by: Stuart Summers <stuart.summers@intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_params.c | 3 +++
> > drivers/gpu/drm/i915/i915_params.h | 3 ++-
> > drivers/gpu/drm/i915/intel_device_info.c | 6 ++++++
> > 3 files changed, 11 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_params.c
> > b/drivers/gpu/drm/i915/i915_params.c
> > index 296452f9efe4..6a17fe6ea3a2 100644
> > --- a/drivers/gpu/drm/i915/i915_params.c
> > +++ b/drivers/gpu/drm/i915/i915_params.c
> > @@ -178,6 +178,9 @@ i915_param_named(enable_gvt, bool, 0400,
> > "Enable support for Intel GVT-g graphics virtualization
> > host support(default:false)");
> > #endif
> >
> > +i915_param_named_unsafe(ring_mask, uint, 0400,
> > + "Mask of engine rings to enable. (default: all supported
> > engines enabled)");
> > +
> > static __always_inline void _print_param(struct drm_printer *p,
> > const char *name,
> > const char *type,
> > diff --git a/drivers/gpu/drm/i915/i915_params.h
> > b/drivers/gpu/drm/i915/i915_params.h
> > index d29ade3b7de6..d803bf5faac4 100644
> > --- a/drivers/gpu/drm/i915/i915_params.h
> > +++ b/drivers/gpu/drm/i915/i915_params.h
> > @@ -77,7 +77,8 @@ struct drm_printer;
> > param(bool, verbose_state_checks, true) \
> > param(bool, nuclear_pageflip, false) \
> > param(bool, enable_dp_mst, true) \
> > - param(bool, enable_gvt, false)
> > + param(bool, enable_gvt, false) \
> > + param(unsigned int, ring_mask, (unsigned int)-1)
> >
> > #define MEMBER(T, member, ...) T member;
> > struct i915_params {
> > diff --git a/drivers/gpu/drm/i915/intel_device_info.c
> > b/drivers/gpu/drm/i915/intel_device_info.c
> > index caef01b1da23..f833280f2ef6 100644
> > --- a/drivers/gpu/drm/i915/intel_device_info.c
> > +++ b/drivers/gpu/drm/i915/intel_device_info.c
> > @@ -993,10 +993,16 @@ void intel_device_info_init_mmio(struct
> > drm_i915_private *dev_priv)
> > u32 media_fuse;
> > u16 vdbox_mask;
> > u16 vebox_mask;
> > + u32 orig_engine_mask = info->engine_mask;
> >
> > if (INTEL_GEN(dev_priv) < 11)
> > return;
> >
> > + info->engine_mask &= i915_modparams.ring_mask;
>
> The challenge is we can't use our engine_mask for this as that is an
> internal bitfield that may change overtime -- and we definitely don't
> want the modparam to disable different engines on different kernel
> releases.
Yeah, it's a valid concern. I was thinking we might just put this
expectation on the user/debugger given this should really only be used
under duress. I'll rethink it and see if I can come up with something a
little safer.
>
> > + if (info->engine_mask != orig_engine_mask)
> > + DRM_WARN("loading with reduced engine mask 0x%x\n",
> > + info->engine_mask);
>
> It's operating under direct control from the user, so dev_notice (as
> we
> treat it as a quirk).
Makes sense. I'll make the change in the next revision.
Thanks,
Stuart
> -Chris
[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3270 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-08-28 15:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-27 23:14 [PATCH 0/2] Add module parameter to reduce engine instances Stuart Summers
2019-08-27 23:14 ` [PATCH 1/2] drm/i915: WARN rather than BUG with unexpected media engines Stuart Summers
2019-08-27 23:14 ` [PATCH 2/2] drm/i915: Add ring_mask module parameter Stuart Summers
2019-08-28 9:34 ` Chris Wilson
2019-08-28 15:13 ` Summers, Stuart [this message]
2019-08-27 23:21 ` ✗ Fi.CI.CHECKPATCH: warning for Add module parameter to reduce engine instances Patchwork
2019-08-28 9:28 ` ✓ Fi.CI.BAT: success " Patchwork
2019-08-29 10:16 ` ✓ Fi.CI.IGT: " Patchwork
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=5ff328729ecd95b4638e6d0e906c2e05f2422e18.camel@intel.com \
--to=stuart.summers@intel.com \
--cc=chris@chris-wilson.co.uk \
--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