<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Lyude,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Yes, I would appreciate it if you could push this to drm-misc-next for me.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thank you for your comments and review!</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Eryk<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Lyude Paul <lyude@redhat.com><br>
<b>Sent:</b> Thursday, March 25, 2021 6:30 PM<br>
<b>To:</b> Brol, Eryk <Eryk.Brol@amd.com>; manasi.d.navare@intel.com <manasi.d.navare@intel.com>; daniel@ffwll.ch <daniel@ffwll.ch>; Wentland, Harry <Harry.Wentland@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>;
Zuo, Jerry <Jerry.Zuo@amd.com>; Lin, Wayne <Wayne.Lin@amd.com><br>
<b>Cc:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; dri-devel@lists.freedesktop.org <dri-devel@lists.freedesktop.org><br>
<b>Subject:</b> Re: [PATCH v2] drm/mst: Enhance MST topology logging</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Reviewed-by: Lyude Paul <lyude@redhat.com><br>
<br>
Let me know if you need me to push this to drm-misc-next for you<br>
<br>
On Thu, 2021-03-25 at 14:06 -0400, Eryk Brol wrote:<br>
> [why]<br>
> MST topology print was missing fec logging and pdt printed<br>
> as an int wasn't clear. vcpi and payload info was printed as an<br>
> arbitrary series of ints which requires user to know the ordering<br>
> of the prints, making the logs difficult to use.<br>
> <br>
> [how]<br>
> -add fec logging<br>
> -add pdt parsing into strings<br>
> -format vcpi and payload info into tables with headings<br>
> -clean up topology prints<br>
> <br>
> ---<br>
> <br>
> v2: Addressed Lyude's comments<br>
> -made helper function return const<br>
> -fixed indentation and spacing issues<br>
> <br>
> Signed-off-by: Eryk Brol <eryk.brol@amd.com><br>
> ---<br>
> drivers/gpu/drm/drm_dp_mst_topology.c | 59 ++++++++++++++++++++++-----<br>
> 1 file changed, 48 insertions(+), 11 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c<br>
> b/drivers/gpu/drm/drm_dp_mst_topology.c<br>
> index 932c4641ec3e..de5124ce42cb 100644<br>
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c<br>
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c<br>
> @@ -4720,6 +4720,28 @@ static void drm_dp_mst_kick_tx(struct<br>
> drm_dp_mst_topology_mgr *mgr)<br>
> queue_work(system_long_wq, &mgr->tx_work);<br>
> }<br>
> <br>
> +/*<br>
> + * Helper function for parsing DP device types into convenient strings<br>
> + * for use with dp_mst_topology<br>
> + */<br>
> +static const char *pdt_to_string(u8 pdt)<br>
> +{<br>
> + switch (pdt) {<br>
> + case DP_PEER_DEVICE_NONE:<br>
> + return "NONE";<br>
> + case DP_PEER_DEVICE_SOURCE_OR_SST:<br>
> + return "SOURCE OR SST";<br>
> + case DP_PEER_DEVICE_MST_BRANCHING:<br>
> + return "MST BRANCHING";<br>
> + case DP_PEER_DEVICE_SST_SINK:<br>
> + return "SST SINK";<br>
> + case DP_PEER_DEVICE_DP_LEGACY_CONV:<br>
> + return "DP LEGACY CONV";<br>
> + default:<br>
> + return "ERR";<br>
> + }<br>
> +}<br>
> +<br>
> static void drm_dp_mst_dump_mstb(struct seq_file *m,<br>
> struct drm_dp_mst_branch *mstb)<br>
> {<br>
> @@ -4732,9 +4754,20 @@ static void drm_dp_mst_dump_mstb(struct seq_file *m,<br>
> prefix[i] = '\t';<br>
> prefix[i] = '\0';<br>
> <br>
> - seq_printf(m, "%smst: %p, %d\n", prefix, mstb, mstb->num_ports);<br>
> + seq_printf(m, "%smstb - [%p]: num_ports: %d\n", prefix, mstb, mstb-<br>
> >num_ports);<br>
> list_for_each_entry(port, &mstb->ports, next) {<br>
> - seq_printf(m, "%sport: %d: input: %d: pdt: %d, ddps: %d ldps:<br>
> %d, sdp: %d/%d, %p, conn: %p\n", prefix, port->port_num, port->input, port-<br>
> >pdt, port->ddps, port->ldps, port->num_sdp_streams, port-<br>
> >num_sdp_stream_sinks, port, port->connector);<br>
> + seq_printf(m, "%sport %d - [%p] (%s - %s): ddps: %d, ldps: %d,<br>
> sdp: %d/%d, fec: %s, conn: %p\n", <br>
> + prefix,<br>
> + port->port_num,<br>
> + port,<br>
> + port->input ? "input" : "output",<br>
> + pdt_to_string(port->pdt),<br>
> + port->ddps,<br>
> + port->ldps,<br>
> + port->num_sdp_streams,<br>
> + port->num_sdp_stream_sinks,<br>
> + port->fec_capable ? "true" : "false",<br>
> + port->connector);<br>
> if (port->mstb)<br>
> drm_dp_mst_dump_mstb(m, port->mstb);<br>
> }<br>
> @@ -4787,33 +4820,37 @@ void drm_dp_mst_dump_topology(struct seq_file *m,<br>
> mutex_unlock(&mgr->lock);<br>
> <br>
> mutex_lock(&mgr->payload_lock);<br>
> - seq_printf(m, "vcpi: %lx %lx %d\n", mgr->payload_mask, mgr->vcpi_mask,<br>
> - mgr->max_payloads);<br>
> + seq_printf(m, "\n*** VCPI Info ***\n");<br>
> + seq_printf(m, "payload_mask: %lx, vcpi_mask: %lx, max_payloads: %d\n",<br>
> mgr->payload_mask, mgr->vcpi_mask, mgr->max_payloads);<br>
> <br>
> + seq_printf(m, "\n| idx | port # | vcp_id | # slots | sink<br>
> name |\n");<br>
> for (i = 0; i < mgr->max_payloads; i++) {<br>
> if (mgr->proposed_vcpis[i]) {<br>
> char name[14];<br>
> <br>
> port = container_of(mgr->proposed_vcpis[i], struct<br>
> drm_dp_mst_port, vcpi);<br>
> fetch_monitor_name(mgr, port, name, sizeof(name));<br>
> - seq_printf(m, "vcpi %d: %d %d %d sink name: %s\n", i,<br>
> - port->port_num, port->vcpi.vcpi,<br>
> + seq_printf(m, "%10d%10d%10d%10d%20s\n",<br>
> + i,<br>
> + port->port_num,<br>
> + port->vcpi.vcpi,<br>
> port->vcpi.num_slots,<br>
> - (*name != 0) ? name : "Unknown");<br>
> + (*name != 0) ? name : "Unknown");<br>
> } else<br>
> - seq_printf(m, "vcpi %d:unused\n", i);<br>
> + seq_printf(m, "%6d - Unused\n", i);<br>
> }<br>
> + seq_printf(m, "\n*** Payload Info ***\n");<br>
> + seq_printf(m, "| idx | state | start slot | # slots |\n");<br>
> for (i = 0; i < mgr->max_payloads; i++) {<br>
> - seq_printf(m, "payload %d: %d, %d, %d\n",<br>
> + seq_printf(m, "%10d%10d%15d%10d\n",<br>
> i,<br>
> mgr->payloads[i].payload_state,<br>
> mgr->payloads[i].start_slot,<br>
> mgr->payloads[i].num_slots);<br>
> -<br>
> -<br>
> }<br>
> mutex_unlock(&mgr->payload_lock);<br>
> <br>
> + seq_printf(m, "\n*** DPCD Info ***\n");<br>
> mutex_lock(&mgr->lock);<br>
> if (mgr->mst_primary) {<br>
> u8 buf[DP_PAYLOAD_TABLE_SIZE];<br>
<br>
-- <br>
Sincerely,<br>
Lyude Paul (she/her)<br>
Software Engineer at Red Hat<br>
<br>
Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've<br>
asked me a question, are waiting for a review/merge on a patch, etc. and I<br>
haven't responded in a while, please feel free to send me another email to check<br>
on my status. I don't bite!<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>