Skip to content

Commit 0326de4

Browse files
Prike Liangalexdeucher
authored andcommitted
drm/amdgpu: skip to program GFXDEC registers for suspend abort
In the suspend abort cases, the gfx power rail doesn't turn off so some GFXDEC registers/CSB can't reset to default value and at this moment reinitialize GFXDEC/CSB will result in an unexpected error. So let skip those program sequence for the suspend abort case. Signed-off-by: Prike Liang <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 0a5fd78 commit 0326de4

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,6 +1079,8 @@ struct amdgpu_device {
10791079
bool in_s3;
10801080
bool in_s4;
10811081
bool in_s0ix;
1082+
/* indicate amdgpu suspension status */
1083+
bool suspend_complete;
10821084

10831085
enum pp_mp1_state mp1_state;
10841086
struct amdgpu_doorbell_index doorbell_index;

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,6 +2476,7 @@ static int amdgpu_pmops_suspend(struct device *dev)
24762476
struct drm_device *drm_dev = dev_get_drvdata(dev);
24772477
struct amdgpu_device *adev = drm_to_adev(drm_dev);
24782478

2479+
adev->suspend_complete = false;
24792480
if (amdgpu_acpi_is_s0ix_active(adev))
24802481
adev->in_s0ix = true;
24812482
else if (amdgpu_acpi_is_s3_active(adev))
@@ -2490,6 +2491,7 @@ static int amdgpu_pmops_suspend_noirq(struct device *dev)
24902491
struct drm_device *drm_dev = dev_get_drvdata(dev);
24912492
struct amdgpu_device *adev = drm_to_adev(drm_dev);
24922493

2494+
adev->suspend_complete = true;
24932495
if (amdgpu_acpi_should_gpu_reset(adev))
24942496
return amdgpu_asic_reset(adev);
24952497

drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,6 +3034,14 @@ static int gfx_v9_0_cp_gfx_start(struct amdgpu_device *adev)
30343034

30353035
gfx_v9_0_cp_gfx_enable(adev, true);
30363036

3037+
/* Now only limit the quirk on the APU gfx9 series and already
3038+
* confirmed that the APU gfx10/gfx11 needn't such update.
3039+
*/
3040+
if (adev->flags & AMD_IS_APU &&
3041+
adev->in_s3 && !adev->suspend_complete) {
3042+
DRM_INFO(" Will skip the CSB packet resubmit\n");
3043+
return 0;
3044+
}
30373045
r = amdgpu_ring_alloc(ring, gfx_v9_0_get_csb_size(adev) + 4 + 3);
30383046
if (r) {
30393047
DRM_ERROR("amdgpu: cp failed to lock ring (%d).\n", r);

0 commit comments

Comments
 (0)