mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
drm/amd: Add support for a complete pmops action
complete() callbacks are supposed to handle reversing anything that occurred during prepare() callbacks. They'll be called on every power state transition, and will also be called if the sequence is failed (such as an aborted suspend). Add support for IP blocks to support this action. Reviewed-by: Alex Hung <alex.hung@amd.com> Link: https://lore.kernel.org/r/20250602014432.3538345-2-superm1@kernel.org Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
dd3999b658
commit
64c3e4a868
@@ -5040,6 +5040,28 @@ int amdgpu_device_prepare(struct drm_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_device_complete - complete power state transition
|
||||
*
|
||||
* @dev: drm dev pointer
|
||||
*
|
||||
* Undo the changes from amdgpu_device_prepare. This will be
|
||||
* called on all resume transitions, including those that failed.
|
||||
*/
|
||||
void amdgpu_device_complete(struct drm_device *dev)
|
||||
{
|
||||
struct amdgpu_device *adev = drm_to_adev(dev);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < adev->num_ip_blocks; i++) {
|
||||
if (!adev->ip_blocks[i].status.valid)
|
||||
continue;
|
||||
if (!adev->ip_blocks[i].version->funcs->complete)
|
||||
continue;
|
||||
adev->ip_blocks[i].version->funcs->complete(&adev->ip_blocks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* amdgpu_device_suspend - initiate device suspend
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user