[PATCH 1/2] drm/display/dp: Add condition to enable/disable SSB in MST
Arun R Murthy
arun.r.murthy at intel.com
Wed Jan 17 17:11:54 UTC 2024
Signed-off-by: Arun R Murthy <arun.r.murthy at intel.com>
---
drivers/gpu/drm/display/drm_dp_mst_topology.c | 30 ++++++++++++++-----
1 file changed, 22 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
index 8ca01a6bf645..947abade05c7 100644
--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
@@ -2315,7 +2315,6 @@ drm_dp_mst_add_port(struct drm_device *dev,
port->mgr = mgr;
port->aux.name = "DPMST";
port->aux.dev = dev->dev;
- port->aux.is_remote = true;
/* initialize the MST downstream port's AUX crc work queue */
port->aux.drm_dev = dev;
@@ -3634,6 +3633,7 @@ EXPORT_SYMBOL(drm_dp_read_mst_cap);
*/
int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool mst_state)
{
+ u8 mstm_cap;
int ret = 0;
struct drm_dp_mst_branch *mstb = NULL;
@@ -3641,18 +3641,32 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms
if (mst_state == mgr->mst_state)
goto out_unlock;
+ /* get dpcd info */
+ ret = drm_dp_read_dpcd_caps(mgr->aux, mgr->dpcd);
+ if (ret < 0) {
+ drm_dbg_kms(mgr->dev, "%s: failed to read DPCD, ret %d\n",
+ mgr->aux->name, ret);
+ goto out_unlock;
+ }
+
+ /**
+ * MSTM_CAP dpcd reg 0x00021
+ * Bit[0] : Bit[1]
+ * 0:0 - 128/132b capable, support SST and not SSB
+ * 0:1 - 128/132b capable, support SST and SSB
+ * 1:x - 128/132b capable, support MST and SSB
+ */
+ drm_dp_dpcd_readb(mgr->aux, DP_MSTM_CAP, &mstm_cap);
+ if (mstm_cap & DP_SINGLE_STREAM_SIDEBAND_MSG)
+ mgr->aux->is_remote = true;
+ else
+ mgr->aux->is_remote = true;
+
mgr->mst_state = mst_state;
/* set the device into MST mode */
if (mst_state) {
WARN_ON(mgr->mst_primary);
- /* get dpcd info */
- ret = drm_dp_read_dpcd_caps(mgr->aux, mgr->dpcd);
- if (ret < 0) {
- drm_dbg_kms(mgr->dev, "%s: failed to read DPCD, ret %d\n",
- mgr->aux->name, ret);
- goto out_unlock;
- }
/* add initial branch device at LCT 1 */
mstb = drm_dp_add_mst_branch_device(1, NULL);
--
2.25.1
More information about the Intel-gfx-trybot
mailing list