diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-11-08 19:03:01 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-12-21 04:01:31 -0500 |
commit | 50a01fe06e25b271661c6691bc0907ad5ca2c718 (patch) | |
tree | b40c4521d586172bdf189f6f27dd7434148e121a /drivers/gpu/drm | |
parent | 9e7f96aa3a4b26db4a0ac49a96a9b55f1685e8b2 (diff) |
drm/nouveau/hdmi: enable audio for nva3:nvd0 chipsets
Pre-nva3 will likely require far more extensive setup, and nvd9 needs to
be checked to find its SOR_HDMI/SOR_AUDIO blocks.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_hdmi.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_hdmi.c b/drivers/gpu/drm/nouveau/nouveau_hdmi.c index 3b4120f0626a..59ea1c14eca0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_hdmi.c +++ b/drivers/gpu/drm/nouveau/nouveau_hdmi.c | |||
@@ -219,6 +219,8 @@ nouveau_hdmi_mode_set(struct drm_encoder *encoder, | |||
219 | { | 219 | { |
220 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); | 220 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); |
221 | struct nouveau_connector *nv_connector; | 221 | struct nouveau_connector *nv_connector; |
222 | struct drm_device *dev = encoder->dev; | ||
223 | u32 max_ac_packet, rekey; | ||
222 | 224 | ||
223 | nv_connector = nouveau_encoder_connector_get(nv_encoder); | 225 | nv_connector = nouveau_encoder_connector_get(nv_encoder); |
224 | if (!mode || !nv_connector || !nv_connector->edid || | 226 | if (!mode || !nv_connector || !nv_connector->edid || |
@@ -227,11 +229,30 @@ nouveau_hdmi_mode_set(struct drm_encoder *encoder, | |||
227 | return; | 229 | return; |
228 | } | 230 | } |
229 | 231 | ||
230 | /* enable hdmi */ | ||
231 | hdmi_mask(encoder, 0x0a4, 0x40000000, 0x40000000); | ||
232 | |||
233 | nouveau_hdmi_video_infoframe(encoder, mode); | 232 | nouveau_hdmi_video_infoframe(encoder, mode); |
234 | nouveau_hdmi_audio_infoframe(encoder, mode); | 233 | nouveau_hdmi_audio_infoframe(encoder, mode); |
235 | 234 | ||
235 | hdmi_mask(encoder, 0x0d0, 0x00070001, 0x00010001); /* SPARE, HW_CTS */ | ||
236 | hdmi_mask(encoder, 0x068, 0x00010101, 0x00000000); /* ACR_CTRL, ?? */ | ||
237 | hdmi_mask(encoder, 0x078, 0x80000000, 0x80000000); /* ACR_0441_ENABLE */ | ||
238 | |||
239 | nv_mask(dev, 0x61733c, 0x00100000, 0x00100000); /* RESETF */ | ||
240 | nv_mask(dev, 0x61733c, 0x10000000, 0x10000000); /* LOOKUP_EN */ | ||
241 | nv_mask(dev, 0x61733c, 0x00100000, 0x00000000); /* !RESETF */ | ||
242 | |||
243 | /* value matches nvidia binary driver, and tegra constant */ | ||
244 | rekey = 56; | ||
245 | |||
246 | max_ac_packet = mode->htotal - mode->hdisplay; | ||
247 | max_ac_packet -= rekey; | ||
248 | max_ac_packet -= 18; /* constant from tegra */ | ||
249 | max_ac_packet /= 32; | ||
250 | |||
251 | /* enable hdmi */ | ||
252 | hdmi_mask(encoder, 0x0a4, 0x5f1f003f, 0x40000000 | /* enable */ | ||
253 | 0x1f000000 | /* unknown */ | ||
254 | max_ac_packet << 16 | | ||
255 | rekey); | ||
256 | |||
236 | nouveau_audio_mode_set(encoder, mode); | 257 | nouveau_audio_mode_set(encoder, mode); |
237 | } | 258 | } |