dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Lyude <cpaul@redhat.com>
To: intel-gfx@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	Daniel Vetter <daniel.vetter@intel.com>, Lyude <cpaul@redhat.com>
Subject: [PATCH 3/6] drm/i915: Add enable_sagv option
Date: Wed,  5 Oct 2016 11:33:13 -0400	[thread overview]
Message-ID: <1475681598-12081-4-git-send-email-cpaul@redhat.com> (raw)
In-Reply-To: <1475681598-12081-1-git-send-email-cpaul@redhat.com>

This option allows us to manually control the SAGV at module load time.
This can be useful in situations such as trying to debug watermark
changes, since enabled SAGV + incorrect watermarks = total GPU
annihilation.

Signed-off-by: Lyude <cpaul@redhat.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/i915/i915_params.c   |  5 +++++
 drivers/gpu/drm/i915/i915_params.h   |  1 +
 drivers/gpu/drm/i915/intel_display.c | 16 +++++++++++++---
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 768ad89..f462cd4 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -62,6 +62,7 @@ struct i915_params i915 __read_mostly = {
 	.inject_load_failure = 0,
 	.enable_dpcd_backlight = false,
 	.enable_gvt = false,
+	.enable_sagv = -1,
 };
 
 module_param_named(modeset, i915.modeset, int, 0400);
@@ -233,3 +234,7 @@ MODULE_PARM_DESC(enable_dpcd_backlight,
 module_param_named(enable_gvt, i915.enable_gvt, bool, 0400);
 MODULE_PARM_DESC(enable_gvt,
 	"Enable support for Intel GVT-g graphics virtualization host support(default:false)");
+
+module_param_named_unsafe(enable_sagv, i915.enable_sagv, int, 0400);
+MODULE_PARM_DESC(enable_sagv,
+	"Enable the SAGV (gen9+ only)(1=enabled, 0=disabled, -1=driver discretion [default])");
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 3a0dd78..a7db125 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -65,6 +65,7 @@ struct i915_params {
 	bool enable_dp_mst;
 	bool enable_dpcd_backlight;
 	bool enable_gvt;
+	int enable_sagv;
 };
 
 extern struct i915_params i915 __read_mostly;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a71d05a..dd15ae2 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -16904,12 +16904,22 @@ intel_modeset_setup_hw_state(struct drm_device *dev)
 		pll->on = false;
 	}
 
-	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev))
+	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
 		vlv_wm_get_hw_state(dev);
-	else if (IS_GEN9(dev))
+	} else if (IS_GEN9(dev)) {
 		skl_wm_get_hw_state(dev);
-	else if (HAS_PCH_SPLIT(dev))
+
+		if (i915.enable_sagv != -1) {
+			if (i915.enable_sagv)
+				intel_enable_sagv(dev_priv);
+			else
+				intel_disable_sagv(dev_priv);
+
+			dev_priv->sagv_status = I915_SAGV_NOT_CONTROLLED;
+		}
+	} else if (HAS_PCH_SPLIT(dev)) {
 		ilk_wm_get_hw_state(dev);
+	}
 
 	for_each_intel_crtc(dev, crtc) {
 		unsigned long put_domains;
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2016-10-05 15:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05 15:33 [PATCH 0/6] Start of skl watermark cleanup Lyude
2016-10-05 15:33 ` [PATCH 1/6] drm/i915/skl: Move per-pipe ddb allocations into crtc states Lyude
2016-10-05 20:23   ` Paulo Zanoni
2016-10-05 15:33 ` [PATCH 2/6] drm/i915/skl: Remove linetime from skl_wm_values Lyude
2016-10-05 20:24   ` [Intel-gfx] " Paulo Zanoni
2016-10-05 15:33 ` Lyude [this message]
2016-10-05 19:32   ` [PATCH 3/6] drm/i915: Add enable_sagv option Paulo Zanoni
2016-10-05 15:33 ` [PATCH 4/6] drm/i915/gen9: Make skl_wm_level per-plane Lyude
2016-10-05 20:33   ` Paulo Zanoni
2016-10-06 10:38     ` Maarten Lankhorst
2016-10-05 15:33 ` [PATCH 5/6] drm/i915/gen9: Get rid of redundant watermark values Lyude
2016-10-05 21:44   ` Paulo Zanoni
2016-10-05 21:53     ` [Intel-gfx] " Chris Wilson
2016-10-05 15:33 ` [PATCH 6/6] drm/i915/gen9: Add ddb changes to atomic debug output Lyude
2016-10-06 11:25 ` [PATCH 0/6] Start of skl watermark cleanup Maarten Lankhorst

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=1475681598-12081-4-git-send-email-cpaul@redhat.com \
    --to=cpaul@redhat.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).