* [PATCH] drm/tegra: hdmi: Setup audio only if configured
@ 2019-04-16 14:41 Thierry Reding
2019-04-16 15:12 ` Thierry Reding
0 siblings, 1 reply; 2+ messages in thread
From: Thierry Reding @ 2019-04-16 14:41 UTC (permalink / raw)
To: Thierry Reding; +Cc: Marcel Ziswiler, linux-tegra, Dmitry Osipenko, dri-devel
From: Thierry Reding <treding@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@toradex.com>
Signed-off-by: Thierry Reding <treding@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;
- }
if (hdmi->config->has_hda)
tegra_hdmi_write_eld(hdmi);
--
2.21.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/tegra: hdmi: Setup audio only if configured
2019-04-16 14:41 [PATCH] drm/tegra: hdmi: Setup audio only if configured Thierry Reding
@ 2019-04-16 15:12 ` Thierry Reding
0 siblings, 0 replies; 2+ messages in thread
From: Thierry Reding @ 2019-04-16 15:12 UTC (permalink / raw)
To: Marcel Ziswiler, Dmitry Osipenko, dri-devel, linux-tegra
[-- Attachment #1.1: Type: text/plain, Size: 1519 bytes --]
On Tue, Apr 16, 2019 at 04:41:37PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@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@toradex.com>
> Signed-off-by: Thierry Reding <treding@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
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-04-16 15:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-16 14:41 [PATCH] drm/tegra: hdmi: Setup audio only if configured Thierry Reding
2019-04-16 15:12 ` Thierry Reding
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).