summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2022-03-22 14:00:08 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2022-04-05 11:14:29 +0300
commitdd934010759422f294e09ecc16861a9eaa2caa07 (patch)
treef04c4aa662839298bcd85184594056b3464204af /drivers/gpu/drm
parentca4ca33917af95e8a6e8ba92566ee610d4f44bbc (diff)
drm/i915/dp: Reorder intel_dp_compute_config() a bit
Consolidate the double pfit call, and reorder things so that intel_dp_output_format() and intel_dp_compute_link_config() are back-to-back. They are intimately related, and will need to be called twice to properly handle the "4:2:0 also" modes. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-6-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/display/intel_dp.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 39c4f1f3b641..e37334f48ae2 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1883,15 +1883,6 @@ intel_dp_compute_config(struct intel_encoder *encoder,
if (HAS_PCH_SPLIT(dev_priv) && !HAS_DDI(dev_priv) && encoder->port != PORT_A)
pipe_config->has_pch_encoder = true;
- pipe_config->output_format = intel_dp_output_format(&intel_connector->base,
- adjusted_mode);
-
- if (pipe_config->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) {
- ret = intel_panel_fitting(pipe_config, conn_state);
- if (ret)
- return ret;
- }
-
pipe_config->has_audio = intel_dp_has_audio(encoder, pipe_config, conn_state);
fixed_mode = intel_panel_fixed_mode(intel_connector, adjusted_mode);
@@ -1899,10 +1890,6 @@ intel_dp_compute_config(struct intel_encoder *encoder,
ret = intel_panel_compute_config(intel_connector, adjusted_mode);
if (ret)
return ret;
-
- ret = intel_panel_fitting(pipe_config, conn_state);
- if (ret)
- return ret;
}
if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
@@ -1918,10 +1905,20 @@ intel_dp_compute_config(struct intel_encoder *encoder,
if (intel_dp_hdisplay_bad(dev_priv, adjusted_mode->crtc_hdisplay))
return -EINVAL;
+ pipe_config->output_format = intel_dp_output_format(&intel_connector->base,
+ adjusted_mode);
+
ret = intel_dp_compute_link_config(encoder, pipe_config, conn_state);
if (ret < 0)
return ret;
+ if ((intel_dp_is_edp(intel_dp) && fixed_mode) ||
+ pipe_config->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) {
+ ret = intel_panel_fitting(pipe_config, conn_state);
+ if (ret)
+ return ret;
+ }
+
pipe_config->limited_color_range =
intel_dp_limited_color_range(pipe_config, conn_state);