Skip to contentSkip to conversation

drm/tegra: hdmi: Setup audio only if configured

PATCH Superseded Thierry Reding 1 participant 2 messages Apr 16, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/tegra: hdmi: Setup audio only if configured

From: Thierry Reding <[email protected]>

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")
---
 drivers/gpu/drm/tegra/hdmi.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/tegra/hdmi.c +0 -5
index 47c55974756d..e6c60bbc0fec 100644
@@ -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);
Signature · 6 lines
2.21.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 22 lines · Thierry Reding

From: Thierry Reding <[email protected]>

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")
---
 drivers/gpu/drm/tegra/hdmi.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/tegra/hdmi.c +0 -0
index 47c55974756d..e6c60bbc0fec 100644

drivers/gpu/drm/tegra/hdmi.c static void tegra_hdmi_encoder_enable(struct drm_encoder *encoder) · line 1266

Quoted 8 lines
drivers/gpu/drm/tegra/hdmi.c +0 -5
@@ -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

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel