Convert the low-hanging fruits of workaround checks to the workaround
framework.  Instead of having display structure checks for the
workarounds all over, concentrate the checks in intel_wa.c.

Signed-off-by: Luca Coelho <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_display_wa.c |  4 ++++
 drivers/gpu/drm/i915/display/intel_display_wa.h |  1 +
 drivers/gpu/drm/i915/display/intel_flipq.c      | 13 +++----------
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.c 
b/drivers/gpu/drm/i915/display/intel_display_wa.c
index 1459e5df1dd3..3aa79e607bf8 100644
--- a/drivers/gpu/drm/i915/display/intel_display_wa.c
+++ b/drivers/gpu/drm/i915/display/intel_display_wa.c
@@ -117,6 +117,10 @@ bool __intel_display_wa(struct intel_display *display, 
enum intel_display_wa wa,
                return intel_display_needs_wa_16023588340(display);
        case INTEL_DISPLAY_WA_16025573575:
                return intel_display_needs_wa_16025573575(display);
+       case INTEL_DISPLAY_WA_18034343758:
+               return DISPLAY_VER(display) == 20 ||
+                       (display->platform.pantherlake &&
+                        IS_DISPLAY_STEP(display, STEP_A0, STEP_B0));
        case INTEL_DISPLAY_WA_22010178259:
                return DISPLAY_VER(display) == 12;
        case INTEL_DISPLAY_WA_22011320316:
diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.h 
b/drivers/gpu/drm/i915/display/intel_display_wa.h
index 87fe404962ce..57345d0abe1c 100644
--- a/drivers/gpu/drm/i915/display/intel_display_wa.h
+++ b/drivers/gpu/drm/i915/display/intel_display_wa.h
@@ -46,6 +46,7 @@ enum intel_display_wa {
        INTEL_DISPLAY_WA_16011863758,
        INTEL_DISPLAY_WA_16023588340,
        INTEL_DISPLAY_WA_16025573575,
+       INTEL_DISPLAY_WA_18034343758,
        INTEL_DISPLAY_WA_22010178259,
        INTEL_DISPLAY_WA_22011320316,
        INTEL_DISPLAY_WA_22012358565,
diff --git a/drivers/gpu/drm/i915/display/intel_flipq.c 
b/drivers/gpu/drm/i915/display/intel_flipq.c
index 1e9550cb66a3..234fe22498f0 100644
--- a/drivers/gpu/drm/i915/display/intel_flipq.c
+++ b/drivers/gpu/drm/i915/display/intel_flipq.c
@@ -12,6 +12,7 @@
 #include "intel_display_core.h"
 #include "intel_display_types.h"
 #include "intel_display_utils.h"
+#include "intel_display_wa.h"
 #include "intel_dmc.h"
 #include "intel_dmc_regs.h"
 #include "intel_dsb.h"
@@ -447,19 +448,11 @@ void intel_flipq_add(struct intel_crtc *crtc,
        intel_flipq_sw_dmc_wake(crtc);
 }
 
-/* Wa_18034343758 */
-static bool need_dmc_halt_wa(struct intel_display *display)
-{
-       return DISPLAY_VER(display) == 20 ||
-               (display->platform.pantherlake &&
-                IS_DISPLAY_STEP(display, STEP_A0, STEP_B0));
-}
-
 void intel_flipq_wait_dmc_halt(struct intel_dsb *dsb, struct intel_crtc *crtc)
 {
        struct intel_display *display = to_intel_display(crtc);
 
-       if (need_dmc_halt_wa(display))
+       if (intel_display_wa(display, 18034343758))
                intel_dsb_wait_usec(dsb, 2);
 }
 
@@ -467,6 +460,6 @@ void intel_flipq_unhalt_dmc(struct intel_dsb *dsb, struct 
intel_crtc *crtc)
 {
        struct intel_display *display = to_intel_display(crtc);
 
-       if (need_dmc_halt_wa(display))
+       if (intel_display_wa(display, 18034343758))
                intel_dsb_reg_write(dsb, PIPEDMC_CTL(crtc->pipe), 0);
 }
-- 
2.51.0

Reply via email to