intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/display: Implement wa_14024400148
@ 2025-04-15  9:46 Nemesa Garg
  2025-04-15 10:33 ` Jani Nikula
  2025-04-15 12:56 ` ✗ i915.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Nemesa Garg @ 2025-04-15  9:46 UTC (permalink / raw)
  To: intel-gfx, intel-xe, mika.kahola; +Cc: Nemesa Garg

Workaround recommend use polling method
for pm_demand to finish as to avoid timeout.

Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
---
 drivers/gpu/drm/i915/display/intel_pmdemand.c | 27 +++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_pmdemand.c b/drivers/gpu/drm/i915/display/intel_pmdemand.c
index d22b5469672d..610d05b73b99 100644
--- a/drivers/gpu/drm/i915/display/intel_pmdemand.c
+++ b/drivers/gpu/drm/i915/display/intel_pmdemand.c
@@ -478,6 +478,22 @@ static bool intel_pmdemand_req_complete(struct intel_display *display)
 		 XELPDP_PMDEMAND_REQ_ENABLE);
 }
 
+static void intel_pmdemand_poll(struct intel_display *display)
+{
+	const unsigned int timeout_ms = 10;
+	u32 status;
+	int ret;
+
+	ret = intel_de_wait_custom(display, XELPDP_INITIATE_PMDEMAND_REQUEST(1),
+				   XELPDP_PMDEMAND_REQ_ENABLE, 0,
+				   50, timeout_ms, &status);
+
+	if (ret == -ETIMEDOUT)
+		drm_err(display->drm,
+			"timeout within %ums (status 0x%08x)\n",
+			timeout_ms, status);
+}
+
 static void intel_pmdemand_wait(struct intel_display *display)
 {
 	if (!wait_event_timeout(display->pmdemand.waitqueue,
@@ -508,7 +524,11 @@ void intel_pmdemand_program_dbuf(struct intel_display *display,
 	intel_de_rmw(display, XELPDP_INITIATE_PMDEMAND_REQUEST(1), 0,
 		     XELPDP_PMDEMAND_REQ_ENABLE);
 
-	intel_pmdemand_wait(display);
+	/* Wa_14024400148 For lnl use polling method */
+	if (DISPLAY_VER(display) == 20)
+		intel_pmdemand_poll(display);
+	else
+		intel_pmdemand_wait(display);
 
 unlock:
 	mutex_unlock(&display->pmdemand.lock);
@@ -617,7 +637,10 @@ intel_pmdemand_program_params(struct intel_display *display,
 	intel_de_rmw(display, XELPDP_INITIATE_PMDEMAND_REQUEST(1), 0,
 		     XELPDP_PMDEMAND_REQ_ENABLE);
 
-	intel_pmdemand_wait(display);
+	if (DISPLAY_VER(display) == 20)
+		intel_pmdemand_poll(display);
+	else
+		intel_pmdemand_wait(display);
 
 unlock:
 	mutex_unlock(&display->pmdemand.lock);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-15 12:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-15  9:46 [PATCH] drm/i915/display: Implement wa_14024400148 Nemesa Garg
2025-04-15 10:33 ` Jani Nikula
2025-04-15 12:56 ` ✗ i915.CI.BAT: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).