dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Wayne Lin <Wayne.Lin@amd.com>
To: <dri-devel@lists.freedesktop.org>, <amd-gfx@lists.freedesktop.org>
Cc: jerry.zuo@amd.com, Nicholas.Kazlauskas@amd.com,
	Wayne Lin <Wayne.Lin@amd.com>
Subject: [PATCH 1/2] drm/dp_mst: Add a function to determine the mst end device
Date: Wed, 8 Jan 2020 16:44:15 +0800	[thread overview]
Message-ID: <20200108084416.6296-2-Wayne.Lin@amd.com> (raw)
In-Reply-To: <20200108084416.6296-1-Wayne.Lin@amd.com>

[Why]
For later usage convenience, add the function
drm_dp_mst_is_dp_mst_end_device() to decide whether a peer device
connected to a DFP is mst end device. Which also indicates if the peer
device is capable of handling message or not.

Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
---
 drivers/gpu/drm/drm_dp_mst_topology.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c
index eebf325d7f48..8f54b241db08 100644
--- a/drivers/gpu/drm/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/drm_dp_mst_topology.c
@@ -1918,6 +1918,22 @@ static u8 drm_dp_calculate_rad(struct drm_dp_mst_port *port,
 	return parent_lct + 1;
 }
 
+static bool drm_dp_mst_is_dp_mst_end_device(u8 pdt, bool mcs)
+{
+	switch (pdt) {
+	case DP_PEER_DEVICE_DP_LEGACY_CONV:
+	case DP_PEER_DEVICE_SST_SINK:
+		return true;
+	case DP_PEER_DEVICE_MST_BRANCHING:
+		/* For sst branch device */
+		if (!mcs)
+			return true;
+
+		return false;
+	}
+	return true;
+}
+
 static int drm_dp_port_set_pdt(struct drm_dp_mst_port *port, u8 new_pdt)
 {
 	struct drm_dp_mst_topology_mgr *mgr = port->mgr;
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-01-08  8:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08  8:44 [PATCH 0/2] Take SST-only branch device into account Wayne Lin
2020-01-08  8:44 ` Wayne Lin [this message]
2020-01-14 21:15   ` [PATCH 1/2] drm/dp_mst: Add a function to determine the mst end device Lyude Paul
2020-01-15  2:40     ` Lin, Wayne
2020-01-08  8:44 ` [PATCH 2/2] drm/dp_mst: Handle SST-only branch device case Wayne Lin
2020-01-14 21:18   ` Lyude Paul
2020-01-15  2:43     ` Lin, Wayne

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=20200108084416.6296-2-Wayne.Lin@amd.com \
    --to=wayne.lin@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jerry.zuo@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).