From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Arun R Murthy <arun.r.murthy@intel.com>
Subject: Re: [RFC 2/4] drm/i915/dp: refactor DP MST detection and configuration
Date: Mon, 12 Feb 2024 17:46:26 +0200 [thread overview]
Message-ID: <Zco9UijJGIN2ZDHZ@intel.com> (raw)
In-Reply-To: <87v86t9020.fsf@intel.com>
On Mon, Feb 12, 2024 at 05:25:43PM +0200, Jani Nikula wrote:
> On Fri, 02 Feb 2024, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> > On Fri, Feb 02, 2024 at 04:05:32PM +0200, Jani Nikula wrote:
> >> Currently we've split MST capability detection in two places,
> >> intel_dp_can_mst() and intel_dp_configure_mst(). They check essentially
> >> the same things.
> >>
> >> Move bulk of the work, including logging, to intel_dp_can_mst() and
> >> rename it intel_dp_mst_detect(). Set intel_dp->is_mst there to avoid
> >> duplicate work.
> >
> > This seems confusing. is_mst is supposed to reflect the state
> > of the topology manager, nothing more.
>
> We'll, that's still exactly what we're going to set the topology manager
> state to. It's just that now we figure it out just a little earlier, so
> we don't have to duplicate the dpcd reads and logic to two places.
That may be desiresable, but I don't think the current is_mst
flag is really the correct thing to track that. We now set it
somewhere deep down in the detect path wihtout configuring
the mst manager to match, but we clear it much higher up
and there we do assume it 100% matches the state of the topology
manager.
Eg. what happens now if we were previosuly using MST, and now
intel_dp_mst_detect() clears the flag? It looks to me like
we're going to completely forget to call
drm_dp_mst_topology_mgr_set_mst(...,false).
>
> BR,
> Jani.
>
>
> >
> >>
> >> Rename intel_dp_configure_mst() to intel_dp_mst_configure(), and only
> >> set the topology manager state there.
> >>
> >> The main functional difference is that the DP_MSTM_CAP DPCD register is
> >> now only read once at detect, unconditionally, and the MST support is
> >> always logged. Everything else should remain the same.
> >>
> >> Cc: Arun R Murthy <arun.r.murthy@intel.com>
> >> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >> ---
> >> drivers/gpu/drm/i915/display/intel_dp.c | 36 ++++++++++---------------
> >> 1 file changed, 14 insertions(+), 22 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> >> index 7af09f2c008d..e0b8ee6bde79 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> >> @@ -4004,23 +4004,15 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
> >> intel_dp->downstream_ports) == 0;
> >> }
> >>
> >> -static bool
> >> -intel_dp_can_mst(struct intel_dp *intel_dp)
> >> +static bool intel_dp_mst_detect(struct intel_dp *intel_dp)
> >> {
> >> struct drm_i915_private *i915 = dp_to_i915(intel_dp);
> >> + struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
> >> + bool sink_can_mst = drm_dp_read_mst_cap(&intel_dp->aux, intel_dp->dpcd) == DP_MST_CAPABLE;
> >>
> >> - return i915->display.params.enable_dp_mst &&
> >> + intel_dp->is_mst = i915->display.params.enable_dp_mst &&
> >> intel_dp_mst_source_support(intel_dp) &&
> >> - drm_dp_read_mst_cap(&intel_dp->aux, intel_dp->dpcd) == DP_MST_CAPABLE;
> >> -}
> >> -
> >> -static void
> >> -intel_dp_configure_mst(struct intel_dp *intel_dp)
> >> -{
> >> - struct drm_i915_private *i915 = dp_to_i915(intel_dp);
> >> - struct intel_encoder *encoder =
> >> - &dp_to_dig_port(intel_dp)->base;
> >> - bool sink_can_mst = drm_dp_read_mst_cap(&intel_dp->aux, intel_dp->dpcd) == DP_MST_CAPABLE;
> >> + sink_can_mst;
> >>
> >> drm_dbg_kms(&i915->drm,
> >> "[ENCODER:%d:%s] MST support: port: %s, sink: %s, modparam: %s\n",
> >> @@ -4029,14 +4021,14 @@ intel_dp_configure_mst(struct intel_dp *intel_dp)
> >> str_yes_no(sink_can_mst),
> >> str_yes_no(i915->display.params.enable_dp_mst));
> >>
> >> - if (!intel_dp_mst_source_support(intel_dp))
> >> - return;
> >> -
> >> - intel_dp->is_mst = sink_can_mst &&
> >> - i915->display.params.enable_dp_mst;
> >> + return intel_dp->is_mst;
> >> +}
> >>
> >> - drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr,
> >> - intel_dp->is_mst);
> >> +static void intel_dp_mst_configure(struct intel_dp *intel_dp)
> >> +{
> >> + if (intel_dp_mst_source_support(intel_dp))
> >> + drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr,
> >> + intel_dp->is_mst);
> >> }
> >>
> >> static bool
> >> @@ -5387,7 +5379,7 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
> >> connector_status_connected : connector_status_disconnected;
> >> }
> >>
> >> - if (intel_dp_can_mst(intel_dp))
> >> + if (intel_dp_mst_detect(intel_dp))
> >> return connector_status_connected;
> >>
> >> /* If no HPD, poke DDC gently */
> >> @@ -5706,7 +5698,7 @@ intel_dp_detect(struct drm_connector *connector,
> >>
> >> intel_dp_detect_dsc_caps(intel_dp, intel_connector);
> >>
> >> - intel_dp_configure_mst(intel_dp);
> >> + intel_dp_mst_configure(intel_dp);
> >>
> >> /*
> >> * TODO: Reset link params when switching to MST mode, until MST
> >> --
> >> 2.39.2
>
> --
> Jani Nikula, Intel
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2024-02-12 15:46 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 14:05 [RFC 0/4] drm/i915/mst: enable MST mode for 128b/132b single-stream sideband Jani Nikula
2024-02-02 14:05 ` [RFC 1/4] drm/mst: read sideband messaging cap Jani Nikula
2024-02-02 15:46 ` Ville Syrjälä
2024-02-02 14:05 ` [RFC 2/4] drm/i915/dp: refactor DP MST detection and configuration Jani Nikula
2024-02-02 15:51 ` Ville Syrjälä
2024-02-12 15:25 ` Jani Nikula
2024-02-12 15:46 ` Ville Syrjälä [this message]
2024-02-02 14:05 ` [RFC 3/4] drm/i915/mst: improve debug logging of DP MST mode detect Jani Nikula
2024-02-02 14:05 ` [RFC 4/4] drm/i915/mst: enable MST mode for 128b/132b single-stream sideband Jani Nikula
2024-02-02 15:54 ` Ville Syrjälä
2024-02-12 15:30 ` Jani Nikula
2024-02-12 15:36 ` Ville Syrjälä
2024-02-05 9:07 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/mst: enable MST mode for 128b/132b single-stream sideband (rev2) Patchwork
2024-02-05 9:07 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-02-05 9:26 ` ✓ Fi.CI.BAT: success " Patchwork
2024-02-05 11:49 ` ✗ Fi.CI.IGT: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zco9UijJGIN2ZDHZ@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=arun.r.murthy@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.