From: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: [RFC v1 2/4] drm/i915/watermark: Add WM0 prefill latency
Date: Tue, 12 Nov 2024 14:20:37 +0530 [thread overview]
Message-ID: <20241112085039.1258860-3-mitulkumar.ajitkumar.golani@intel.com> (raw)
In-Reply-To: <20241112085039.1258860-1-mitulkumar.ajitkumar.golani@intel.com>
Calculate WM0 prefill latency which accounts for maximum time
to fill data buffer up to watermark 0.
Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
---
drivers/gpu/drm/i915/display/skl_watermark.c | 21 ++++++++++++++++++++
drivers/gpu/drm/i915/display/skl_watermark.h | 1 +
2 files changed, 22 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/skl_watermark.c b/drivers/gpu/drm/i915/display/skl_watermark.c
index d3bbf335c749..8afa24943333 100644
--- a/drivers/gpu/drm/i915/display/skl_watermark.c
+++ b/drivers/gpu/drm/i915/display/skl_watermark.c
@@ -2260,6 +2260,27 @@ static int skl_max_wm0_lines(const struct intel_crtc_state *crtc_state)
return wm0_lines;
}
+int skl_calc_wm0_prefill_latency(struct intel_crtc_state *crtc_state)
+{
+ struct intel_display *display = to_intel_display(crtc_state);
+ int cdclk_prefill_latency, wm0_prefill_latency;
+ int linetime =
+ DIV_ROUND_UP(crtc_state->hw.adjusted_mode.htotal * 1000,
+ crtc_state->hw.adjusted_mode.crtc_clock);
+ /*
+ * TODO: DIV_ROUND_UP will also round off to 1, so need to
+ * check upon if this can be eliminated here
+ */
+ cdclk_prefill_latency =
+ MIN(1, DIV_ROUND_UP(crtc_state->pixel_rate,
+ 2 * display->cdclk.hw.cdclk));
+ wm0_prefill_latency =
+ 20 + (linetime * skl_max_wm0_lines(crtc_state) * cdclk_prefill_latency);
+
+ return intel_usecs_to_scanlines(&crtc_state->hw.adjusted_mode,
+ wm0_prefill_latency);
+}
+
static int skl_max_wm_level_for_vblank(struct intel_crtc_state *crtc_state,
int wm0_lines)
{
diff --git a/drivers/gpu/drm/i915/display/skl_watermark.h b/drivers/gpu/drm/i915/display/skl_watermark.h
index e73baec94873..9495a142fbe5 100644
--- a/drivers/gpu/drm/i915/display/skl_watermark.h
+++ b/drivers/gpu/drm/i915/display/skl_watermark.h
@@ -23,6 +23,7 @@ struct skl_wm_level;
u8 intel_enabled_dbuf_slices_mask(struct drm_i915_private *i915);
+int skl_calc_wm0_prefill_latency(struct intel_crtc_state *crtc_state);
void intel_sagv_pre_plane_update(struct intel_atomic_state *state);
void intel_sagv_post_plane_update(struct intel_atomic_state *state);
bool intel_can_enable_sagv(struct drm_i915_private *i915,
--
2.46.0
next prev parent reply other threads:[~2024-11-12 8:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 8:50 [RFC v1 0/4] Update VRR guardband for HRR panel Mitul Golani
2024-11-12 8:50 ` [RFC v1 1/4] drm/i915/scaler: Calculate scaler prefill latency Mitul Golani
2024-11-28 9:31 ` Garg, Nemesa
2024-11-12 8:50 ` Mitul Golani [this message]
2024-11-12 8:50 ` [RFC v1 3/4] drm/i915/psr: Add latency for PSR Mitul Golani
2024-11-12 8:50 ` [RFC v1 4/4] display/vrr: Update guardband based on enabled latency Mitul Golani
2024-11-12 9:31 ` ✓ CI.Patch_applied: success for Update VRR guardband for HRR panel Patchwork
2024-11-12 9:31 ` ✓ CI.checkpatch: " Patchwork
2024-11-12 9:32 ` ✓ CI.KUnit: " Patchwork
2024-11-12 9:44 ` ✓ CI.Build: " Patchwork
2024-11-12 9:46 ` ✓ CI.Hooks: " Patchwork
2024-11-12 9:47 ` ✗ CI.checksparse: warning " Patchwork
2024-11-12 10:21 ` ✓ CI.BAT: success " Patchwork
2024-11-12 11:30 ` ✗ CI.FULL: failure " Patchwork
2024-11-22 7:53 ` [RFC v1 0/4] " Ville Syrjälä
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=20241112085039.1258860-3-mitulkumar.ajitkumar.golani@intel.com \
--to=mitulkumar.ajitkumar.golani@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox