Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH 9/9] drm/i915/dmc: Do not enable the pipe DMC on TGL when PSR is possible
Date: Wed, 11 Jun 2025 18:52:41 +0300	[thread overview]
Message-ID: <20250611155241.24191-10-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20250611155241.24191-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

On TGL/derivatives the pipe DMC state is lost when PG1 is disabled,
and the main DMC does not restore any of it. This means the state will
also be lost during PSR+DC5/6. It seems safest to not even enable the
pipe DMC in that case (the main DMC does restore the pipe DMC enable
bit in PIPEDMC_CONTROL_A for some reason).

Since pipe DMC is only needed for "fast LACE" on these platforms we aren't
actually losing anything here. In the future if we do want to enable
"fast LACE" we'll just have to remember that it won't be compatible with
PSR.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_dmc.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
index 0562ee1d0905..f918d08acd0d 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -663,6 +663,21 @@ static bool need_pipedmc_load_mmio(struct intel_display *display, enum pipe pipe
 	return DISPLAY_VER(display) >= 30 && pipe >= PIPE_C;
 }
 
+static bool can_enable_pipedmc(const struct intel_crtc_state *crtc_state)
+{
+	struct intel_display *display = to_intel_display(crtc_state);
+
+	/*
+	 * On TGL/derivatives pipe DMC state is lost when PG1 is disabled.
+	 * Do not even enable the pipe DMC when that can happen outside
+	 * of driver control (PSR+DC5/6).
+	 */
+	if (DISPLAY_VER(display) == 12 && crtc_state->has_psr)
+		return false;
+
+	return true;
+}
+
 void intel_dmc_enable_pipe(const struct intel_crtc_state *crtc_state)
 {
 	struct intel_display *display = to_intel_display(crtc_state);
@@ -673,6 +688,11 @@ void intel_dmc_enable_pipe(const struct intel_crtc_state *crtc_state)
 	if (!is_valid_dmc_id(dmc_id) || !has_dmc_id_fw(display, dmc_id))
 		return;
 
+	if (!can_enable_pipedmc(crtc_state)) {
+		intel_dmc_disable_pipe(crtc_state);
+		return;
+	}
+
 	if (need_pipedmc_load_program(display))
 		dmc_load_program(display, dmc_id);
 	else if (need_pipedmc_load_mmio(display, pipe))
-- 
2.49.0


  parent reply	other threads:[~2025-06-11 15:53 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-11 15:52 [PATCH 0/9] drm/i915/dmc: Deal with loss of pipe DMC state Ville Syrjala
2025-06-11 15:52 ` [PATCH 1/9] drm/i915/dmc: Limit pipe DMC clock gating w/a to just ADL/DG2/MTL Ville Syrjala
2025-06-11 15:52 ` [PATCH 2/9] drm/i915/dmc: Parametrize MTL_PIPEDMC_GATING_DIS Ville Syrjala
2025-06-11 15:52 ` [PATCH 3/9] drm/i915/dmc: Shuffle code around Ville Syrjala
2025-06-11 15:52 ` [PATCH 4/9] drm/i915/dmc: Extract dmc_load_program() Ville Syrjala
2025-06-12 20:16   ` Shankar, Uma
2025-06-13 14:18     ` Ville Syrjälä
2025-06-17 18:58       ` Shankar, Uma
2025-06-11 15:52 ` [PATCH 5/9] drm/i915/dmc: Reload pipe DMC state on TGL when enabling pipe A Ville Syrjala
2025-06-12 20:32   ` Shankar, Uma
2025-06-13 14:09     ` Ville Syrjälä
2025-06-17 18:51       ` Shankar, Uma
2025-06-11 15:52 ` [PATCH 6/9] drm/i915/dmc: Reload pipe DMC MMIO registers for pipe C/D on PTL+ Ville Syrjala
2025-06-11 15:52 ` [PATCH 7/9] drm/i915/dmc: Assert DMC is loaded harder Ville Syrjala
2025-06-12 20:55   ` Shankar, Uma
2025-06-11 15:52 ` [PATCH 8/9] drm/i915/dmc: Pass crtc_state to intel_dmc_{enable, disable}_pipe() Ville Syrjala
2025-06-12 20:58   ` Shankar, Uma
2025-06-11 15:52 ` Ville Syrjala [this message]
2025-06-12 21:02   ` [PATCH 9/9] drm/i915/dmc: Do not enable the pipe DMC on TGL when PSR is possible Shankar, Uma
2025-06-11 17:01 ` ✗ CI.checkpatch: warning for drm/i915/dmc: Deal with loss of pipe DMC state Patchwork
2025-06-11 17:02 ` ✓ CI.KUnit: success " Patchwork
2025-06-11 17:13 ` ✓ CI.Build: " Patchwork
2025-06-11 17:16 ` ✓ CI.Hooks: " Patchwork
2025-06-11 17:17 ` ✗ CI.checksparse: warning " Patchwork
2025-06-11 17:40 ` ✓ Xe.CI.BAT: success " Patchwork
2025-06-11 21:46 ` ✗ Xe.CI.Full: failure " 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=20250611155241.24191-10-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.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