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

diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.c 
b/drivers/gpu/drm/i915/display/intel_display_wa.c
index 65ad82c67301..7bfa8216f1d7 100644
--- a/drivers/gpu/drm/i915/display/intel_display_wa.c
+++ b/drivers/gpu/drm/i915/display/intel_display_wa.c
@@ -100,6 +100,8 @@ bool __intel_display_wa(struct intel_display *display, enum 
intel_display_wa wa,
                        IS_DISPLAY_STEP(display, STEP_A0, STEP_A2);
        case INTEL_DISPLAY_WA_14014143976:
                return IS_DISPLAY_STEP(display, STEP_E0, STEP_FOREVER);
+       case INTEL_DISPLAY_WA_14016740474:
+               return IS_DISPLAY_VERx100_STEP(display, 1400, STEP_A0, STEP_C0);
        case INTEL_DISPLAY_WA_14020863754:
                return DISPLAY_VERx100(display) == 3000 ||
                        DISPLAY_VERx100(display) == 2000 ||
diff --git a/drivers/gpu/drm/i915/display/intel_display_wa.h 
b/drivers/gpu/drm/i915/display/intel_display_wa.h
index 44d06b074b0f..2589b53139b1 100644
--- a/drivers/gpu/drm/i915/display/intel_display_wa.h
+++ b/drivers/gpu/drm/i915/display/intel_display_wa.h
@@ -39,6 +39,7 @@ enum intel_display_wa {
        INTEL_DISPLAY_WA_14011508470,
        INTEL_DISPLAY_WA_14011765242,
        INTEL_DISPLAY_WA_14014143976,
+       INTEL_DISPLAY_WA_14016740474,
        INTEL_DISPLAY_WA_14020863754,
        INTEL_DISPLAY_WA_14025769978,
        INTEL_DISPLAY_WA_15013987218,
diff --git a/drivers/gpu/drm/i915/display/intel_pmdemand.c 
b/drivers/gpu/drm/i915/display/intel_pmdemand.c
index dc44a7a169c1..3b7471df6287 100644
--- a/drivers/gpu/drm/i915/display/intel_pmdemand.c
+++ b/drivers/gpu/drm/i915/display/intel_pmdemand.c
@@ -15,6 +15,7 @@
 #include "intel_display_regs.h"
 #include "intel_display_trace.h"
 #include "intel_display_utils.h"
+#include "intel_display_wa.h"
 #include "intel_pmdemand.h"
 #include "intel_step.h"
 #include "skl_watermark.h"
@@ -129,9 +130,10 @@ int intel_pmdemand_init(struct intel_display *display)
                                     &pmdemand_state->base,
                                     &intel_pmdemand_funcs);
 
-       if (IS_DISPLAY_VERx100_STEP(display, 1400, STEP_A0, STEP_C0))
-               /* Wa_14016740474 */
-               intel_de_rmw(display, XELPD_CHICKEN_DCPR_3, 0, 
DMD_RSP_TIMEOUT_DISABLE);
+       /* Wa_14016740474 */
+       if (intel_display_wa(display, 14016740474))
+               intel_de_rmw(display, XELPD_CHICKEN_DCPR_3, 0,
+                            DMD_RSP_TIMEOUT_DISABLE);
 
        return 0;
 }
-- 
2.51.0

Reply via email to