[PATCH 15/36] drm/i915: Reject cloning when using pfit
Ville Syrjala
ville.syrjala at linux.intel.com
Wed Dec 18 16:10:32 UTC 2019
From: Ville Syrjälä <ville.syrjala at linux.intel.com>
The panel fitter lives inside the pipe and so would affect all cloned
outputs. However the relevant properties (scaling mode, TV margins) are
per-connector so we could end up with a situation where each cloned
output wants a different pfit configuration. Let's just reject pfit
usage with cloning entirely.
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_panel.c | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c
index 9c7d070c286a..d6028303b16f 100644
--- a/drivers/gpu/drm/i915/display/intel_panel.c
+++ b/drivers/gpu/drm/i915/display/intel_panel.c
@@ -258,6 +258,26 @@ static int intel_pch_pfit_check_timings(const struct intel_crtc_state *crtc_stat
return 0;
}
+static int intel_pch_pfit_check_cloning(const struct intel_crtc_state *crtc_state)
+{
+ struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
+
+ /*
+ * The panel fitter is in the pipe and thus would affect every
+ * cloned output. The relevant properties (scaling mode, TV
+ * margins) are per-connector so we'd have to make sure each
+ * output sets them up identically. Seems like a very niche use
+ * case so let's just reject cloning entirely when pfit is used.
+ */
+ if (!is_power_of_2(crtc_state->output_types)) {
+ DRM_DEBUG_KMS("[CRTC:%d:%s] no pfit when cloning\n",
+ crtc->base.base.id, crtc->base.name);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
/* adjusted_mode has been preset to be the panel's fixed mode */
int intel_pch_panel_fitting(struct intel_crtc_state *crtc_state,
const struct drm_connector_state *conn_state)
@@ -349,6 +369,10 @@ int intel_pch_panel_fitting(struct intel_crtc_state *crtc_state,
if (ret)
return ret;
+ ret = intel_pch_pfit_check_cloning(crtc_state);
+ if (ret)
+ return ret;
+
return 0;
}
--
2.23.0
More information about the Intel-gfx-trybot
mailing list