summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_audio.c
AgeCommit message (Collapse)Author
2026-07-28drm/amd/display: add KUnit tests for audio commit pathAlex Hung
[WHAT] Add KUnit coverage for amdgpu_dm_commit_audio(), the remaining function reported as untested by gcov. The tests build hand-rolled drm_atomic_state arrays and back dc_stream_get_status() with a fake dc->current_state to cover the removal and addition ELD notifications along with their guard/skip paths: writeback connector, detached connector, missing new CRTC state, no modeset, and absent stream status. Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Fangzhi Zuo <jerry.zuo@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-07-28drm/amd/display: Replace amdgpu_dm_kunit_helpers.h with dm_helpers.hBhawanpreet Lakha
Drop the amdgpu_dm_kunit_helpers.h include across the amdgpu_dm source files and use dm_helpers.h instead Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Wayne Lin <wayne.lin@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-07-15drm/amd/display: Always notify the HDA driver on connector disconnectNĂ­colas F. R. A. Prado
amdgpu_dm_audio_eld_notify() is currently only called in atomic commits. This results in the state of the HDA driver never getting updated when an audio sink is removed and an atomic commit never comes. (eg the HDMI audio jack switch in ALSA stays 'on' after the HDMI cable is disconnected if no other display is connected to cause the compositor to submit an atomic commit) Call amdgpu_dm_audio_eld_notify() in amdgpu_dm_update_connector_after_detect() when a sink is no longer available to ensure that the HDA driver always gets notified on disconnect regardless of atomic commits. Assisted-by: Copilot:claude-sonnet-4.6 Signed-off-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com> Reviewed-by: George Zhang <george.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-07-15drm/amd/display: More Kunit tests for audioBhawanpreet Lakha
Split audio init to make the initialization modular Test the audio pin initialization Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: George Zhang <george.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-06-17drm/amd/display: Add KUnit tests for amdgpu_dm_audioAlex Hung
Add KUnit tests for amdgpu_dm_audio.c. Tests cover: - amdgpu_dm_audio_init(): early exit when audio is disabled - amdgpu_dm_audio_fini(): early exit when audio is not enabled - fill_audio_info(): manufacturer and product ID propagation, display name copy, speaker allocation flags, CEA revision gating of audio mode copying (including the zero-mode case), and latency field propagation - amdgpu_dm_audio_component_bind()/unbind(): component ops, device, and audio_component pointer are wired up on bind and cleared on unbind - amdgpu_dm_audio_eld_notify(): callback is forwarded with the correct port and audio pointer, and the no-op guard paths for a missing component, audio_ops, or pin_eld_notify callback Assisted-by: Copilot:Claude-Opus-4.8 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2026-06-17drm/amd/display: Extract audio code to amdgpu_dm_audioAlex Hung
Move audio component, init/fini, ELD notification, fill_audio_info, and commit_audio functions from amdgpu_dm.c into a dedicated amdgpu_dm_audio.c file with its own header. No functional change intended. Assisted-by: Copilot:Claude-Opus-4.6 Reviewed-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Chenyu Chen <chen-yu.chen@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>