Commit 1dc56576 authored by Ankit Nautiyal's avatar Ankit Nautiyal Committed by Ville Syrjälä

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: default avatarAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230427125605.487769-7-ankit.k.nautiyal@intel.com
parent 5814227d
...@@ -1139,6 +1139,9 @@ intel_dp_mode_valid(struct drm_connector *_connector, ...@@ -1139,6 +1139,9 @@ intel_dp_mode_valid(struct drm_connector *_connector,
if (target_clock > max_dotclk) if (target_clock > max_dotclk)
return MODE_CLOCK_HIGH; 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_link_clock = intel_dp_max_link_rate(intel_dp);
max_lanes = intel_dp_max_lane_count(intel_dp); max_lanes = intel_dp_max_lane_count(intel_dp);
...@@ -1146,13 +1149,6 @@ intel_dp_mode_valid(struct drm_connector *_connector, ...@@ -1146,13 +1149,6 @@ intel_dp_mode_valid(struct drm_connector *_connector,
mode_rate = intel_dp_link_required(target_clock, mode_rate = intel_dp_link_required(target_clock,
intel_dp_mode_min_output_bpp(connector, mode)); 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) && if (HAS_DSC(dev_priv) &&
drm_dp_sink_supports_dsc(intel_dp->dsc_dpcd)) { drm_dp_sink_supports_dsc(intel_dp->dsc_dpcd)) {
/* /*
...@@ -1161,6 +1157,10 @@ intel_dp_mode_valid(struct drm_connector *_connector, ...@@ -1161,6 +1157,10 @@ intel_dp_mode_valid(struct drm_connector *_connector,
*/ */
int pipe_bpp = intel_dp_dsc_compute_bpp(intel_dp, U8_MAX); 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)) { if (intel_dp_is_edp(intel_dp)) {
dsc_max_output_bpp = dsc_max_output_bpp =
drm_edp_dsc_sink_output_bpp(intel_dp->dsc_dpcd) >> 4; drm_edp_dsc_sink_output_bpp(intel_dp->dsc_dpcd) >> 4;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment