From patchwork Tue Aug 27 23:14:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Summers, Stuart" X-Patchwork-Id: 11117609 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9C0C13B1 for ; Tue, 27 Aug 2019 23:13:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B43A0214DA for ; Tue, 27 Aug 2019 23:13:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B43A0214DA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 26EC689BF5; Tue, 27 Aug 2019 23:13:47 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 48C1689BF1 for ; Tue, 27 Aug 2019 23:13:42 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Aug 2019 16:13:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,439,1559545200"; d="scan'208";a="185444179" Received: from jssummer-xeon.ra.intel.com ([10.23.184.90]) by orsmga006.jf.intel.com with ESMTP; 27 Aug 2019 16:13:41 -0700 From: Stuart Summers To: Date: Tue, 27 Aug 2019 16:14:35 -0700 Message-Id: <20190827231435.398-3-stuart.summers@intel.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190827231435.398-1-stuart.summers@intel.com> References: <20190827231435.398-1-stuart.summers@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Add ring_mask module parameter X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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;