Re: [PATCH 3/7] drm/i915: fix port checks for MST support on gen >= 11

Ville Syrjälä
2019-10-11T12:02:12Z

On Thu, Oct 10, 2019 at 06:09:03PM -0700, Lucas De Marchi wrote:
> Both Ice Lake and Elkhart Lake (gen 11) support MST on all external
> connections except DDI A. Tiger Lake (gen 12) supports on all external
> connections.
>
> Move the check to happen inside intel_dp_mst_encoder_init() and add
> specific platform checks.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_dp.c | 7 ++-----
> drivers/gpu/drm/i915/display/intel_dp_mst.c | 15 +++++++++++++--
> 2 files changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 0e45c61d7331..348a09890611 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -7268,11 +7268,8 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
> intel_connector->get_hw_state = intel_connector_get_hw_state;
>
> /* init MST on ports that can support it */
> - if (HAS_DP_MST(dev_priv) && !intel_dp_is_edp(intel_dp) &&
> - (port == PORT_B || port == PORT_C ||
> - port == PORT_D || port == PORT_F))
> - intel_dp_mst_encoder_init(intel_dig_port,
> - intel_connector->base.base.id);
> + intel_dp_mst_encoder_init(intel_dig_port,
> + intel_connector->base.base.id);
>
> if (!intel_edp_init_connector(intel_dp, intel_connector)) {
> intel_dp_aux_fini(intel_dp);
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> index c2bbba1effc1..8dcb578e6d01 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> @@ -654,15 +654,26 @@ intel_dp_mst_encoder_active_links(struct intel_digital_port *intel_dig_port)
> void
> intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_base_id)
> {
> + struct drm_i915_private *i915 = to_i915(intel_dig_port->base.base.dev);
> struct intel_dp *intel_dp = &intel_dig_port->dp;
> - struct drm_device *dev = intel_dig_port->base.base.dev;
> + enum port port = intel_dig_port->base.port;
> int ret;
>
> + if (!HAS_DP_MST(i915) || intel_dp_is_edp(intel_dp))
> + return;
> +
> + if (INTEL_GEN(i915) == 11 && port == PORT_A)
> + return;
> +
> + if (INTEL_GEN(i915) < 11 &&
> + port != PORT_B && port != PORT_C && port != PORT_D && port != PORT_F)
> + return;

This == vs. != is rather hard on the poor old brain.

If we replace the latter with '==PORT_A || ==PORT_E'
I think it'll be easier to grasp what's going on.

> +
> intel_dp->mst_mgr.cbs = &mst_cbs;
>
> /* create encoders */
> intel_dp_create_fake_mst_encoders(intel_dig_port);
> - ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, dev,
> + ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, &i915->drm,
> &intel_dp->aux, 16, 3, conn_base_id);
> if (ret) {
> intel_dp->can_mst = false;
> --
> 2.23.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

--
Ville Syrjälä
Intel