diff mbox series

[v2,2/4] drm/i915/display: don't allow DMC wakelock on older hardware

Message ID 20240314073752.1245879-3-luciano.coelho@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/display: DMC wakelock implementation | expand

Commit Message

Luca Coelho March 14, 2024, 7:37 a.m. UTC
Only allow running DMC wakelock code if the display version is 20 or
greater.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dmc_wl.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
index 7e5d325f5d55..6eea81a76fa4 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
@@ -120,6 +120,9 @@  void intel_dmc_wl_enable(struct drm_i915_private *i915)
 	struct intel_dmc_wl *wl = &i915->display.wl;
 	unsigned long flags;
 
+	if (DISPLAY_VER(i915) < 20)
+		return;
+
 	spin_lock_irqsave(&wl->lock, flags);
 
 	if (wl->enabled)
@@ -144,6 +147,9 @@  void intel_dmc_wl_disable(struct drm_i915_private *i915)
 	struct intel_dmc_wl *wl = &i915->display.wl;
 	unsigned long flags;
 
+	if (DISPLAY_VER(i915) < 20)
+		return;
+
 	flush_delayed_work(&wl->work);
 
 	spin_lock_irqsave(&wl->lock, flags);
@@ -173,6 +179,9 @@  void intel_dmc_wl_get(struct drm_i915_private *i915, i915_reg_t reg)
 	struct intel_dmc_wl *wl = &i915->display.wl;
 	unsigned long flags;
 
+	if (DISPLAY_VER(i915) < 20)
+		return;
+
 	if (!intel_dmc_wl_check_range(reg.reg))
 		return;
 
@@ -205,6 +214,9 @@  void intel_dmc_wl_put(struct drm_i915_private *i915, i915_reg_t reg)
 	struct intel_dmc_wl *wl = &i915->display.wl;
 	unsigned long flags;
 
+	if (DISPLAY_VER(i915) < 20)
+		return;
+
 	if (!intel_dmc_wl_check_range(reg.reg))
 		return;