mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-07 02:19:54 +00:00
Revert "drm/amd: Stop evicting resources on APUs in suspend"
This reverts commit3a9626c816. 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 <mario.limonciello@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commitce8f7d9589) Cc: stable@vger.kernel.org
This commit is contained in:
@@ -1614,11 +1614,9 @@ static inline void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_cap
|
|||||||
#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
|
#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
|
||||||
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
|
bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
|
||||||
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
|
bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
|
||||||
void amdgpu_choose_low_power_state(struct amdgpu_device *adev);
|
|
||||||
#else
|
#else
|
||||||
static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
|
static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
|
||||||
static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
|
static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
|
||||||
static inline void amdgpu_choose_low_power_state(struct amdgpu_device *adev) { }
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void amdgpu_register_gpu_instance(struct amdgpu_device *adev);
|
void amdgpu_register_gpu_instance(struct amdgpu_device *adev);
|
||||||
|
|||||||
@@ -1533,22 +1533,4 @@ bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
|
|||||||
#endif /* CONFIG_AMD_PMC */
|
#endif /* CONFIG_AMD_PMC */
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* amdgpu_choose_low_power_state
|
|
||||||
*
|
|
||||||
* @adev: amdgpu_device_pointer
|
|
||||||
*
|
|
||||||
* Choose the target low power state for the GPU
|
|
||||||
*/
|
|
||||||
void amdgpu_choose_low_power_state(struct amdgpu_device *adev)
|
|
||||||
{
|
|
||||||
if (adev->in_runpm)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (amdgpu_acpi_is_s0ix_active(adev))
|
|
||||||
adev->in_s0ix = true;
|
|
||||||
else if (amdgpu_acpi_is_s3_active(adev))
|
|
||||||
adev->in_s3 = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* CONFIG_SUSPEND */
|
#endif /* CONFIG_SUSPEND */
|
||||||
|
|||||||
@@ -4949,15 +4949,13 @@ int amdgpu_device_prepare(struct drm_device *dev)
|
|||||||
struct amdgpu_device *adev = drm_to_adev(dev);
|
struct amdgpu_device *adev = drm_to_adev(dev);
|
||||||
int i, r;
|
int i, r;
|
||||||
|
|
||||||
amdgpu_choose_low_power_state(adev);
|
|
||||||
|
|
||||||
if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* Evict the majority of BOs before starting suspend sequence */
|
/* Evict the majority of BOs before starting suspend sequence */
|
||||||
r = amdgpu_device_evict_resources(adev);
|
r = amdgpu_device_evict_resources(adev);
|
||||||
if (r)
|
if (r)
|
||||||
goto unprepare;
|
return r;
|
||||||
|
|
||||||
flush_delayed_work(&adev->gfx.gfx_off_delay_work);
|
flush_delayed_work(&adev->gfx.gfx_off_delay_work);
|
||||||
|
|
||||||
@@ -4968,15 +4966,10 @@ int amdgpu_device_prepare(struct drm_device *dev)
|
|||||||
continue;
|
continue;
|
||||||
r = adev->ip_blocks[i].version->funcs->prepare_suspend(&adev->ip_blocks[i]);
|
r = adev->ip_blocks[i].version->funcs->prepare_suspend(&adev->ip_blocks[i]);
|
||||||
if (r)
|
if (r)
|
||||||
goto unprepare;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
unprepare:
|
|
||||||
adev->in_s0ix = adev->in_s3 = adev->in_s4 = false;
|
|
||||||
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user