mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 15:24:02 -04:00
drm/amdgpu: Add early fini callback
Use it to call disply code dependent on device->drv_data before it's set to NULL on device unplug v5: Move HW finilization into this callback to prevent MMIO accesses post cpi remove. v7: Split kfd suspend from device exit to expdite HW related stuff to amdgpu_pci_remove v8: Squash previous KFD commit into this commit to avoid compile break. Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210520032057.497334-1-andrey.grodzovsky@amd.com
This commit is contained in:
@@ -1251,6 +1251,15 @@ error:
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static int amdgpu_dm_early_fini(void *handle)
|
||||
{
|
||||
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
|
||||
|
||||
amdgpu_dm_audio_fini(adev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void amdgpu_dm_fini(struct amdgpu_device *adev)
|
||||
{
|
||||
int i;
|
||||
@@ -1259,8 +1268,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
|
||||
drm_encoder_cleanup(&adev->dm.mst_encoders[i].base);
|
||||
}
|
||||
|
||||
amdgpu_dm_audio_fini(adev);
|
||||
|
||||
amdgpu_dm_destroy_drm_device(&adev->dm);
|
||||
|
||||
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
|
||||
@@ -2298,6 +2305,7 @@ static const struct amd_ip_funcs amdgpu_dm_funcs = {
|
||||
.late_init = dm_late_init,
|
||||
.sw_init = dm_sw_init,
|
||||
.sw_fini = dm_sw_fini,
|
||||
.early_fini = amdgpu_dm_early_fini,
|
||||
.hw_init = dm_hw_init,
|
||||
.hw_fini = dm_hw_fini,
|
||||
.suspend = dm_suspend,
|
||||
|
||||
Reference in New Issue
Block a user