mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
drm/i915/dp: Rearrange check for illegal mode and comments in mode_valid
Check for MODE_H_ILLEGAL before calculating max rates, lanes etc. Move comments about compressed bpp U6.4 format closer to where it is used. Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230427125605.487769-7-ankit.k.nautiyal@intel.com
This commit is contained in:
committed by
Ville Syrjälä
parent
5814227de1
commit
1dc565764d
@@ -1139,6 +1139,9 @@ intel_dp_mode_valid(struct drm_connector *_connector,
|
||||
if (target_clock > max_dotclk)
|
||||
return MODE_CLOCK_HIGH;
|
||||
|
||||
if (intel_dp_hdisplay_bad(dev_priv, mode->hdisplay))
|
||||
return MODE_H_ILLEGAL;
|
||||
|
||||
max_link_clock = intel_dp_max_link_rate(intel_dp);
|
||||
max_lanes = intel_dp_max_lane_count(intel_dp);
|
||||
|
||||
@@ -1146,13 +1149,6 @@ intel_dp_mode_valid(struct drm_connector *_connector,
|
||||
mode_rate = intel_dp_link_required(target_clock,
|
||||
intel_dp_mode_min_output_bpp(connector, mode));
|
||||
|
||||
if (intel_dp_hdisplay_bad(dev_priv, mode->hdisplay))
|
||||
return MODE_H_ILLEGAL;
|
||||
|
||||
/*
|
||||
* Output bpp is stored in 6.4 format so right shift by 4 to get the
|
||||
* integer value since we support only integer values of bpp.
|
||||
*/
|
||||
if (HAS_DSC(dev_priv) &&
|
||||
drm_dp_sink_supports_dsc(intel_dp->dsc_dpcd)) {
|
||||
/*
|
||||
@@ -1161,6 +1157,10 @@ intel_dp_mode_valid(struct drm_connector *_connector,
|
||||
*/
|
||||
int pipe_bpp = intel_dp_dsc_compute_bpp(intel_dp, U8_MAX);
|
||||
|
||||
/*
|
||||
* Output bpp is stored in 6.4 format so right shift by 4 to get the
|
||||
* integer value since we support only integer values of bpp.
|
||||
*/
|
||||
if (intel_dp_is_edp(intel_dp)) {
|
||||
dsc_max_output_bpp =
|
||||
drm_edp_dsc_sink_output_bpp(intel_dp->dsc_dpcd) >> 4;
|
||||
|
||||
Reference in New Issue
Block a user