Skip to content

Commit 7037bb0

Browse files
Steven 'Steve' Kendallalexdeucher
authored andcommitted
drm/radeon: Fix spurious unplug event on radeon HDMI
On several HP models (tested on HP 3125 and HP Probook 455 G2), spurious unplug events are emitted upon login on Chrome OS. This is likely due to the way Chrome OS restarts graphics upon login, so it's possible it's an issue on other distributions but not as common, though I haven't reproduced the issue elsewhere. Use logic from an earlier version of the merged change (see link below) which iterates over connectors and finds matching encoders, rather than the other way around. Also fixes an issue with screen mirroring on Chrome OS. I've deployed this patch on Fedora and did not observe any regression on these devices. Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1569#note_1603002 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/3771 Fixes: 20ea347 ("drm/radeon: Add HD-audio component notifier support (v6)") Signed-off-by: Steven 'Steve' Kendall <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent c3e3c1a commit 7037bb0

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/gpu/drm/radeon/radeon_audio.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -760,16 +760,20 @@ static int radeon_audio_component_get_eld(struct device *kdev, int port,
760760
if (!rdev->audio.enabled || !rdev->mode_info.mode_config_initialized)
761761
return 0;
762762

763-
list_for_each_entry(encoder, &rdev_to_drm(rdev)->mode_config.encoder_list, head) {
763+
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
764+
const struct drm_connector_helper_funcs *connector_funcs =
765+
connector->helper_private;
766+
encoder = connector_funcs->best_encoder(connector);
767+
768+
if (!encoder)
769+
continue;
770+
764771
if (!radeon_encoder_is_digital(encoder))
765772
continue;
766773
radeon_encoder = to_radeon_encoder(encoder);
767774
dig = radeon_encoder->enc_priv;
768775
if (!dig->pin || dig->pin->id != port)
769776
continue;
770-
connector = radeon_get_connector_for_encoder(encoder);
771-
if (!connector)
772-
continue;
773777
*enabled = true;
774778
ret = drm_eld_size(connector->eld);
775779
memcpy(buf, connector->eld, min(max_bytes, ret));

0 commit comments

Comments
 (0)