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_ddi.c        | 4 ++--
 drivers/gpu/drm/i915/display/intel_display_wa.c | 3 +++
 drivers/gpu/drm/i915/display/intel_display_wa.h | 1 +
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c 
b/drivers/gpu/drm/i915/display/intel_ddi.c
index 94ae583e907f..c96438245b39 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -52,6 +52,7 @@
 #include "intel_display_regs.h"
 #include "intel_display_types.h"
 #include "intel_display_utils.h"
+#include "intel_display_wa.h"
 #include "intel_dkl_phy.h"
 #include "intel_dkl_phy_regs.h"
 #include "intel_dp.h"
@@ -1401,8 +1402,7 @@ static void tgl_dkl_phy_set_signal_levels(struct 
intel_encoder *encoder,
                int level;
 
                /* Wa_16011342517:adl-p */
-               if (display->platform.alderlake_p &&
-                   IS_DISPLAY_STEP(display, STEP_A0, STEP_D0)) {
+               if (intel_display_wa(display, 16011342517)) {
                        if ((intel_encoder_is_hdmi(encoder) &&
                             crtc_state->port_clock == 594000) ||
                             (intel_encoder_is_dp(encoder) &&
diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.c 
b/drivers/gpu/drm/i915/display/intel_display_wa.c
index 8473cb25c92e..e2bbc3a90eca 100644
--- a/drivers/gpu/drm/i915/display/intel_display_wa.c
+++ b/drivers/gpu/drm/i915/display/intel_display_wa.c
@@ -99,6 +99,9 @@ bool __intel_display_wa(struct intel_display *display, enum 
intel_display_wa wa,
                return DISPLAY_VER(display) == 20;
        case INTEL_DISPLAY_WA_15018326506:
                return display->platform.battlemage;
+       case INTEL_DISPLAY_WA_16011342517:
+               return display->platform.alderlake_p &&
+                       IS_DISPLAY_STEP(display, STEP_A0, STEP_D0);
        case INTEL_DISPLAY_WA_16023588340:
                return intel_display_needs_wa_16023588340(display);
        case INTEL_DISPLAY_WA_16025573575:
diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.h 
b/drivers/gpu/drm/i915/display/intel_display_wa.h
index 7e5f5a466e2a..b9c088025fd7 100644
--- a/drivers/gpu/drm/i915/display/intel_display_wa.h
+++ b/drivers/gpu/drm/i915/display/intel_display_wa.h
@@ -38,6 +38,7 @@ enum intel_display_wa {
        INTEL_DISPLAY_WA_14025769978,
        INTEL_DISPLAY_WA_15013987218,
        INTEL_DISPLAY_WA_15018326506,
+       INTEL_DISPLAY_WA_16011342517,
        INTEL_DISPLAY_WA_16023588340,
        INTEL_DISPLAY_WA_16025573575,
        INTEL_DISPLAY_WA_22010178259,
-- 
2.51.0

Reply via email to