Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'drm/tegra/for-5.1-rc6' of git://anongit.freedesktop.org/tegra/linux into drm-fixes

drm/tegra: Fixes for v5.1-rc6

This contains a follow-up fix for the stream ID programming and a fix
for a regression on older Tegra devices (Tegra20 and Tegra30) that are
running into a division by zero trying to enable audio over HDMI.

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thierry Reding <thierry.reding@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190417073525.21680-1-thierry.reding@gmail.com

+15 -5
+9 -3
drivers/gpu/drm/tegra/hdmi.c
··· 1260 1260 1261 1261 hdmi->dvi = !tegra_output_is_hdmi(output); 1262 1262 if (!hdmi->dvi) { 1263 - err = tegra_hdmi_setup_audio(hdmi); 1264 - if (err < 0) 1265 - hdmi->dvi = true; 1263 + /* 1264 + * Make sure that the audio format has been configured before 1265 + * enabling audio, otherwise we may try to divide by zero. 1266 + */ 1267 + if (hdmi->format.sample_rate > 0) { 1268 + err = tegra_hdmi_setup_audio(hdmi); 1269 + if (err < 0) 1270 + hdmi->dvi = true; 1271 + } 1266 1272 } 1267 1273 1268 1274 if (hdmi->config->has_hda)
+6 -2
drivers/gpu/host1x/hw/channel_hw.c
··· 114 114 115 115 static void host1x_channel_set_streamid(struct host1x_channel *channel) 116 116 { 117 - #if IS_ENABLED(CONFIG_IOMMU_API) && HOST1X_HW >= 6 117 + #if HOST1X_HW >= 6 118 + u32 sid = 0x7f; 119 + #ifdef CONFIG_IOMMU_API 118 120 struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent); 119 - u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f; 121 + if (spec) 122 + sid = spec->ids[0] & 0xffff; 123 + #endif 120 124 121 125 host1x_ch_writel(channel, sid, HOST1X_CHANNEL_SMMU_STREAMID); 122 126 #endif