[PATCH] drm/i915/display: Call panel_fitting function from pipe_config

Nemesa Garg nemesa.garg at intel.com
Thu Jul 4 05:59:24 UTC 2024


In panel fitter/pipe scaler scenario the pch_pfit configuration
currently takes place before we account for bigjoiner.
So once the calculation for bigjoiner is done, proper values
of width and height can be used for panel fitting.

Signed-off-by: Nemesa Garg <nemesa.garg at intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 20 ++++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_dp.c      |  7 -------
 2 files changed, 20 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index c2c388212e2e..21dc6902f4d6 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -4642,6 +4642,8 @@ intel_modeset_pipe_config(struct intel_atomic_state *state,
 		intel_atomic_get_new_crtc_state(state, crtc);
 	struct drm_connector *connector;
 	struct drm_connector_state *connector_state;
+	const struct drm_display_mode *fixed_mode;
+	struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode;
 	int pipe_src_w, pipe_src_h;
 	int base_bpp, ret, i;
 
@@ -4774,6 +4776,24 @@ intel_modeset_pipe_config(struct intel_atomic_state *state,
 		    crtc->base.base.id, crtc->base.name,
 		    base_bpp, crtc_state->pipe_bpp, crtc_state->dither);
 
+	for_each_new_connector_in_state(&state->base, connector, connector_state, i) {
+		struct intel_encoder *encoder =
+			to_intel_encoder(connector_state->best_encoder);
+		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+		struct intel_connector *connector = intel_dp->attached_connector;
+
+		if (connector_state->crtc != &crtc->base)
+			continue;
+
+		fixed_mode = intel_panel_fixed_mode(connector, adjusted_mode);
+		if ((intel_dp_is_edp(intel_dp) && fixed_mode) ||
+			crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420) {
+			ret = intel_panel_fitting(crtc_state, connector_state);
+			if (ret)
+				return ret;
+		}
+	}
+
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 3903f6ead6e6..eb6641854b3c 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -2951,13 +2951,6 @@ 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 (ret)
-			return ret;
-	}
-
 	pipe_config->limited_color_range =
 		intel_dp_limited_color_range(pipe_config, conn_state);
 
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list