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/dp: Factor out intel_dp_link_bw_overhead()

Factor out intel_dp_link_bw_overhead(), used later for BW calculation
during DP SST mode validation and state computation.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20251215192357.172201-7-imre.deak@intel.com

Imre Deak 78cfaaa1 1867564b

+34 -16
+26
drivers/gpu/drm/i915/display/intel_dp.c
··· 424 424 return 1; 425 425 } 426 426 427 + int intel_dp_link_bw_overhead(int link_clock, int lane_count, int hdisplay, 428 + int dsc_slice_count, int bpp_x16, unsigned long flags) 429 + { 430 + int overhead; 431 + 432 + WARN_ON(flags & ~(DRM_DP_BW_OVERHEAD_MST | DRM_DP_BW_OVERHEAD_SSC_REF_CLK | 433 + DRM_DP_BW_OVERHEAD_FEC)); 434 + 435 + if (drm_dp_is_uhbr_rate(link_clock)) 436 + flags |= DRM_DP_BW_OVERHEAD_UHBR; 437 + 438 + if (dsc_slice_count) 439 + flags |= DRM_DP_BW_OVERHEAD_DSC; 440 + 441 + overhead = drm_dp_bw_overhead(lane_count, hdisplay, 442 + dsc_slice_count, 443 + bpp_x16, 444 + flags); 445 + 446 + /* 447 + * TODO: clarify whether a minimum required by the fixed FEC overhead 448 + * in the bspec audio programming sequence is required here. 449 + */ 450 + return max(overhead, intel_dp_bw_fec_overhead(flags & DRM_DP_BW_OVERHEAD_FEC)); 451 + } 452 + 427 453 /* 428 454 * The required data bandwidth for a mode with given pixel clock and bpp. This 429 455 * is the required net bandwidth independent of the data bandwidth efficiency.
+2
drivers/gpu/drm/i915/display/intel_dp.h
··· 117 117 bool intel_dp_source_supports_tps3(struct intel_display *display); 118 118 bool intel_dp_source_supports_tps4(struct intel_display *display); 119 119 120 + int intel_dp_link_bw_overhead(int link_clock, int lane_count, int hdisplay, 121 + int dsc_slice_count, int bpp_x16, unsigned long flags); 120 122 int intel_dp_link_required(int pixel_clock, int bpp); 121 123 int intel_dp_effective_data_rate(int pixel_clock, int bpp_x16, 122 124 int bw_overhead);
+6 -16
drivers/gpu/drm/i915/display/intel_dp_mst.c
··· 180 180 const struct drm_display_mode *adjusted_mode = 181 181 &crtc_state->hw.adjusted_mode; 182 182 unsigned long flags = DRM_DP_BW_OVERHEAD_MST; 183 - int overhead; 184 183 185 - flags |= intel_dp_is_uhbr(crtc_state) ? DRM_DP_BW_OVERHEAD_UHBR : 0; 186 184 flags |= ssc ? DRM_DP_BW_OVERHEAD_SSC_REF_CLK : 0; 187 185 flags |= crtc_state->fec_enable ? DRM_DP_BW_OVERHEAD_FEC : 0; 188 186 189 - if (dsc_slice_count) 190 - flags |= DRM_DP_BW_OVERHEAD_DSC; 191 - 192 - overhead = drm_dp_bw_overhead(crtc_state->lane_count, 193 - adjusted_mode->hdisplay, 194 - dsc_slice_count, 195 - bpp_x16, 196 - flags); 197 - 198 - /* 199 - * TODO: clarify whether a minimum required by the fixed FEC overhead 200 - * in the bspec audio programming sequence is required here. 201 - */ 202 - return max(overhead, intel_dp_bw_fec_overhead(crtc_state->fec_enable)); 187 + return intel_dp_link_bw_overhead(crtc_state->port_clock, 188 + crtc_state->lane_count, 189 + adjusted_mode->hdisplay, 190 + dsc_slice_count, 191 + bpp_x16, 192 + flags); 203 193 } 204 194 205 195 static void intel_dp_mst_compute_m_n(const struct intel_crtc_state *crtc_state,