@@ -1651,10 +1651,6 @@ static int gen11_dsi_compute_config(struct intel_encoder *encoder,
if (ret)
return ret;
- ret = intel_panel_fitting(pipe_config, conn_state);
- if (ret)
- return ret;
-
adjusted_mode->flags = 0;
/* Dual link goes to trancoder DSI'0' */
@@ -3090,6 +3090,7 @@ intel_dp_compute_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config,
struct drm_connector_state *conn_state)
{
+ struct intel_display *display = to_intel_display(encoder);
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
struct intel_atomic_state *state = to_intel_atomic_state(conn_state->state);
struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
@@ -3131,9 +3132,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
if (ret)
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 (HAS_GMCH(display)) {
+ ret = intel_gmch_panel_fitting(pipe_config, conn_state);
if (ret)
return ret;
}
@@ -2374,12 +2374,6 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder,
return ret;
}
- if (intel_hdmi_is_ycbcr420(pipe_config)) {
- ret = intel_panel_fitting(pipe_config, conn_state);
- if (ret)
- return ret;
- }
-
pipe_config->limited_color_range =
intel_hdmi_limited_color_range(pipe_config, conn_state);
@@ -416,6 +416,7 @@ static int intel_lvds_compute_config(struct intel_encoder *encoder,
struct intel_crtc_state *crtc_state,
struct drm_connector_state *conn_state)
{
+ struct intel_display *display = to_intel_display(encoder);
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
struct intel_lvds_encoder *lvds_encoder = to_lvds_encoder(encoder);
struct intel_connector *connector = lvds_encoder->attached_connector;
@@ -465,10 +466,11 @@ static int intel_lvds_compute_config(struct intel_encoder *encoder,
if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
return -EINVAL;
- ret = intel_panel_fitting(crtc_state, conn_state);
- if (ret)
- return ret;
-
+ if (HAS_GMCH(display)) {
+ ret = intel_gmch_panel_fitting(crtc_state, conn_state);
+ if (ret)
+ return ret;
+ }
/*
* XXX: It would be nice to support lower refresh rates on the
* panels to reduce power consumption, and perhaps match the
@@ -545,13 +545,14 @@ static int gmch_panel_fitting(struct intel_crtc_state *crtc_state,
return intel_gmch_pfit_check_timings(crtc_state);
}
-int intel_panel_fitting(struct intel_crtc_state *crtc_state,
- const struct drm_connector_state *conn_state)
+int intel_gmch_panel_fitting(struct intel_crtc_state *crtc_state,
+ const struct drm_connector_state *conn_state)
{
- struct intel_display *display = to_intel_display(crtc_state);
+ return gmch_panel_fitting(crtc_state, conn_state);
+}
- if (HAS_GMCH(display))
- return gmch_panel_fitting(crtc_state, conn_state);
- else
- return pch_panel_fitting(crtc_state, conn_state);
+int intel_pch_panel_fitting(struct intel_crtc_state *crtc_state,
+ const struct drm_connector_state *conn_state)
+{
+ return pch_panel_fitting(crtc_state, conn_state);
}
@@ -9,7 +9,9 @@
struct drm_connector_state;
struct intel_crtc_state;
-int intel_panel_fitting(struct intel_crtc_state *crtc_state,
- const struct drm_connector_state *conn_state);
+int intel_gmch_panel_fitting(struct intel_crtc_state *crtc_state,
+ const struct drm_connector_state *conn_state);
+int intel_pch_panel_fitting(struct intel_crtc_state *crtc_state,
+ const struct drm_connector_state *conn_state);
#endif /* __INTEL_PFIT_H__ */
@@ -269,6 +269,7 @@ static int intel_dsi_compute_config(struct intel_encoder *encoder,
struct intel_crtc_state *pipe_config,
struct drm_connector_state *conn_state)
{
+ struct intel_display *display = to_intel_display(encoder);
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder);
struct intel_connector *intel_connector = intel_dsi->attached_connector;
@@ -283,9 +284,11 @@ static int intel_dsi_compute_config(struct intel_encoder *encoder,
if (ret)
return ret;
- ret = intel_panel_fitting(pipe_config, conn_state);
- if (ret)
- return ret;
+ if (HAS_GMCH(display)) {
+ ret = intel_gmch_panel_fitting(pipe_config, conn_state);
+ if (ret)
+ return ret;
+ }
if (adjusted_mode->flags & DRM_MODE_FLAG_DBLSCAN)
return -EINVAL;
For all encoders add gmch_panel_fitting and remove pch_panel_fitting as it will be called from pipe_config after joiner calculation is done. -v5: Nuke GMCH check from few places [Ville] Signed-off-by: Nemesa Garg <nemesa.garg@intel.com> --- drivers/gpu/drm/i915/display/icl_dsi.c | 4 ---- drivers/gpu/drm/i915/display/intel_dp.c | 6 +++--- drivers/gpu/drm/i915/display/intel_hdmi.c | 6 ------ drivers/gpu/drm/i915/display/intel_lvds.c | 10 ++++++---- drivers/gpu/drm/i915/display/intel_pfit.c | 15 ++++++++------- drivers/gpu/drm/i915/display/intel_pfit.h | 6 ++++-- drivers/gpu/drm/i915/display/vlv_dsi.c | 9 ++++++--- 7 files changed, 27 insertions(+), 29 deletions(-)