All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Govindapillai <vinod.govindapillai@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [PATCH v12 2/7] drm/i915: update the QGV point frequency calculations
Date: Thu,  1 Jun 2023 19:03:45 +0300	[thread overview]
Message-ID: <20230601160350.43888-3-vinod.govindapillai@intel.com> (raw)
In-Reply-To: <20230601160350.43888-1-vinod.govindapillai@intel.com>

From MTL onwwards, pcode locks the QGV point based on peak BW of
the intended QGV point passed by the driver. So the peak BW
calculation must match the value expected by the pcode. Update
the calculations as per the Bspec.

v2: use DIV_ROUND_* macro for the calculations (Ville)

v3: Use only DIV_ROUN_CLOSEST and remove divisor / 2 again

Bspec: 64636

Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
 drivers/gpu/drm/i915/display/intel_bw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_bw.c b/drivers/gpu/drm/i915/display/intel_bw.c
index ab405c48ca3a..61b3babf2d83 100644
--- a/drivers/gpu/drm/i915/display/intel_bw.c
+++ b/drivers/gpu/drm/i915/display/intel_bw.c
@@ -182,7 +182,7 @@ static int mtl_read_qgv_point_info(struct drm_i915_private *dev_priv,
 	val2 = intel_uncore_read(&dev_priv->uncore,
 				 MTL_MEM_SS_INFO_QGV_POINT_HIGH(point));
 	dclk = REG_FIELD_GET(MTL_DCLK_MASK, val);
-	sp->dclk = DIV_ROUND_UP((16667 * dclk), 1000);
+	sp->dclk = DIV_ROUND_CLOSEST(16667 * dclk, 1000);
 	sp->t_rp = REG_FIELD_GET(MTL_TRP_MASK, val);
 	sp->t_rcd = REG_FIELD_GET(MTL_TRCD_MASK, val);
 
-- 
2.34.1


  parent reply	other threads:[~2023-06-01 16:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-01 16:03 [Intel-gfx] [PATCH v12 0/7] mtl: add support for pmdemand Vinod Govindapillai
2023-06-01 16:03 ` [Intel-gfx] [PATCH v12 1/7] drm/i915: fix the derating percentage for MTL Vinod Govindapillai
2023-06-01 16:03 ` Vinod Govindapillai [this message]
2023-06-01 16:03 ` [Intel-gfx] [PATCH v12 3/7] drm/i915: store the peak bw per QGV point Vinod Govindapillai
2023-06-01 16:03 ` [Intel-gfx] [PATCH v12 4/7] drm/i915: extract intel_bw_check_qgv_points() Vinod Govindapillai
2023-06-01 16:03 ` [Intel-gfx] [PATCH v12 5/7] drm/i915: modify max_bw to return index to intel_bw_info Vinod Govindapillai
2023-06-01 16:03 ` [Intel-gfx] [PATCH v12 6/7] drm/i915/mtl: find the best QGV point for the SAGV configuration Vinod Govindapillai
2023-06-05  9:49   ` Imre Deak
2023-06-05  9:59     ` Govindapillai, Vinod
2023-06-01 16:03 ` [Intel-gfx] [PATCH v12 7/7] drm/i915/mtl: Add support for PM DEMAND Vinod Govindapillai
2023-06-05 10:09   ` Imre Deak
2023-06-01 21:53 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for mtl: add support for pmdemand (rev12) Patchwork
2023-06-01 21:53 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-06-01 22:12 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-06-04  0:50 ` [Intel-gfx] ✓ 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=20230601160350.43888-3-vinod.govindapillai@intel.com \
    --to=vinod.govindapillai@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.