Skip to content

Commit d0ce1aa

Browse files
committed
Revert "drm/amd: Stop evicting resources on APUs in suspend"
This reverts commit 3a9626c. This breaks S4 because we end up setting the s3/s0ix flags even when we are entering s4 since prepare is used by both flows. The causes both the S3/s0ix and s4 flags to be set which breaks several checks in the driver which assume they are mutually exclusive. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3634 Cc: Mario Limonciello <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit ce8f7d9) Cc: [email protected]
1 parent b7e84fb commit d0ce1aa

File tree

3 files changed

+2
-29
lines changed

3 files changed

+2
-29
lines changed

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,11 +1614,9 @@ static inline void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_cap
16141614
#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
16151615
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
16161616
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
1617-
void amdgpu_choose_low_power_state(struct amdgpu_device *adev);
16181617
#else
16191618
static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
16201619
static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
1621-
static inline void amdgpu_choose_low_power_state(struct amdgpu_device *adev) { }
16221620
#endif
16231621

16241622
void amdgpu_register_gpu_instance(struct amdgpu_device *adev);

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1533,22 +1533,4 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
15331533
#endif /* CONFIG_AMD_PMC */
15341534
}
15351535

1536-
/**
1537-
* amdgpu_choose_low_power_state
1538-
*
1539-
* @adev: amdgpu_device_pointer
1540-
*
1541-
* Choose the target low power state for the GPU
1542-
*/
1543-
void amdgpu_choose_low_power_state(struct amdgpu_device *adev)
1544-
{
1545-
if (adev->in_runpm)
1546-
return;
1547-
1548-
if (amdgpu_acpi_is_s0ix_active(adev))
1549-
adev->in_s0ix = true;
1550-
else if (amdgpu_acpi_is_s3_active(adev))
1551-
adev->in_s3 = true;
1552-
}
1553-
15541536
#endif /* CONFIG_SUSPEND */

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4949,15 +4949,13 @@ int amdgpu_device_prepare(struct drm_device *dev)
49494949
struct amdgpu_device *adev = drm_to_adev(dev);
49504950
int i, r;
49514951

4952-
amdgpu_choose_low_power_state(adev);
4953-
49544952
if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
49554953
return 0;
49564954

49574955
/* Evict the majority of BOs before starting suspend sequence */
49584956
r = amdgpu_device_evict_resources(adev);
49594957
if (r)
4960-
goto unprepare;
4958+
return r;
49614959

49624960
flush_delayed_work(&adev->gfx.gfx_off_delay_work);
49634961

@@ -4968,15 +4966,10 @@ int amdgpu_device_prepare(struct drm_device *dev)
49684966
continue;
49694967
r = adev->ip_blocks[i].version->funcs->prepare_suspend(&adev->ip_blocks[i]);
49704968
if (r)
4971-
goto unprepare;
4969+
return r;
49724970
}
49734971

49744972
return 0;
4975-
4976-
unprepare:
4977-
adev->in_s0ix = adev->in_s3 = adev->in_s4 = false;
4978-
4979-
return r;
49804973
}
49814974

49824975
/**

0 commit comments

Comments
 (0)