]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/display: convert audio workaround to new framework
authorLuca Coelho <luciano.coelho@intel.com>
Thu, 5 Mar 2026 09:59:05 +0000 (11:59 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Mon, 9 Mar 2026 10:32:46 +0000 (12:32 +0200)
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_display_wa.c.

Acked-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20260305100100.332956-3-luciano.coelho@intel.com
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/gpu/drm/i915/display/intel_audio.c
drivers/gpu/drm/i915/display/intel_display_wa.c
drivers/gpu/drm/i915/display/intel_display_wa.h

index 5f3c175afdd27747c56693f7ed36a79f8d31a613..081627e0d9171faf6ef63a6eb656204b8ad9bcc4 100644 (file)
@@ -37,6 +37,7 @@
 #include "intel_crtc.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
+#include "intel_display_wa.h"
 #include "intel_lpe_audio.h"
 
 /**
@@ -184,17 +185,6 @@ static const struct hdmi_aud_ncts hdmi_aud_ncts_36bpp[] = {
        { 192000, TMDS_445_5M, 20480, 371250 },
 };
 
-/*
- * WA_14020863754: Implement Audio Workaround
- * Corner case with Min Hblank Fix can cause audio hang
- */
-static bool needs_wa_14020863754(struct intel_display *display)
-{
-       return DISPLAY_VERx100(display) == 3000 ||
-               DISPLAY_VERx100(display) == 2000 ||
-               DISPLAY_VERx100(display) == 1401;
-}
-
 /* get AUD_CONFIG_PIXEL_CLOCK_HDMI_* value for mode */
 static u32 audio_config_hdmi_pixel_clock(const struct intel_crtc_state *crtc_state)
 {
@@ -440,7 +430,11 @@ static void hsw_audio_codec_disable(struct intel_encoder *encoder,
        intel_de_rmw(display, HSW_AUD_PIN_ELD_CP_VLD,
                     AUDIO_OUTPUT_ENABLE(cpu_transcoder), 0);
 
-       if (needs_wa_14020863754(display))
+       /*
+        * WA_14020863754: Implement Audio Workaround
+        * Corner case with Min Hblank Fix can cause audio hang
+        */
+       if (intel_display_wa(display, INTEL_DISPLAY_WA_14020863754))
                intel_de_rmw(display, AUD_CHICKENBIT_REG3, DACBE_DISABLE_MIN_HBLANK_FIX, 0);
 
        intel_audio_sdp_split_update(old_crtc_state, false);
@@ -572,7 +566,11 @@ static void hsw_audio_codec_enable(struct intel_encoder *encoder,
 
        intel_audio_sdp_split_update(crtc_state, true);
 
-       if (needs_wa_14020863754(display))
+       /*
+        * WA_14020863754: Implement Audio Workaround
+        * Corner case with Min Hblank Fix can cause audio hang
+        */
+       if (intel_display_wa(display, INTEL_DISPLAY_WA_14020863754))
                intel_de_rmw(display, AUD_CHICKENBIT_REG3, 0, DACBE_DISABLE_MIN_HBLANK_FIX);
 
        /* Enable audio presence detect */
index 1d8340b36c013c2c69bb2053746b5d29c707d2fa..b383bfad3af63ab17d37d2bc4c16a70f93faa9ed 100644 (file)
@@ -74,6 +74,10 @@ bool __intel_display_wa(struct intel_display *display, enum intel_display_wa wa,
                        DISPLAY_VERx100(display) == 3500;
        case INTEL_DISPLAY_WA_14011503117:
                return DISPLAY_VER(display) == 13;
+       case INTEL_DISPLAY_WA_14020863754:
+               return DISPLAY_VERx100(display) == 3000 ||
+                       DISPLAY_VERx100(display) == 2000 ||
+                       DISPLAY_VERx100(display) == 1401;
        case INTEL_DISPLAY_WA_14025769978:
                return DISPLAY_VER(display) == 35;
        case INTEL_DISPLAY_WA_15018326506:
index 06c1f62c0f6d11d0cd9ff0616e42096c301c44cc..b1bcc18dd2c8eed2e0ee663c25ef0d8d0a4e211c 100644 (file)
@@ -29,6 +29,7 @@ bool intel_display_needs_wa_16023588340(struct intel_display *display);
 enum intel_display_wa {
        INTEL_DISPLAY_WA_13012396614,
        INTEL_DISPLAY_WA_14011503117,
+       INTEL_DISPLAY_WA_14020863754,
        INTEL_DISPLAY_WA_14025769978,
        INTEL_DISPLAY_WA_15018326506,
        INTEL_DISPLAY_WA_16023588340,