[PATCH] drm/tegra: hdmi: Setup audio only if configured

Thierry Reding thierry.reding at gmail.com
Tue Apr 16 15:12:37 UTC 2019


On Tue, Apr 16, 2019 at 04:41:37PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding at nvidia.com>
> 
> The audio configuration is only valid if the HDMI codec has been
> properly set up. Do not attempt to set up audio before that happens
> because it causes a division by zero.
> 
> Note that this is only problematic on Tegra20 and Tegra30. Later chips
> implement the division instructions which return zero when dividing by
> zero and don't throw an exception.
> 
> Fixes: db5adf4d6dce ("drm/tegra: hdmi: Fix audio to work with any pixel clock rate")
> Reported-by: Marcel Ziswiler <marcel.ziswiler at toradex.com>
> Signed-off-by: Thierry Reding <treding at nvidia.com>
> ---
>  drivers/gpu/drm/tegra/hdmi.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c
> index 47c55974756d..e6c60bbc0fec 100644
> --- a/drivers/gpu/drm/tegra/hdmi.c
> +++ b/drivers/gpu/drm/tegra/hdmi.c
> @@ -1259,11 +1259,6 @@ static void tegra_hdmi_encoder_enable(struct drm_encoder *encoder)
>  	tegra_hdmi_writel(hdmi, value, HDMI_NV_PDISP_SOR_REFCLK);
>  
>  	hdmi->dvi = !tegra_output_is_hdmi(output);
> -	if (!hdmi->dvi) {
> -		err = tegra_hdmi_setup_audio(hdmi);
> -		if (err < 0)
> -			hdmi->dvi = true;
> -	}

This has the disadvantage of keeping audio disabled after a disable/
enable sequence, even if userspace is still playing audio. I'll send
out a better fix that keeps audio working after disable/enable.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20190416/986bbb54/attachment.sig>


More information about the dri-devel mailing list