From: "Jouni Högander" <jouni.hogander@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: "Jouni Högander" <jouni.hogander@intel.com>
Subject: [RFC PATCH 01/11] drm/i915/display: Add new interface for getting dc_state
Date: Fri, 7 Mar 2025 12:52:27 +0200 [thread overview]
Message-ID: <20250307105237.2909849-2-jouni.hogander@intel.com> (raw)
In-Reply-To: <20250307105237.2909849-1-jouni.hogander@intel.com>
To implement workaround for underrun on idle PSR HW issue (Wa_16025596647)
we need to have current configured DC state available. Add new interface
for this purpose.
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
---
.../drm/i915/display/intel_display_power.c | 29 +++++++++++++++++++
.../drm/i915/display/intel_display_power.h | 1 +
2 files changed, 30 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c b/drivers/gpu/drm/i915/display/intel_display_power.c
index f7171e6932dc..6dfe85a5528f 100644
--- a/drivers/gpu/drm/i915/display/intel_display_power.c
+++ b/drivers/gpu/drm/i915/display/intel_display_power.c
@@ -322,6 +322,35 @@ void intel_display_power_set_target_dc_state(struct intel_display *display,
mutex_unlock(&power_domains->lock);
}
+/**
+ * intel_display_power_get_current_dc_state - Set target dc state.
+ * @display: display device
+ *
+ * This function set the "DC off" power well target_dc_state,
+ * based upon this target_dc_stste, "DC off" power well will
+ * enable desired DC state.
+ */
+u32 intel_display_power_get_current_dc_state(struct intel_display *display)
+{
+ struct i915_power_well *power_well;
+ struct i915_power_domains *power_domains = &display->power.domains;
+ u32 current_dc_state = DC_STATE_DISABLE;
+
+ mutex_lock(&power_domains->lock);
+ power_well = lookup_power_well(display, SKL_DISP_DC_OFF);
+
+ if (drm_WARN_ON(display->drm, !power_well))
+ goto unlock;
+
+ current_dc_state = intel_power_well_is_enabled(display, power_well) ?
+ DC_STATE_DISABLE : power_domains->target_dc_state;
+
+unlock:
+ mutex_unlock(&power_domains->lock);
+
+ return current_dc_state;
+}
+
static void __async_put_domains_mask(struct i915_power_domains *power_domains,
struct intel_power_domain_mask *mask)
{
diff --git a/drivers/gpu/drm/i915/display/intel_display_power.h b/drivers/gpu/drm/i915/display/intel_display_power.h
index 1b53d67f9b60..f8813b0e16df 100644
--- a/drivers/gpu/drm/i915/display/intel_display_power.h
+++ b/drivers/gpu/drm/i915/display/intel_display_power.h
@@ -183,6 +183,7 @@ void intel_display_power_suspend(struct intel_display *display);
void intel_display_power_resume(struct intel_display *display);
void intel_display_power_set_target_dc_state(struct intel_display *display,
u32 state);
+u32 intel_display_power_get_current_dc_state(struct intel_display *display);
bool intel_display_power_is_enabled(struct intel_display *display,
enum intel_display_power_domain domain);
--
2.43.0
next prev parent reply other threads:[~2025-03-07 10:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 10:52 [RFC PATCH 00/11] Underrun on idle PSR workaround Jouni Högander
2025-03-07 10:52 ` Jouni Högander [this message]
2025-04-07 10:22 ` [RFC PATCH 01/11] drm/i915/display: Add new interface for getting dc_state Kahola, Mika
2025-03-07 10:52 ` [RFC PATCH 02/11] drm/i915/psr: Store enabled non-psr pipes into intel_crtc_state Jouni Högander
2025-04-07 10:37 ` Kahola, Mika
2025-03-07 10:52 ` [RFC PATCH 03/11] drm/i915/dmc: Add PIPEDMC_EVT_CTL register definition Jouni Högander
2025-04-07 11:09 ` Kahola, Mika
2025-03-07 10:52 ` [RFC PATCH 04/11] drm/i915/dmc: Add PIPEDMC_BLOCK_PKGC_SW definitions Jouni Högander
2025-03-07 10:52 ` [RFC PATCH 05/11] drm/i915/psr: Write PIPEDMC_BLOCK_PKGC_SW when enabling PSR Jouni Högander
2025-03-07 10:52 ` [RFC PATCH 06/11] drm/i915/psr: Add mechanism to notify PSR of pipe enable/disable Jouni Högander
2025-03-07 10:52 ` [RFC PATCH 07/11] drm/i915/psr: Add mechanism to notify PSR of DC5/6 enable disable Jouni Högander
2025-03-07 10:52 ` [RFC PATCH 08/11] drm/i915/psr: Add interface to notify PSR of vblank enable/disable Jouni Högander
2025-03-07 10:52 ` [RFC PATCH 09/11] drm/i915/psr: Apply underrun on PSR idle workaround Jouni Högander
2025-03-07 10:52 ` [RFC PATCH 10/11] drm/i915/display: Rename intel_psr_needs_block_dc_vblank Jouni Högander
2025-03-07 10:52 ` [RFC PATCH 11/11] drm/i915/display: Rename vblank DC workaround functions and variables Jouni Högander
2025-03-07 11:10 ` ✓ CI.Patch_applied: success for Underrun on idle PSR workaround Patchwork
2025-03-07 11:11 ` ✗ CI.checkpatch: warning " Patchwork
2025-03-07 11:12 ` ✓ CI.KUnit: success " Patchwork
2025-03-07 11:29 ` ✓ CI.Build: " Patchwork
2025-03-07 11:31 ` ✓ CI.Hooks: " Patchwork
2025-03-07 11:33 ` ✗ CI.checksparse: warning " Patchwork
2025-03-07 11:53 ` ✓ Xe.CI.BAT: success " Patchwork
2025-03-08 4:41 ` ✗ 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=20250307105237.2909849-2-jouni.hogander@intel.com \
--to=jouni.hogander@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