All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 4/6] drm/i915: transition WMs ask for Selected Result Blocks
Date: Thu,  4 Oct 2018 16:15:58 -0700	[thread overview]
Message-ID: <20181004231600.14101-5-paulo.r.zanoni@intel.com> (raw)
In-Reply-To: <20181004231600.14101-1-paulo.r.zanoni@intel.com>

The transition watermarks ask for Selected Result Blocks (the real
value), not Result Blocks (the integer value). Given how ceilings are
applied in both the non-transition and the transition watermarks
calculations, we can get away with assuming that Selected Result
Blocks is actually Result Blocks minus 1 without any rounding errors.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 40ce99c455f3..14f13a371989 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -4874,7 +4874,7 @@ static void skl_compute_transition_wm(struct intel_crtc_state *cstate,
 	const struct drm_i915_private *dev_priv = to_i915(dev);
 	uint16_t trans_min, trans_y_tile_min;
 	const uint16_t trans_amount = 10; /* This is configurable amount */
-	uint16_t trans_offset_b, res_blocks;
+	uint16_t wm0_sel_res_b, trans_offset_b, res_blocks;
 
 	if (!cstate->base.active)
 		goto exit;
@@ -4893,13 +4893,25 @@ static void skl_compute_transition_wm(struct intel_crtc_state *cstate,
 
 	trans_offset_b = trans_min + trans_amount;
 
+	/*
+	 * The spec asks for Selected Result Blocks for wm0 (the real value),
+	 * not Result Blocks (the integer value). Pay attention to the capital
+	 * letters. The value wm_l0->plane_res_b is actually Result Blocks, but
+	 * since Result Blocks is the ceiling of Selected Result Blocks plus 1,
+	 * and since we later will have to get the ceiling of the sum in the
+	 * transition watermarks calculation, we can just pretend Selected
+	 * Result Blocks is Result Blocks minus 1 and it should work for the
+	 * current platforms.
+	 */
+	wm0_sel_res_b = wm_l0->plane_res_b - 1;
+
 	if (wp->y_tiled) {
 		trans_y_tile_min = (uint16_t) mul_round_up_u32_fixed16(2,
 							wp->y_tile_minimum);
-		res_blocks = max(wm_l0->plane_res_b, trans_y_tile_min) +
+		res_blocks = max(wm0_sel_res_b, trans_y_tile_min) +
 				trans_offset_b;
 	} else {
-		res_blocks = wm_l0->plane_res_b + trans_offset_b;
+		res_blocks = wm0_sel_res_b + trans_offset_b;
 
 		/* WA BUG:1938466 add one block for non y-tile planes */
 		if (IS_CNL_REVID(dev_priv, CNL_REVID_A0, CNL_REVID_A0))
-- 
2.14.4

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

  parent reply	other threads:[~2018-10-04 23:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 23:15 [PATCH 0/6] Watermarks small fixes/improvements Paulo Zanoni
2018-10-04 23:15 ` [PATCH 1/6] drm/i915: don't apply Display WAs 1125 and 1126 to GLK/CNL+ Paulo Zanoni
2018-10-09 23:55   ` Matt Roper
2018-10-11 17:22     ` Paulo Zanoni
2018-10-04 23:15 ` [PATCH 2/6] drm/i915: fix the transition minimums for gen9+ watermarks Paulo Zanoni
2018-10-09 23:55   ` Matt Roper
2018-10-04 23:15 ` [PATCH 3/6] drm/i915: fix the watermark result selection on glk/gen10+ Paulo Zanoni
2018-10-09 23:55   ` Matt Roper
2018-10-10  1:38     ` Matt Roper
2018-10-04 23:15 ` Paulo Zanoni [this message]
2018-10-10  1:36   ` [PATCH 4/6] drm/i915: transition WMs ask for Selected Result Blocks Matt Roper
2018-10-04 23:15 ` [PATCH 5/6] drm/i915: don't write PLANE_BUF_CFG twice every time Paulo Zanoni
2018-10-10  1:51   ` Matt Roper
2018-10-04 23:16 ` [PATCH 6/6] drm/i915: promote ddb update message to DRM_DEBUG_KMS Paulo Zanoni
2018-10-10  1:55   ` Matt Roper
2018-10-04 23:37 ` ✗ Fi.CI.SPARSE: warning for Watermarks small fixes/improvements Patchwork
2018-10-04 23:51 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-05  7:15 ` ✓ 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=20181004231600.14101-5-paulo.r.zanoni@intel.com \
    --to=paulo.r.zanoni@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.