Commit 52ecd48b authored by Ankit Nautiyal's avatar Ankit Nautiyal
Browse files

drm/i915/dp: Add helper to get min sdp guardband



Add a helper to compute vblank time needed for transmitting specific
DisplayPort SDPs like PPS, GAMUT_METADATA, and VSC_EXT. Latency is
based on line count per packet type.

This will be used to ensure adequate guardband when features like DSC/HDR
are enabled.

v2: Correct the lines required for PPS SDP. (Jouni)

Bspec: 70151
Signed-off-by: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: default avatarJouni Högander <jouni.hogander@intel.com>
Link: https://lore.kernel.org/r/20251017123504.2247954-3-ankit.k.nautiyal@intel.com
parent 77fb33cb
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
@@ -7002,3 +7002,39 @@ int intel_dp_compute_config_late(struct intel_encoder *encoder,

	return 0;
}

static
int intel_dp_get_lines_for_sdp(u32 type)
{
	switch (type) {
	case DP_SDP_VSC_EXT_VESA:
	case DP_SDP_VSC_EXT_CEA:
		return 10;
	case HDMI_PACKET_TYPE_GAMUT_METADATA:
		return 8;
	case DP_SDP_PPS:
		return 7;
	default:
		break;
	}

	return 0;
}

int intel_dp_sdp_min_guardband(const struct intel_crtc_state *crtc_state,
			       bool assume_all_enabled)
{
	int sdp_guardband = 0;

	if (assume_all_enabled ||
	    crtc_state->infoframes.enable &
	    intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA))
		sdp_guardband = max(sdp_guardband,
				    intel_dp_get_lines_for_sdp(HDMI_PACKET_TYPE_GAMUT_METADATA));

	if (assume_all_enabled ||
	    crtc_state->dsc.compression_enable)
		sdp_guardband = max(sdp_guardband, intel_dp_get_lines_for_sdp(DP_SDP_PPS));

	return sdp_guardband;
}
+2 −0
Original line number Diff line number Diff line
@@ -223,5 +223,7 @@ bool intel_dp_in_hdr_mode(const struct drm_connector_state *conn_state);
int intel_dp_compute_config_late(struct intel_encoder *encoder,
				 struct intel_crtc_state *crtc_state,
				 struct drm_connector_state *conn_state);
int intel_dp_sdp_min_guardband(const struct intel_crtc_state *crtc_state,
			       bool assume_all_enabled);

#endif /* __INTEL_DP_H__ */