Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/dmc_wl: Do not check for DMC payload
@ 2025-01-24 19:12 Gustavo Sousa
  2025-01-24 21:36 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Gustavo Sousa @ 2025-01-24 19:12 UTC (permalink / raw)
  To: intel-gfx, intel-xe

Enabling and disabling of DMC wakelock is already coupled with enabling
and disabling of dynamic DC states, which already depend on the DMC
being properly loaded. As such, we do not need to check if we already
have a DMC payload parsed in __intel_dmc_wl_supported().

Furthermore, the presence of such a check causes inconsistencies in the
refcount if the following sequence of events happen:

  1. A call to one of the register accessors from intel_de.h is done
     before the DMC payload is parsed. That causes intel_dmc_wl_get() to
     be called. Suppose the register offset qualifies as needing the
     wakelock.

     In normal circumstances, the refcount would be incremented, but,
     because __intel_dmc_wl_supported() returns false, the refcount is
     untouched.

  2. In a separate worker thread, the DMC firmware is parsed. Parsing of
     the DMC payload is finished before the corresponding
     intel_dmc_wl_put() from (1) is called.

  3. When in the context of (1), intel_dmc_wl_put() gets called, now we
     have __intel_dmc_wl_supported() returning true and we hit the
     warning, because the code doesn't expect a zero refcount.

Let's remove that check, since it is unnecessary and causes the
inconsistency illustrated above.

Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dmc_wl.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
index 43884740f8ea..9be6ad11ff5d 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
@@ -10,7 +10,6 @@
 #include "i915_drv.h"
 #include "i915_reg.h"
 #include "intel_de.h"
-#include "intel_dmc.h"
 #include "intel_dmc_regs.h"
 #include "intel_dmc_wl.h"
 
@@ -282,7 +281,7 @@ static bool intel_dmc_wl_check_range(struct intel_display *display,
 
 static bool __intel_dmc_wl_supported(struct intel_display *display)
 {
-	return display->params.enable_dmc_wl && intel_dmc_has_payload(display);
+	return display->params.enable_dmc_wl;
 }
 
 static void intel_dmc_wl_sanitize_param(struct intel_display *display)
-- 
2.48.1


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

end of thread, other threads:[~2025-02-05 14:19 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-24 19:12 [PATCH] drm/i915/dmc_wl: Do not check for DMC payload Gustavo Sousa
2025-01-24 21:36 ` ✓ CI.Patch_applied: success for " Patchwork
2025-01-24 21:36 ` ✓ CI.checkpatch: " Patchwork
2025-01-24 21:37 ` ✓ CI.KUnit: " Patchwork
2025-01-24 21:54 ` ✓ CI.Build: " Patchwork
2025-01-24 21:57 ` ✓ CI.Hooks: " Patchwork
2025-01-24 22:00 ` ✓ CI.checksparse: " Patchwork
2025-01-24 22:34 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-25  4:42 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-05 11:57   ` Gustavo Sousa
2025-01-30  9:41 ` [PATCH] " Luca Coelho
2025-01-30 14:18 ` Krzysztof Karas
2025-01-31 20:16   ` Gustavo Sousa
2025-01-31 23:49     ` Lucas De Marchi
2025-02-03 11:44       ` Gustavo Sousa
2025-02-05  9:07         ` Krzysztof Karas
2025-02-05 14:18 ` Gustavo Sousa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox