All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH] drm/i915: Allow a way to disable watermark for debuging purposes.
Date: Mon,  4 Jan 2016 15:00:03 -0800	[thread overview]
Message-ID: <1451948403-2847-1-git-send-email-rodrigo.vivi@intel.com> (raw)

Without watermark the power consumption will blow up, but
when enabling platforms and dealing with different kinds of
crashes, screen corruptions, pipe underuns, etc we need to be
able to easily disable watermark to see if we are on the right
investigation track.

Another possibility was to skip at the beginning and avoid all
calculations, but I'm not sure about it. Maybe it might be still
useful to know the calculated values when debuging.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/i915_params.c |  4 ++++
 drivers/gpu/drm/i915/i915_params.h |  1 +
 drivers/gpu/drm/i915/intel_pm.c    | 14 +++++++++-----
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 8d90c25..7a0909d 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -42,6 +42,7 @@ struct i915_params i915 __read_mostly = {
 	.preliminary_hw_support = IS_ENABLED(CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT),
 	.disable_power_well = -1,
 	.enable_ips = 1,
+	.enable_watermark = 1,
 	.fastboot = 0,
 	.prefault_disable = 0,
 	.load_detect_test = 0,
@@ -141,6 +142,9 @@ MODULE_PARM_DESC(disable_power_well,
 module_param_named_unsafe(enable_ips, i915.enable_ips, int, 0600);
 MODULE_PARM_DESC(enable_ips, "Enable IPS (default: true)");
 
+module_param_named_unsafe(enable_watermark, i915.enable_watermark, int, 0600);
+MODULE_PARM_DESC(enable_watermark, "Enable Watermark (default: true)");
+
 module_param_named(fastboot, i915.fastboot, bool, 0600);
 MODULE_PARM_DESC(fastboot,
 	"Try to skip unnecessary mode sets at boot time (default: false)");
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 5299290..a1856e0 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -43,6 +43,7 @@ struct i915_params {
 	unsigned int preliminary_hw_support;
 	int disable_power_well;
 	int enable_ips;
+	int enable_watermark;
 	int invert_brightness;
 	int enable_cmd_parser;
 	int guc_log_level;
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 02fe081..6f14cd7 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2484,7 +2484,7 @@ static void ilk_compute_wm_results(struct drm_device *dev,
 			(r->pri_val << WM1_LP_SR_SHIFT) |
 			r->cur_val;
 
-		if (r->enable)
+		if (r->enable && i915.enable_watermark)
 			results->wm_lp[wm_lp - 1] |= WM1_LP_SR_EN;
 
 		if (INTEL_INFO(dev)->gen >= 8)
@@ -3258,7 +3258,8 @@ static void skl_compute_wm_results(struct drm_device *dev,
 			temp |= p_wm->wm[level].plane_res_l[i] <<
 					PLANE_WM_LINES_SHIFT;
 			temp |= p_wm->wm[level].plane_res_b[i];
-			if (p_wm->wm[level].plane_en[i])
+			if (p_wm->wm[level].plane_en[i]
+			    && i915.enable_watermark)
 				temp |= PLANE_WM_EN;
 
 			r->plane[pipe][i][level] = temp;
@@ -3269,7 +3270,8 @@ static void skl_compute_wm_results(struct drm_device *dev,
 		temp |= p_wm->wm[level].plane_res_l[PLANE_CURSOR] << PLANE_WM_LINES_SHIFT;
 		temp |= p_wm->wm[level].plane_res_b[PLANE_CURSOR];
 
-		if (p_wm->wm[level].plane_en[PLANE_CURSOR])
+		if (p_wm->wm[level].plane_en[PLANE_CURSOR]
+		    && i915.enable_watermark)
 			temp |= PLANE_WM_EN;
 
 		r->plane[pipe][PLANE_CURSOR][level] = temp;
@@ -3281,7 +3283,8 @@ static void skl_compute_wm_results(struct drm_device *dev,
 		temp = 0;
 		temp |= p_wm->trans_wm.plane_res_l[i] << PLANE_WM_LINES_SHIFT;
 		temp |= p_wm->trans_wm.plane_res_b[i];
-		if (p_wm->trans_wm.plane_en[i])
+		if (p_wm->trans_wm.plane_en[i]
+		    && i915.enable_watermark)
 			temp |= PLANE_WM_EN;
 
 		r->plane_trans[pipe][i] = temp;
@@ -3290,7 +3293,8 @@ static void skl_compute_wm_results(struct drm_device *dev,
 	temp = 0;
 	temp |= p_wm->trans_wm.plane_res_l[PLANE_CURSOR] << PLANE_WM_LINES_SHIFT;
 	temp |= p_wm->trans_wm.plane_res_b[PLANE_CURSOR];
-	if (p_wm->trans_wm.plane_en[PLANE_CURSOR])
+	if (p_wm->trans_wm.plane_en[PLANE_CURSOR]
+	    && i915.enable_watermark)
 		temp |= PLANE_WM_EN;
 
 	r->plane_trans[pipe][PLANE_CURSOR] = temp;
-- 
2.4.3

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

             reply	other threads:[~2016-01-04 23:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 23:00 Rodrigo Vivi [this message]
2016-01-05  7:20 ` ✗ warning: Fi.CI.BAT 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=1451948403-2847-1-git-send-email-rodrigo.vivi@intel.com \
    --to=rodrigo.vivi@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.