Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stuart Summers <stuart.summers@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/2] drm/i915: Add ring_mask module parameter
Date: Tue, 27 Aug 2019 16:14:35 -0700	[thread overview]
Message-ID: <20190827231435.398-3-stuart.summers@intel.com> (raw)
In-Reply-To: <20190827231435.398-1-stuart.summers@intel.com>

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;
+	if (info->engine_mask != orig_engine_mask)
+		DRM_WARN("loading with reduced engine mask 0x%x\n",
+			 info->engine_mask);
+
 	media_fuse = ~I915_READ(GEN11_GT_VEBOX_VDBOX_DISABLE);
 
 	vdbox_mask = media_fuse & GEN11_GT_VDBOX_DISABLE_MASK;
-- 
2.22.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-08-27 23: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 ` Stuart Summers [this message]
2019-08-28  9:34   ` [PATCH 2/2] drm/i915: Add ring_mask module parameter Chris Wilson
2019-08-28 15:13     ` Summers, Stuart
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=20190827231435.398-3-stuart.summers@intel.com \
    --to=stuart.summers@intel.com \
    --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