Commit 700f1c1b authored by Luca Coelho's avatar Luca Coelho
Browse files

drm/i915/display: convert W/As in intel_flipq.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: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20260305100100.332956-12-luciano.coelho@intel.com


Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent 305a60de
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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:
+1 −0
Original line number Diff line number Diff line
@@ -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,
+3 −10
Original line number Diff line number Diff line
@@ -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, INTEL_DISPLAY_WA_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, INTEL_DISPLAY_WA_18034343758))
		intel_dsb_reg_write(dsb, PIPEDMC_CTL(crtc->pipe), 0);
}