Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/display: convert W/As in intel_psr.c to new framework

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-15-luciano.coelho@intel.com
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>

+25 -14
+13 -2
drivers/gpu/drm/i915/display/intel_display_wa.c
··· 112 112 return DISPLAY_VER(display) == 20; 113 113 case INTEL_DISPLAY_WA_15018326506: 114 114 return display->platform.battlemage; 115 + case INTEL_DISPLAY_WA_16011303918: 116 + case INTEL_DISPLAY_WA_22011320316: 117 + return display->platform.alderlake_p && 118 + IS_DISPLAY_STEP(display, STEP_A0, STEP_B0); 119 + case INTEL_DISPLAY_WA_16011181250: 120 + return display->platform.rocketlake || display->platform.alderlake_s || 121 + display->platform.dg2; 115 122 case INTEL_DISPLAY_WA_16011342517: 116 123 return display->platform.alderlake_p && 117 124 IS_DISPLAY_STEP(display, STEP_A0, STEP_D0); ··· 128 121 return intel_display_needs_wa_16023588340(display); 129 122 case INTEL_DISPLAY_WA_16025573575: 130 123 return intel_display_needs_wa_16025573575(display); 124 + case INTEL_DISPLAY_WA_16025596647: 125 + return DISPLAY_VER(display) == 20 && 126 + IS_DISPLAY_VERx100_STEP(display, 3000, 127 + STEP_A0, STEP_B0); 131 128 case INTEL_DISPLAY_WA_18034343758: 132 129 return DISPLAY_VER(display) == 20 || 133 130 (display->platform.pantherlake && 134 131 IS_DISPLAY_STEP(display, STEP_A0, STEP_B0)); 135 132 case INTEL_DISPLAY_WA_22010178259: 136 133 return DISPLAY_VER(display) == 12; 137 - case INTEL_DISPLAY_WA_22011320316: 134 + case INTEL_DISPLAY_WA_22012278275: 138 135 return display->platform.alderlake_p && 139 - IS_DISPLAY_STEP(display, STEP_A0, STEP_B0); 136 + IS_DISPLAY_STEP(display, STEP_A0, STEP_E0); 140 137 case INTEL_DISPLAY_WA_22014263786: 141 138 return IS_DISPLAY_VERx100(display, 1100, 1400); 142 139 case INTEL_DISPLAY_WA_22021048059:
+4
drivers/gpu/drm/i915/display/intel_display_wa.h
··· 44 44 INTEL_DISPLAY_WA_14025769978, 45 45 INTEL_DISPLAY_WA_15013987218, 46 46 INTEL_DISPLAY_WA_15018326506, 47 + INTEL_DISPLAY_WA_16011181250, 48 + INTEL_DISPLAY_WA_16011303918, 47 49 INTEL_DISPLAY_WA_16011342517, 48 50 INTEL_DISPLAY_WA_16011863758, 49 51 INTEL_DISPLAY_WA_16023588340, 50 52 INTEL_DISPLAY_WA_16025573575, 53 + INTEL_DISPLAY_WA_16025596647, 51 54 INTEL_DISPLAY_WA_18034343758, 52 55 INTEL_DISPLAY_WA_22010178259, 53 56 INTEL_DISPLAY_WA_22011320316, 57 + INTEL_DISPLAY_WA_22012278275, 54 58 INTEL_DISPLAY_WA_22012358565, 55 59 INTEL_DISPLAY_WA_22014263786, 56 60 INTEL_DISPLAY_WA_22021048059,
+8 -12
drivers/gpu/drm/i915/display/intel_psr.c
··· 40 40 #include "intel_display_rpm.h" 41 41 #include "intel_display_types.h" 42 42 #include "intel_display_utils.h" 43 + #include "intel_display_wa.h" 43 44 #include "intel_dmc.h" 44 45 #include "intel_dp.h" 45 46 #include "intel_dp_aux.h" ··· 1083 1082 } 1084 1083 1085 1084 /* Wa_22012278275:adl-p */ 1086 - if (display->platform.alderlake_p && IS_DISPLAY_STEP(display, STEP_A0, STEP_E0)) { 1085 + if (intel_display_wa(display, INTEL_DISPLAY_WA_22012278275)) { 1087 1086 static const u8 map[] = { 1088 1087 2, /* 5 lines */ 1089 1088 1, /* 6 lines */ ··· 1264 1263 return; 1265 1264 1266 1265 /* Wa_16011303918:adl-p */ 1267 - if (display->platform.alderlake_p && IS_DISPLAY_STEP(display, STEP_A0, STEP_B0)) 1266 + if (intel_display_wa(display, INTEL_DISPLAY_WA_16011303918)) 1268 1267 return; 1269 1268 1270 1269 /* ··· 1546 1545 } 1547 1546 1548 1547 /* Wa_16011181250 */ 1549 - if (display->platform.rocketlake || display->platform.alderlake_s || 1550 - display->platform.dg2) { 1548 + if (intel_display_wa(display, INTEL_DISPLAY_WA_16011181250)) { 1551 1549 drm_dbg_kms(display->drm, 1552 1550 "PSR2 is defeatured for this platform\n"); 1553 1551 return false; ··· 1828 1828 u8 active_pipes = 0; 1829 1829 1830 1830 /* Wa_16025596647 */ 1831 - if (DISPLAY_VER(display) != 20 && 1832 - !IS_DISPLAY_VERx100_STEP(display, 3000, STEP_A0, STEP_B0)) 1831 + if (!intel_display_wa(display, INTEL_DISPLAY_WA_16025596647)) 1833 1832 return; 1834 1833 1835 1834 /* Not needed by Panel Replay */ ··· 4013 4014 */ 4014 4015 void intel_psr_notify_dc5_dc6(struct intel_display *display) 4015 4016 { 4016 - if (DISPLAY_VER(display) != 20 && 4017 - !IS_DISPLAY_VERx100_STEP(display, 3000, STEP_A0, STEP_B0)) 4017 + if (!intel_display_wa(display, INTEL_DISPLAY_WA_16025596647)) 4018 4018 return; 4019 4019 4020 4020 schedule_work(&display->psr_dc5_dc6_wa_work); ··· 4028 4030 */ 4029 4031 void intel_psr_dc5_dc6_wa_init(struct intel_display *display) 4030 4032 { 4031 - if (DISPLAY_VER(display) != 20 && 4032 - !IS_DISPLAY_VERx100_STEP(display, 3000, STEP_A0, STEP_B0)) 4033 + if (!intel_display_wa(display, INTEL_DISPLAY_WA_16025596647)) 4033 4034 return; 4034 4035 4035 4036 INIT_WORK(&display->psr_dc5_dc6_wa_work, psr_dc5_dc6_wa_work); ··· 4049 4052 struct intel_display *display = to_intel_display(state); 4050 4053 struct intel_encoder *encoder; 4051 4054 4052 - if (DISPLAY_VER(display) != 20 && 4053 - !IS_DISPLAY_VERx100_STEP(display, 3000, STEP_A0, STEP_B0)) 4055 + if (!intel_display_wa(display, INTEL_DISPLAY_WA_16025596647)) 4054 4056 return; 4055 4057 4056 4058 for_each_intel_encoder_with_psr(display->drm, encoder) {