[PATCH] ALSA: hda/proc - print DP-MST connections

Takashi Iwai tiwai at suse.de
Tue Dec 8 17:56:50 CET 2020


On Tue, 08 Dec 2020 17:09:41 +0100,
Kai Vehmanen wrote:
> 
> To help in debugging issues with DisplayPort Multi-Stream Transport (aka
> DP-MST) support, print information of active connections for
> each device of a display audio pin widget.
> 
> Example output with the patch with two monitors connected to a DP-MST hub:

Somehow the text is folded irregularly...

> Devices: 4
>      Dev 00: PD = 0, ELDV = 0, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
>      Dev 01: PD = 1, ELDV = 1, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
>     *Dev 02: PD = 1, ELDV = 1, IA = 0, Connections [ 0x03 0x05* 0x07 0x09 ]
>      Dev 03: PD = 0, ELDV = 0, IA = 0, Connections [ 0x03* 0x05 0x07 0x09 ]
> Connection: 4
>      0x03 0x05* 0x07 0x09
> 
> Format of existing "Connection:" entry is left intact to keep
> compatibility.
> 
> Signed-off-by: Kai Vehmanen <kai.vehmanen at linux.intel.com>
> ---
>  sound/pci/hda/hda_proc.c | 39 ++++++++++++++++++++++++++++++++++++++-
>  1 file changed, 38 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
> index 0631f31ef87f..e1cba574cadb 100644
> --- a/sound/pci/hda/hda_proc.c
> +++ b/sound/pci/hda/hda_proc.c
> @@ -679,6 +679,39 @@ static void print_gpio(struct snd_info_buffer *buffer,
>  	print_nid_array(buffer, codec, nid, &codec->nids);
>  }
>  
> +static void print_dpmst_connections(struct snd_info_buffer *buffer, struct hda_codec *codec,
> +				    hda_nid_t nid, int dev_num)
> +{
> +	int c, conn_len, curr, dev_id_saved;
> +	hda_nid_t *conn;
> +
> +	conn_len = snd_hda_get_num_raw_conns(codec, nid);
> +	if (conn_len <= 0)
> +		return;
> +
> +	conn = kmalloc_array(conn_len,
> +			     sizeof(hda_nid_t),
> +			     GFP_KERNEL);

Missing NULL check?  Also you can fold into a single line.

The rest looks good.


thanks,

Takashi


More information about the Alsa-devel mailing list