diff mbox series

[6/6] drm/i915/display: Initialize pipe_src in compute stage

Message ID 20241120053838.3794419-7-nemesa.garg@intel.com (mailing list archive)
State New
Headers show
Series Consider joiner calculation for panel fitting | expand

Commit Message

Nemesa Garg Nov. 20, 2024, 5:38 a.m. UTC
Add early pipe src initialization for gmch and later
initialize the pipe src during compute_pipe_src.

Signed-off-by: Nemesa Garg <nemesa.garg@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index c58897cddde1..6d157767ad3b 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -2535,6 +2535,13 @@  static int intel_crtc_compute_pipe_src(struct intel_crtc_state *crtc_state)
 {
 	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
 	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
+	int pipe_src_w, pipe_src_h;
+
+	drm_mode_get_hv_timing(&crtc_state->hw.mode,
+			       &pipe_src_w, &pipe_src_h);
+
+	drm_rect_init(&crtc_state->pipe_src, 0, 0,
+		      pipe_src_w, pipe_src_h);
 
 	intel_joiner_compute_pipe_src(crtc_state);
 
@@ -5004,10 +5011,12 @@  intel_modeset_pipe_config(struct intel_atomic_state *state,
 	 * computation to clearly distinguish it from the adjusted mode, which
 	 * can be changed by the connectors in the below retry loop.
 	 */
-	drm_mode_get_hv_timing(&crtc_state->hw.mode,
-			       &pipe_src_w, &pipe_src_h);
-	drm_rect_init(&crtc_state->pipe_src, 0, 0,
-		      pipe_src_w, pipe_src_h);
+	if (HAS_GMCH(i915)) {
+		drm_mode_get_hv_timing(&crtc_state->hw.mode,
+				       &pipe_src_w, &pipe_src_h);
+		drm_rect_init(&crtc_state->pipe_src, 0, 0,
+			      pipe_src_w, pipe_src_h);
+	}
 
 	for_each_new_connector_in_state(&state->base, connector, connector_state, i) {
 		struct intel_encoder *encoder =