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: Limit max link bpp properly to a fractional value on SST

The maximum link bpp - determined by the link BW for instance - can be
fractional, handle this properly during computing the link bpp on SST.

This keeps the pipe joiner specific maximum link bpp as a rounded-down
integer value still, changing that to a fractional value is left for
later.

v2: Align the min/max bpp value to the bpp step.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250509180340.554867-8-imre.deak@intel.com

+8 -9
+8 -9
drivers/gpu/drm/i915/display/intel_dp.c
··· 27 27 28 28 #include <linux/export.h> 29 29 #include <linux/i2c.h> 30 + #include <linux/log2.h> 31 + #include <linux/math.h> 30 32 #include <linux/notifier.h> 31 33 #include <linux/seq_buf.h> 32 34 #include <linux/slab.h> ··· 941 939 return ultrajoiner_ram_bits() / mode_hdisplay; 942 940 } 943 941 942 + /* TODO: return a bpp_x16 value */ 944 943 static 945 944 u32 get_max_compressed_bpp_with_joiner(struct intel_display *display, 946 945 u32 mode_clock, u32 mode_hdisplay, ··· 2156 2153 const struct intel_connector *connector = to_intel_connector(conn_state->connector); 2157 2154 const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode; 2158 2155 int output_bpp; 2159 - int dsc_min_bpp; 2160 - int dsc_max_bpp; 2161 2156 int min_bpp_x16, max_bpp_x16, bpp_step_x16; 2162 2157 int dsc_joiner_max_bpp; 2163 2158 int num_joined_pipes = intel_crtc_num_joined_pipes(pipe_config); 2164 2159 int bpp_x16; 2165 2160 int ret; 2166 2161 2167 - dsc_min_bpp = fxp_q4_to_int_roundup(limits->link.min_bpp_x16); 2168 - 2169 2162 dsc_joiner_max_bpp = get_max_compressed_bpp_with_joiner(display, adjusted_mode->clock, 2170 2163 adjusted_mode->hdisplay, 2171 2164 num_joined_pipes); 2172 - dsc_max_bpp = min(dsc_joiner_max_bpp, fxp_q4_to_int(limits->link.max_bpp_x16)); 2173 - 2174 - /* FIXME: remove the round trip via integers */ 2175 - min_bpp_x16 = fxp_q4_from_int(dsc_min_bpp); 2176 - max_bpp_x16 = fxp_q4_from_int(dsc_max_bpp); 2165 + max_bpp_x16 = min(fxp_q4_from_int(dsc_joiner_max_bpp), limits->link.max_bpp_x16); 2177 2166 2178 2167 bpp_step_x16 = intel_dp_dsc_bpp_step_x16(connector); 2179 2168 2180 2169 /* Compressed BPP should be less than the Input DSC bpp */ 2181 2170 output_bpp = intel_dp_output_bpp(pipe_config->output_format, pipe_bpp); 2182 2171 max_bpp_x16 = min(max_bpp_x16, fxp_q4_from_int(output_bpp) - bpp_step_x16); 2172 + 2173 + drm_WARN_ON(display->drm, !is_power_of_2(bpp_step_x16)); 2174 + min_bpp_x16 = round_up(limits->link.min_bpp_x16, bpp_step_x16); 2175 + max_bpp_x16 = round_down(max_bpp_x16, bpp_step_x16); 2183 2176 2184 2177 for (bpp_x16 = max_bpp_x16; bpp_x16 >= min_bpp_x16; bpp_x16 -= bpp_step_x16) { 2185 2178 if (!intel_dp_dsc_valid_compressed_bpp(intel_dp, bpp_x16))