All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagar Arun Kamble <sagar.a.kamble@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Tom O'Rourke <Tom.O'Rourke@intel.com>
Subject: [PATCH 04/20] drm/i915/slpc: Add enable_slpc module parameter
Date: Fri,  1 Sep 2017 12:55:07 +0530	[thread overview]
Message-ID: <1504250723-32018-5-git-send-email-sagar.a.kamble@intel.com> (raw)
In-Reply-To: <1504250723-32018-1-git-send-email-sagar.a.kamble@intel.com>

From: Tom O'Rourke <Tom.O'Rourke@intel.com>

i915.enable_slpc is used to override the default for slpc usage.
The expected values are -1=auto, 0=disabled [default], 1=enabled.

Sanitize i915.enable_slpc to either 0 or 1 based on HAS_SLPC() and
GuC load and submission options.

v1: Add early call to sanitize enable_slpc in intel_guc_ucode_init
    Remove sanitize enable_slpc call before firmware version check
    is performed. (ChrisW)
    Version check is added in next patch and that will be done as
    part of slpc_enable_sanitize function in the next patch. (Sagar)
    Updated slpc option sanitize function call for platforms without
    GuC support. This was caught by CI BAT.

v2: Changed parameter to dev_priv for HAS_SLPC macro. (David)
    Code indentation based on checkpatch.

v3: Rebase.

v4: Moved sanitization of SLPC option post GuC load.

v5: Removed function intel_slpc_enabled. Planning to rely only on
    kernel parameter. Moved sanitization prior to GuC load to use the
    parameter during SLPC state setup during to GuC load. (Sagar)

v6: Commit message update. Rebase.

v7: Moved SLPC option sanitization to intel_uc_sanitize_options.

Suggested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Tom O'Rourke <Tom.O'Rourke@intel.com>
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com>
---
 drivers/gpu/drm/i915/i915_params.c |  6 ++++++
 drivers/gpu/drm/i915/i915_params.h |  1 +
 drivers/gpu/drm/i915/intel_uc.c    | 13 +++++++++++++
 3 files changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 8ab003d..be365b4 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -36,6 +36,7 @@ struct i915_params i915 __read_mostly = {
 	.enable_dc = -1,
 	.enable_fbc = -1,
 	.enable_execlists = -1,
+	.enable_slpc = 0,
 	.enable_hangcheck = true,
 	.enable_ppgtt = -1,
 	.enable_psr = -1,
@@ -146,6 +147,11 @@ struct i915_params i915 __read_mostly = {
 	"Override execlists usage. "
 	"(-1=auto [default], 0=disabled, 1=enabled)");
 
+module_param_named_unsafe(enable_slpc, i915.enable_slpc, int, 0400);
+MODULE_PARM_DESC(enable_slpc,
+	"Override single-loop-power-controller (slpc) usage. "
+	"(-1=auto, 0=disabled [default], 1=enabled)");
+
 module_param_named_unsafe(enable_psr, i915.enable_psr, int, 0600);
 MODULE_PARM_DESC(enable_psr, "Enable PSR "
 		 "(0=disabled, 1=enabled - link mode chosen per-platform, 2=force link-standby mode, 3=force link-off mode) "
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index ac84470..d5c7bfb 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -41,6 +41,7 @@
 	func(int, enable_ppgtt); \
 	func(int, enable_execlists); \
 	func(int, enable_psr); \
+	func(int, enable_slpc); \
 	func(int, disable_power_well); \
 	func(int, enable_ips); \
 	func(int, invert_brightness); \
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 9216c73..70d11c2 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -68,6 +68,7 @@ void intel_uc_sanitize_options(struct drm_i915_private *dev_priv)
 
 		i915.enable_guc_loading = 0;
 		i915.enable_guc_submission = 0;
+		i915.enable_slpc = 0;
 		return;
 	}
 
@@ -91,6 +92,18 @@ void intel_uc_sanitize_options(struct drm_i915_private *dev_priv)
 	/* A negative value means "use platform default" */
 	if (i915.enable_guc_submission < 0)
 		i915.enable_guc_submission = HAS_GUC_SCHED(dev_priv);
+
+	/* slpc requires hardware support and compatible firmware */
+	if (!HAS_SLPC(dev_priv))
+		i915.enable_slpc = 0;
+
+	/* slpc requires guc loaded */
+	if (!i915.enable_guc_loading)
+		i915.enable_slpc = 0;
+
+	/* slpc requires guc submission */
+	if (!i915.enable_guc_submission)
+		i915.enable_slpc = 0;
 }
 
 void intel_uc_init_early(struct drm_i915_private *dev_priv)
-- 
1.9.1

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

  parent reply	other threads:[~2017-09-01  7:22 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01  7:25 [PATCH 00/20] Add support for GuC-based SLPC Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 01/20] drm/i915/debugfs: Create generic string tokenize function and update CRC control parsing Sagar Arun Kamble
2017-09-08 13:23   ` Szwichtenberg, Radoslaw
2017-09-01  7:25 ` [PATCH 02/20] drm/i915/gen9+: Separate RPS and RC6 handling Sagar Arun Kamble
2017-09-08 13:31   ` Szwichtenberg, Radoslaw
2017-09-08 15:14   ` Chris Wilson
2017-09-01  7:25 ` [PATCH 03/20] drm/i915/slpc: Add has_slpc capability flag Sagar Arun Kamble
2017-09-01  7:25 ` Sagar Arun Kamble [this message]
2017-09-01  7:25 ` [PATCH 05/20] drm/i915/slpc: Sanitize GuC version Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 06/20] drm/i915/slpc: Lay out SLPC init/enable/disable/cleanup helpers Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 07/20] drm/i915/slpc: Enable SLPC in GuC if supported Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 08/20] drm/i915/slpc: Add SLPC communication interfaces Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 09/20] drm/i915/slpc: Allocate/Release/Initialize SLPC shared data Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 10/20] drm/i915/slpc: Add parameter set/unset/get, task control/status functions Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 11/20] drm/i915/slpc: Send RESET event to enable SLPC Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 12/20] drm/i915/slpc: Send SHUTDOWN event Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 13/20] drm/i915/slpc: Add support for min/max frequency control Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 14/20] drm/i915/slpc: Add debugfs support to read/write/revert the parameters Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 15/20] drm/i915/slpc: Add enable/disable controls for SLPC tasks Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 16/20] drm/i915/slpc: Add i915_slpc_info to debugfs Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 17/20] drm/i915/slpc: Add SLPC banner to RPS debugfs interfaces Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 18/20] drm/i915/slpc: Add SKL SLPC Support Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 19/20] drm/i915/slpc: Add Broxton SLPC support Sagar Arun Kamble
2017-09-01  7:25 ` [PATCH 20/20] drm/i915/slpc: Add Kabylake " Sagar Arun Kamble
2017-09-12  8:39 ` [PATCH 00/20] Add support for GuC-based SLPC Szwichtenberg, Radoslaw
2017-09-19 10:30   ` Joonas Lahtinen
2017-09-19 10:49     ` Kamble, Sagar A

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=1504250723-32018-5-git-send-email-sagar.a.kamble@intel.com \
    --to=sagar.a.kamble@intel.com \
    --cc=Tom.O'Rourke@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.