Commit ce519c1b authored by Dave Airlie's avatar Dave Airlie

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: default avatarDave 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
parents dc4060a5 83f8bf4b
...@@ -1260,10 +1260,16 @@ static void tegra_hdmi_encoder_enable(struct drm_encoder *encoder) ...@@ -1260,10 +1260,16 @@ static void tegra_hdmi_encoder_enable(struct drm_encoder *encoder)
hdmi->dvi = !tegra_output_is_hdmi(output); hdmi->dvi = !tegra_output_is_hdmi(output);
if (!hdmi->dvi) { if (!hdmi->dvi) {
/*
* Make sure that the audio format has been configured before
* enabling audio, otherwise we may try to divide by zero.
*/
if (hdmi->format.sample_rate > 0) {
err = tegra_hdmi_setup_audio(hdmi); err = tegra_hdmi_setup_audio(hdmi);
if (err < 0) if (err < 0)
hdmi->dvi = true; hdmi->dvi = true;
} }
}
if (hdmi->config->has_hda) if (hdmi->config->has_hda)
tegra_hdmi_write_eld(hdmi); tegra_hdmi_write_eld(hdmi);
......
...@@ -114,9 +114,13 @@ static inline void synchronize_syncpt_base(struct host1x_job *job) ...@@ -114,9 +114,13 @@ static inline void synchronize_syncpt_base(struct host1x_job *job)
static void host1x_channel_set_streamid(struct host1x_channel *channel) static void host1x_channel_set_streamid(struct host1x_channel *channel)
{ {
#if IS_ENABLED(CONFIG_IOMMU_API) && HOST1X_HW >= 6 #if HOST1X_HW >= 6
u32 sid = 0x7f;
#ifdef CONFIG_IOMMU_API
struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent); struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent);
u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f; if (spec)
sid = spec->ids[0] & 0xffff;
#endif
host1x_ch_writel(channel, sid, HOST1X_CHANNEL_SMMU_STREAMID); host1x_ch_writel(channel, sid, HOST1X_CHANNEL_SMMU_STREAMID);
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment