public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: James Ausmus <james.ausmus@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: "Lucas De Marchi" <lucas.demarchi@intel.com>,
	"Ville Syrjälä" <ville.syrjala@intel.com>
Subject: [PATCH 1/3] drm/i915: Extract SAGV block time function
Date: Wed, 25 Sep 2019 13:33:50 -0700	[thread overview]
Message-ID: <20190925203352.9827-2-james.ausmus@intel.com> (raw)
In-Reply-To: <20190925203352.9827-1-james.ausmus@intel.com>

In prep for newer platforms having more complicated ways to determine
the SAGV block time, extract the setting to a separate function. While
we're at it, update the if ladder to follow the new gen -> old gen order
preference, and warn on any non-specified gen.

Cc: Ville Syrjälä <ville.syrjala@intel.com>
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: James Ausmus <james.ausmus@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 6bed2ed14574..5ad72dcb0faa 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3662,6 +3662,23 @@ intel_has_sagv(struct drm_i915_private *dev_priv)
 		dev_priv->sagv_status != I915_SAGV_NOT_CONTROLLED;
 }
 
+static int
+intel_get_sagv_block_time_us(struct drm_i915_private *dev_priv)
+{
+	int sagv_block_time_us = 1000; /* Default to unusable block time */
+
+	if (IS_GEN(dev_priv, 11))
+		sagv_block_time_us = 10;
+	else if (IS_GEN(dev_priv, 10))
+		sagv_block_time_us = 20;
+	else if (IS_GEN(dev_priv, 9))
+		sagv_block_time_us = 30;
+	else
+		MISSING_CASE(INTEL_GEN(dev_priv));
+
+	return sagv_block_time_us;
+}
+
 /*
  * SAGV dynamically adjusts the system agent voltage and clock frequencies
  * depending on power and performance requirements. The display engine access
@@ -3755,12 +3772,7 @@ bool intel_can_enable_sagv(struct intel_atomic_state *state)
 	if (!intel_has_sagv(dev_priv))
 		return false;
 
-	if (IS_GEN(dev_priv, 9))
-		sagv_block_time_us = 30;
-	else if (IS_GEN(dev_priv, 10))
-		sagv_block_time_us = 20;
-	else
-		sagv_block_time_us = 10;
+	sagv_block_time_us = intel_get_sagv_block_time_us(dev_priv);
 
 	/*
 	 * If there are no active CRTCs, no additional checks need be performed
-- 
2.22.1

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

  reply	other threads:[~2019-09-25 20:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-25 20:33 Add support for TGL in SAGV code paths James Ausmus
2019-09-25 20:33 ` James Ausmus [this message]
2019-09-27 17:51   ` [PATCH 1/3] drm/i915: Extract SAGV block time function Ville Syrjälä
2019-09-25 20:33 ` [PATCH 2/3] drm/i915/tgl: Read SAGV block time from PCODE James Ausmus
2019-09-27 18:01   ` Ville Syrjälä
2019-09-27 18:18   ` Ville Syrjälä
2019-09-25 20:33 ` [PATCH 3/3] drm/i915/tgl: Remove single pipe restriction from SAGV James Ausmus
2019-09-26 12:34   ` Ville Syrjälä
2019-09-27 17:16     ` James Ausmus
2019-09-25 21:02 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/3] drm/i915: Extract SAGV block time function Patchwork
2019-09-25 21:25 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-26 16:23 ` ✓ 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=20190925203352.9827-2-james.ausmus@intel.com \
    --to=james.ausmus@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=ville.syrjala@intel.com \
    /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