@@ -2188,29 +2188,25 @@ int intel_dp_dsc_compute_config(struct intel_dp *intel_dp,
21882188 return 0 ;
21892189}
21902190
2191- static int
2192- intel_dp_compute_link_config (struct intel_encoder * encoder ,
2193- struct intel_crtc_state * pipe_config ,
2194- struct drm_connector_state * conn_state ,
2195- bool respect_downstream_limits )
2191+ static void
2192+ intel_dp_compute_config_limits (struct intel_dp * intel_dp ,
2193+ struct intel_crtc_state * crtc_state ,
2194+ bool respect_downstream_limits ,
2195+ struct link_config_limits * limits )
21962196{
2197- struct drm_i915_private * i915 = to_i915 (encoder -> base .dev );
2198- struct intel_crtc * crtc = to_intel_crtc (pipe_config -> uapi .crtc );
2197+ struct drm_i915_private * i915 = dp_to_i915 (intel_dp );
21992198 const struct drm_display_mode * adjusted_mode =
2200- & pipe_config -> hw .adjusted_mode ;
2201- struct intel_dp * intel_dp = enc_to_intel_dp (encoder );
2202- struct link_config_limits limits ;
2203- bool joiner_needs_dsc = false;
2204- int ret ;
2199+ & crtc_state -> hw .adjusted_mode ;
22052200
2206- limits . min_rate = intel_dp_common_rate (intel_dp , 0 );
2207- limits . max_rate = intel_dp_max_link_rate (intel_dp );
2201+ limits -> min_rate = intel_dp_common_rate (intel_dp , 0 );
2202+ limits -> max_rate = intel_dp_max_link_rate (intel_dp );
22082203
2209- limits . min_lane_count = 1 ;
2210- limits . max_lane_count = intel_dp_max_lane_count (intel_dp );
2204+ limits -> min_lane_count = 1 ;
2205+ limits -> max_lane_count = intel_dp_max_lane_count (intel_dp );
22112206
2212- limits .min_bpp = intel_dp_min_bpp (pipe_config -> output_format );
2213- limits .max_bpp = intel_dp_max_bpp (intel_dp , pipe_config , respect_downstream_limits );
2207+ limits -> min_bpp = intel_dp_min_bpp (crtc_state -> output_format );
2208+ limits -> max_bpp = intel_dp_max_bpp (intel_dp , crtc_state ,
2209+ respect_downstream_limits );
22142210
22152211 if (intel_dp -> use_max_params ) {
22162212 /*
@@ -2221,16 +2217,35 @@ intel_dp_compute_link_config(struct intel_encoder *encoder,
22212217 * configuration, and typically on older panels these
22222218 * values correspond to the native resolution of the panel.
22232219 */
2224- limits . min_lane_count = limits . max_lane_count ;
2225- limits . min_rate = limits . max_rate ;
2220+ limits -> min_lane_count = limits -> max_lane_count ;
2221+ limits -> min_rate = limits -> max_rate ;
22262222 }
22272223
2228- intel_dp_adjust_compliance_config (intel_dp , pipe_config , & limits );
2224+ intel_dp_adjust_compliance_config (intel_dp , crtc_state , limits );
22292225
22302226 drm_dbg_kms (& i915 -> drm , "DP link computation with max lane count %i "
22312227 "max rate %d max bpp %d pixel clock %iKHz\n" ,
2232- limits .max_lane_count , limits .max_rate ,
2233- limits .max_bpp , adjusted_mode -> crtc_clock );
2228+ limits -> max_lane_count , limits -> max_rate ,
2229+ limits -> max_bpp , adjusted_mode -> crtc_clock );
2230+ }
2231+
2232+ static int
2233+ intel_dp_compute_link_config (struct intel_encoder * encoder ,
2234+ struct intel_crtc_state * pipe_config ,
2235+ struct drm_connector_state * conn_state ,
2236+ bool respect_downstream_limits )
2237+ {
2238+ struct drm_i915_private * i915 = to_i915 (encoder -> base .dev );
2239+ struct intel_crtc * crtc = to_intel_crtc (pipe_config -> uapi .crtc );
2240+ const struct drm_display_mode * adjusted_mode =
2241+ & pipe_config -> hw .adjusted_mode ;
2242+ struct intel_dp * intel_dp = enc_to_intel_dp (encoder );
2243+ struct link_config_limits limits ;
2244+ bool joiner_needs_dsc = false;
2245+ int ret ;
2246+
2247+ intel_dp_compute_config_limits (intel_dp , pipe_config ,
2248+ respect_downstream_limits , & limits );
22342249
22352250 if (intel_dp_need_bigjoiner (intel_dp , adjusted_mode -> crtc_hdisplay ,
22362251 adjusted_mode -> crtc_clock ))
0 commit comments