diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-09-24 21:41:56 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2020-10-16 19:44:45 +0300 |
commit | 0af0b841c6489b8ef1adea62fca6874bc918d97c (patch) | |
tree | e52e4bdbdad40d8e46acffc7ce9effe7b6a4e77c | |
parent | ebde5f89b32a258f15a2d094b02b6de0bbdf5beb (diff) |
drm/i915: Inline intel_dp_ycbcr420_config()
intel_dp_ycbcr420_config() is rather pointless. Just inline it
directly into intel_dp_compute_config(). This gets rid of the
ugly double assignment of output_format.
Not really sure what the best policy would be when the user
supplies a mode classified by the display as "YCbCr 4:2:0
only", but we know that we can't do YCbCr 4:2:0 output. For
now keep the current behaviour of just silently upgrade
it to RGB 4:4:4.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200924184156.24491-3-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_dp.c | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index cd2931d5ec25..52075a241eaf 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -615,7 +615,8 @@ intel_dp_output_format(struct drm_connector *connector, struct intel_dp *intel_dp = intel_attached_dp(to_intel_connector(connector)); const struct drm_display_info *info = &connector->display_info; - if (!drm_mode_is_420_only(info, mode)) + if (!connector->ycbcr_420_allowed || + !drm_mode_is_420_only(info, mode)) return INTEL_OUTPUT_FORMAT_RGB; if (intel_dp->dfp.ycbcr_444_to_420) @@ -2437,25 +2438,6 @@ intel_dp_compute_link_config(struct intel_encoder *encoder, return 0; } -static int -intel_dp_ycbcr420_config(struct intel_crtc_state *crtc_state, - const struct drm_connector_state *conn_state) -{ - struct drm_connector *connector = conn_state->connector; - const struct drm_display_mode *adjusted_mode = - &crtc_state->hw.adjusted_mode; - - if (!connector->ycbcr_420_allowed) - return 0; - - crtc_state->output_format = intel_dp_output_format(connector, adjusted_mode); - - if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_YCBCR420) - return 0; - - return intel_pch_panel_fitting(crtc_state, conn_state); -} - bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { @@ -2705,11 +2687,14 @@ intel_dp_compute_config(struct intel_encoder *encoder, if (HAS_PCH_SPLIT(dev_priv) && !HAS_DDI(dev_priv) && port != PORT_A) pipe_config->has_pch_encoder = true; - pipe_config->output_format = INTEL_OUTPUT_FORMAT_RGB; + pipe_config->output_format = intel_dp_output_format(&intel_connector->base, + adjusted_mode); - ret = intel_dp_ycbcr420_config(pipe_config, conn_state); - if (ret) - return ret; + if (pipe_config->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) { + ret = intel_pch_panel_fitting(pipe_config, conn_state); + if (ret) + return ret; + } if (!intel_dp_port_has_audio(dev_priv, port)) pipe_config->has_audio = false; |