Skip to content

Commit 0ad679d

Browse files
author
Ben Skeggs
committed
drm/nouveau/kms/gt215-: fix race with audio driver runpm
The audio driver can call into nouveau right while we're in the middle of re-fetching the EDID, and decide it no longer needs to be awake. Stop depending on EDID in the audio component get_eld() callback, and instead cache whether audio support is present from the prior modeset. Signed-off-by: Ben Skeggs <[email protected]>
1 parent a1ef8ba commit 0ad679d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/gpu/drm/nouveau/dispnv50/disp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ nv50_audio_component_get_eld(struct device *kdev, int port, int dev_id,
510510
if (!nv_connector || !nv_crtc || nv_encoder->or != port ||
511511
nv_crtc->index != dev_id)
512512
continue;
513-
*enabled = drm_detect_monitor_audio(nv_connector->edid);
513+
*enabled = nv_encoder->audio;
514514
if (*enabled) {
515515
ret = drm_eld_size(nv_connector->base.eld);
516516
memcpy(buf, nv_connector->base.eld,
@@ -600,6 +600,7 @@ nv50_audio_disable(struct drm_encoder *encoder, struct nouveau_crtc *nv_crtc)
600600
(0x0100 << nv_crtc->index),
601601
};
602602

603+
nv_encoder->audio = false;
603604
nvif_mthd(&disp->disp->object, 0, &args, sizeof(args));
604605

605606
nv50_audio_component_eld_notify(drm->audio.component, nv_encoder->or,
@@ -636,6 +637,7 @@ nv50_audio_enable(struct drm_encoder *encoder, struct drm_display_mode *mode)
636637

637638
nvif_mthd(&disp->disp->object, 0, &args,
638639
sizeof(args.base) + drm_eld_size(args.data));
640+
nv_encoder->audio = true;
639641

640642
nv50_audio_component_eld_notify(drm->audio.component, nv_encoder->or,
641643
nv_crtc->index);

drivers/gpu/drm/nouveau/nouveau_encoder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ struct nouveau_encoder {
5252
* actually programmed on the hw, not the proposed crtc */
5353
struct drm_crtc *crtc;
5454
u32 ctrl;
55+
bool audio;
5556

5657
struct drm_display_mode mode;
5758
int last_dpms;

0 commit comments

Comments
 (0)