OSDN Git Service

drm/amdgpu: put the audio codec into suspend state before gpu reset V3
authorEvan Quan <evan.quan@amd.com>
Tue, 21 Apr 2020 02:47:35 +0000 (10:47 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Apr 2020 20:48:10 +0000 (16:48 -0400)
commit3f12acc8d6d4b2e62fab8f652d7075a859d80b42
treeaa443c8fd4731621eecfeb8a33d16ddf796ecf1d
parent50654d7bca87d4694a25307bd4796d41c3438a76
drm/amdgpu: put the audio codec into suspend state before gpu reset V3

At default, the autosuspend delay of audio controller is 3S. If the
gpu reset is triggered within 3S(after audio controller idle),
the audio controller may be unable into suspended state. Then
the sudden gpu reset will cause some audio errors. The change
here is targeted to resolve this.

However if the audio controller is in use when the gpu reset
triggered, this change may be still not enough to put the
audio controller into suspend state. Under this case, the
gpu reset will still proceed but there will be a warning
message printed("failed to suspend display audio").

V2: limit this for BACO and mode1 reset only
V3: try 1st to use pm_runtime_autosuspend_expiration() to
    query how much time is left. Use default setting on
    failure

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c