1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00

drm/amdgpu: update the handle ptr in suspend

Update the *handle to amdgpu_ip_block ptr for all
functions pointers of suspend.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Sunil Khatri 2024-09-30 17:00:38 +05:30 committed by Alex Deucher
parent 82ae6619a4
commit 982d7f9bfe
89 changed files with 190 additions and 178 deletions

View file

@ -85,7 +85,7 @@ static int aldebaran_mode2_suspend_ip(struct amdgpu_device *adev)
AMD_IP_BLOCK_TYPE_SDMA))
continue;
r = adev->ip_blocks[i].version->funcs->suspend(adev);
r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
if (r) {
dev_err(adev->dev,

View file

@ -565,9 +565,9 @@ static int acp_hw_fini(void *handle)
return 0;
}
static int acp_suspend(void *handle)
static int acp_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
/* power up on suspend */
if (!adev->acp.acp_cell)

View file

@ -3464,7 +3464,7 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev)
continue;
/* XXX handle errors */
r = adev->ip_blocks[i].version->funcs->suspend(adev);
r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
/* XXX handle errors */
if (r) {
DRM_ERROR("suspend of IP block <%s> failed %d\n",
@ -3546,7 +3546,7 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
continue;
/* XXX handle errors */
r = adev->ip_blocks[i].version->funcs->suspend(adev);
r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
/* XXX handle errors */
if (r) {
DRM_ERROR("suspend of IP block <%s> failed %d\n",

View file

@ -83,7 +83,7 @@ static int isp_hw_fini(void *handle)
return -ENODEV;
}
static int isp_suspend(void *handle)
static int isp_suspend(struct amdgpu_ip_block *ip_block)
{
return 0;
}

View file

@ -3026,10 +3026,10 @@ static int psp_hw_fini(void *handle)
return 0;
}
static int psp_suspend(void *handle)
static int psp_suspend(struct amdgpu_ip_block *ip_block)
{
int ret = 0;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
struct psp_context *psp = &adev->psp;
if (adev->gmc.xgmi.num_physical_nodes > 1 &&

View file

@ -40,7 +40,7 @@ static int amdgpu_reset_xgmi_reset_on_init_suspend(struct amdgpu_device *adev)
continue;
/* XXX handle errors */
r = adev->ip_blocks[i].version->funcs->suspend(adev);
r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
/* XXX handle errors */
if (r) {
dev_err(adev->dev, "suspend of IP block <%s> failed %d",

View file

@ -873,9 +873,9 @@ static int umsch_mm_hw_fini(void *handle)
return 0;
}
static int umsch_mm_suspend(void *handle)
static int umsch_mm_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return umsch_mm_hw_fini(adev);
}

View file

@ -605,15 +605,15 @@ static int amdgpu_vkms_hw_fini(void *handle)
return 0;
}
static int amdgpu_vkms_suspend(void *handle)
static int amdgpu_vkms_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = drm_mode_config_helper_suspend(adev_to_drm(adev));
if (r)
return r;
return amdgpu_vkms_hw_fini(handle);
return amdgpu_vkms_hw_fini(adev);
}
static int amdgpu_vkms_resume(void *handle)

View file

@ -434,9 +434,9 @@ static int vpe_hw_fini(void *handle)
return 0;
}
static int vpe_suspend(void *handle)
static int vpe_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
cancel_delayed_work_sync(&adev->vpe.idle_work);

View file

@ -2153,9 +2153,9 @@ static int cik_common_hw_fini(void *handle)
return 0;
}
static int cik_common_suspend(void *handle)
static int cik_common_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return cik_common_hw_fini(adev);
}

View file

@ -337,9 +337,9 @@ static int cik_ih_hw_fini(void *handle)
return 0;
}
static int cik_ih_suspend(void *handle)
static int cik_ih_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return cik_ih_hw_fini(adev);
}

View file

@ -1011,9 +1011,9 @@ static int cik_sdma_hw_fini(void *handle)
return 0;
}
static int cik_sdma_suspend(void *handle)
static int cik_sdma_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return cik_sdma_hw_fini(adev);
}

View file

@ -333,9 +333,9 @@ static int cz_ih_hw_fini(void *handle)
return 0;
}
static int cz_ih_suspend(void *handle)
static int cz_ih_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return cz_ih_hw_fini(adev);
}

View file

@ -2905,9 +2905,9 @@ static int dce_v10_0_hw_fini(void *handle)
return 0;
}
static int dce_v10_0_suspend(void *handle)
static int dce_v10_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = amdgpu_display_suspend_helper(adev);
@ -2917,7 +2917,7 @@ static int dce_v10_0_suspend(void *handle)
adev->mode_info.bl_level =
amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
return dce_v10_0_hw_fini(handle);
return dce_v10_0_hw_fini(adev);
}
static int dce_v10_0_resume(void *handle)

View file

@ -3043,9 +3043,9 @@ static int dce_v11_0_hw_fini(void *handle)
return 0;
}
static int dce_v11_0_suspend(void *handle)
static int dce_v11_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = amdgpu_display_suspend_helper(adev);
@ -3055,7 +3055,7 @@ static int dce_v11_0_suspend(void *handle)
adev->mode_info.bl_level =
amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
return dce_v11_0_hw_fini(handle);
return dce_v11_0_hw_fini(adev);
}
static int dce_v11_0_resume(void *handle)

View file

@ -2801,9 +2801,9 @@ static int dce_v6_0_hw_fini(void *handle)
return 0;
}
static int dce_v6_0_suspend(void *handle)
static int dce_v6_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = amdgpu_display_suspend_helper(adev);
@ -2812,7 +2812,7 @@ static int dce_v6_0_suspend(void *handle)
adev->mode_info.bl_level =
amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
return dce_v6_0_hw_fini(handle);
return dce_v6_0_hw_fini(adev);
}
static int dce_v6_0_resume(void *handle)

View file

@ -2823,9 +2823,9 @@ static int dce_v8_0_hw_fini(void *handle)
return 0;
}
static int dce_v8_0_suspend(void *handle)
static int dce_v8_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = amdgpu_display_suspend_helper(adev);
@ -2835,7 +2835,7 @@ static int dce_v8_0_suspend(void *handle)
adev->mode_info.bl_level =
amdgpu_atombios_encoder_get_backlight_level_from_reg(adev);
return dce_v8_0_hw_fini(handle);
return dce_v8_0_hw_fini(adev);
}
static int dce_v8_0_resume(void *handle)

View file

@ -7456,9 +7456,11 @@ static int gfx_v10_0_hw_fini(void *handle)
return 0;
}
static int gfx_v10_0_suspend(void *handle)
static int gfx_v10_0_suspend(struct amdgpu_ip_block *ip_block)
{
return gfx_v10_0_hw_fini(handle);
struct amdgpu_device *adev = ip_block->adev;
return gfx_v10_0_hw_fini(adev);
}
static int gfx_v10_0_resume(void *handle)

View file

@ -4705,9 +4705,11 @@ static int gfx_v11_0_hw_fini(void *handle)
return 0;
}
static int gfx_v11_0_suspend(void *handle)
static int gfx_v11_0_suspend(struct amdgpu_ip_block *ip_block)
{
return gfx_v11_0_hw_fini(handle);
struct amdgpu_device *adev = ip_block->adev;
return gfx_v11_0_hw_fini(adev);
}
static int gfx_v11_0_resume(void *handle)

View file

@ -3643,9 +3643,11 @@ static int gfx_v12_0_hw_fini(void *handle)
return 0;
}
static int gfx_v12_0_suspend(void *handle)
static int gfx_v12_0_suspend(struct amdgpu_ip_block *ip_block)
{
return gfx_v12_0_hw_fini(handle);
struct amdgpu_device *adev = ip_block->adev;
return gfx_v12_0_hw_fini(adev);
}
static int gfx_v12_0_resume(void *handle)

View file

@ -3153,9 +3153,9 @@ static int gfx_v6_0_hw_fini(void *handle)
return 0;
}
static int gfx_v6_0_suspend(void *handle)
static int gfx_v6_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return gfx_v6_0_hw_fini(adev);
}

View file

@ -4499,9 +4499,9 @@ static int gfx_v7_0_hw_fini(void *handle)
return 0;
}
static int gfx_v7_0_suspend(void *handle)
static int gfx_v7_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return gfx_v7_0_hw_fini(adev);
}

View file

@ -4917,9 +4917,11 @@ static int gfx_v8_0_hw_fini(void *handle)
return 0;
}
static int gfx_v8_0_suspend(void *handle)
static int gfx_v8_0_suspend(struct amdgpu_ip_block *ip_block)
{
return gfx_v8_0_hw_fini(handle);
struct amdgpu_device *adev = ip_block->adev;
return gfx_v8_0_hw_fini(adev);
}
static int gfx_v8_0_resume(void *handle)

View file

@ -4074,9 +4074,11 @@ static int gfx_v9_0_hw_fini(void *handle)
return 0;
}
static int gfx_v9_0_suspend(void *handle)
static int gfx_v9_0_suspend(struct amdgpu_ip_block *ip_block)
{
return gfx_v9_0_hw_fini(handle);
struct amdgpu_device *adev = ip_block->adev;
return gfx_v9_0_hw_fini(adev);
}
static int gfx_v9_0_resume(void *handle)

View file

@ -2386,9 +2386,11 @@ static int gfx_v9_4_3_hw_fini(void *handle)
return 0;
}
static int gfx_v9_4_3_suspend(void *handle)
static int gfx_v9_4_3_suspend(struct amdgpu_ip_block *ip_block)
{
return gfx_v9_4_3_hw_fini(handle);
struct amdgpu_device *adev = ip_block->adev;
return gfx_v9_4_3_hw_fini(adev);
}
static int gfx_v9_4_3_resume(void *handle)

View file

@ -1053,9 +1053,9 @@ static int gmc_v10_0_hw_fini(void *handle)
return 0;
}
static int gmc_v10_0_suspend(void *handle)
static int gmc_v10_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
gmc_v10_0_hw_fini(adev);

View file

@ -961,9 +961,9 @@ static int gmc_v11_0_hw_fini(void *handle)
return 0;
}
static int gmc_v11_0_suspend(void *handle)
static int gmc_v11_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
gmc_v11_0_hw_fini(adev);

View file

@ -945,9 +945,9 @@ static int gmc_v12_0_hw_fini(void *handle)
return 0;
}
static int gmc_v12_0_suspend(void *handle)
static int gmc_v12_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
gmc_v12_0_hw_fini(adev);

View file

@ -935,9 +935,9 @@ static int gmc_v6_0_hw_fini(void *handle)
return 0;
}
static int gmc_v6_0_suspend(void *handle)
static int gmc_v6_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
gmc_v6_0_hw_fini(adev);

View file

@ -1111,9 +1111,9 @@ static int gmc_v7_0_hw_fini(void *handle)
return 0;
}
static int gmc_v7_0_suspend(void *handle)
static int gmc_v7_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
gmc_v7_0_hw_fini(adev);

View file

@ -1242,9 +1242,9 @@ static int gmc_v8_0_hw_fini(void *handle)
return 0;
}
static int gmc_v8_0_suspend(void *handle)
static int gmc_v8_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
gmc_v8_0_hw_fini(adev);

View file

@ -2428,9 +2428,9 @@ static int gmc_v9_0_hw_fini(void *handle)
return 0;
}
static int gmc_v9_0_suspend(void *handle)
static int gmc_v9_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return gmc_v9_0_hw_fini(adev);
}

View file

@ -327,9 +327,9 @@ static int iceland_ih_hw_fini(void *handle)
return 0;
}
static int iceland_ih_suspend(void *handle)
static int iceland_ih_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return iceland_ih_hw_fini(adev);
}

View file

@ -644,9 +644,9 @@ static int ih_v6_0_hw_fini(void *handle)
return 0;
}
static int ih_v6_0_suspend(void *handle)
static int ih_v6_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return ih_v6_0_hw_fini(adev);
}

View file

@ -623,9 +623,9 @@ static int ih_v6_1_hw_fini(void *handle)
return 0;
}
static int ih_v6_1_suspend(void *handle)
static int ih_v6_1_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return ih_v6_1_hw_fini(adev);
}

View file

@ -613,9 +613,9 @@ static int ih_v7_0_hw_fini(void *handle)
return 0;
}
static int ih_v7_0_suspend(void *handle)
static int ih_v7_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return ih_v7_0_hw_fini(adev);
}

View file

@ -166,9 +166,9 @@ static int jpeg_v2_0_hw_fini(void *handle)
*
* HW fini and suspend JPEG block
*/
static int jpeg_v2_0_suspend(void *handle)
static int jpeg_v2_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = jpeg_v2_0_hw_fini(adev);

View file

@ -235,9 +235,9 @@ static int jpeg_v2_5_hw_fini(void *handle)
*
* HW fini and suspend JPEG block
*/
static int jpeg_v2_5_suspend(void *handle)
static int jpeg_v2_5_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = jpeg_v2_5_hw_fini(adev);

View file

@ -180,9 +180,9 @@ static int jpeg_v3_0_hw_fini(void *handle)
*
* HW fini and suspend JPEG block
*/
static int jpeg_v3_0_suspend(void *handle)
static int jpeg_v3_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = jpeg_v3_0_hw_fini(adev);

View file

@ -214,9 +214,9 @@ static int jpeg_v4_0_hw_fini(void *handle)
*
* HW fini and suspend JPEG block
*/
static int jpeg_v4_0_suspend(void *handle)
static int jpeg_v4_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = jpeg_v4_0_hw_fini(adev);

View file

@ -384,9 +384,9 @@ static int jpeg_v4_0_3_hw_fini(void *handle)
*
* HW fini and suspend JPEG block
*/
static int jpeg_v4_0_3_suspend(void *handle)
static int jpeg_v4_0_3_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = jpeg_v4_0_3_hw_fini(adev);

View file

@ -241,9 +241,9 @@ static int jpeg_v4_0_5_hw_fini(void *handle)
*
* HW fini and suspend JPEG block
*/
static int jpeg_v4_0_5_suspend(void *handle)
static int jpeg_v4_0_5_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = jpeg_v4_0_5_hw_fini(adev);

View file

@ -177,9 +177,9 @@ static int jpeg_v5_0_0_hw_fini(void *handle)
*
* HW fini and suspend JPEG block
*/
static int jpeg_v5_0_0_suspend(void *handle)
static int jpeg_v5_0_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = jpeg_v5_0_0_hw_fini(adev);

View file

@ -1629,10 +1629,10 @@ static int mes_v11_0_hw_fini(void *handle)
return 0;
}
static int mes_v11_0_suspend(void *handle)
static int mes_v11_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
r = amdgpu_mes_suspend(adev);
if (r)

View file

@ -1593,10 +1593,10 @@ static int mes_v12_0_hw_fini(void *handle)
return 0;
}
static int mes_v12_0_suspend(void *handle)
static int mes_v12_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
r = amdgpu_mes_suspend(adev);
if (r)

View file

@ -618,9 +618,9 @@ static int navi10_ih_hw_fini(void *handle)
return 0;
}
static int navi10_ih_suspend(void *handle)
static int navi10_ih_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return navi10_ih_hw_fini(adev);
}

View file

@ -1029,9 +1029,9 @@ static int nv_common_hw_fini(void *handle)
return 0;
}
static int nv_common_suspend(void *handle)
static int nv_common_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return nv_common_hw_fini(adev);
}

View file

@ -901,9 +901,9 @@ static int sdma_v2_4_hw_fini(void *handle)
return 0;
}
static int sdma_v2_4_suspend(void *handle)
static int sdma_v2_4_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return sdma_v2_4_hw_fini(adev);
}

View file

@ -1188,9 +1188,9 @@ static int sdma_v3_0_hw_fini(void *handle)
return 0;
}
static int sdma_v3_0_suspend(void *handle)
static int sdma_v3_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return sdma_v3_0_hw_fini(adev);
}

View file

@ -1988,9 +1988,9 @@ static int sdma_v4_0_hw_fini(void *handle)
return 0;
}
static int sdma_v4_0_suspend(void *handle)
static int sdma_v4_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
/* SMU saves SDMA state for us */
if (adev->in_s0ix) {

View file

@ -1508,9 +1508,9 @@ static int sdma_v4_4_2_hw_fini(void *handle)
static int sdma_v4_4_2_set_clockgating_state(void *handle,
enum amd_clockgating_state state);
static int sdma_v4_4_2_suspend(void *handle)
static int sdma_v4_4_2_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
if (amdgpu_in_reset(adev))
sdma_v4_4_2_set_clockgating_state(adev, AMD_CG_STATE_UNGATE);

View file

@ -1502,9 +1502,9 @@ static int sdma_v5_0_hw_fini(void *handle)
return 0;
}
static int sdma_v5_0_suspend(void *handle)
static int sdma_v5_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return sdma_v5_0_hw_fini(adev);
}

View file

@ -1402,9 +1402,9 @@ static int sdma_v5_2_hw_fini(void *handle)
return 0;
}
static int sdma_v5_2_suspend(void *handle)
static int sdma_v5_2_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return sdma_v5_2_hw_fini(adev);
}

View file

@ -1400,9 +1400,9 @@ static int sdma_v6_0_hw_fini(void *handle)
return 0;
}
static int sdma_v6_0_suspend(void *handle)
static int sdma_v6_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return sdma_v6_0_hw_fini(adev);
}

View file

@ -1358,9 +1358,9 @@ static int sdma_v7_0_hw_fini(void *handle)
return 0;
}
static int sdma_v7_0_suspend(void *handle)
static int sdma_v7_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return sdma_v7_0_hw_fini(adev);
}

View file

@ -2650,9 +2650,9 @@ static int si_common_hw_fini(void *handle)
return 0;
}
static int si_common_suspend(void *handle)
static int si_common_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return si_common_hw_fini(adev);
}

View file

@ -533,9 +533,9 @@ static int si_dma_hw_fini(void *handle)
return 0;
}
static int si_dma_suspend(void *handle)
static int si_dma_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return si_dma_hw_fini(adev);
}

View file

@ -202,9 +202,9 @@ static int si_ih_hw_fini(void *handle)
return 0;
}
static int si_ih_suspend(void *handle)
static int si_ih_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return si_ih_hw_fini(adev);
}

View file

@ -81,7 +81,7 @@ static int sienna_cichlid_mode2_suspend_ip(struct amdgpu_device *adev)
AMD_IP_BLOCK_TYPE_SDMA))
continue;
r = adev->ip_blocks[i].version->funcs->suspend(adev);
r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
if (r) {
dev_err(adev->dev,

View file

@ -80,7 +80,7 @@ static int smu_v13_0_10_mode2_suspend_ip(struct amdgpu_device *adev)
AMD_IP_BLOCK_TYPE_MES))
continue;
r = adev->ip_blocks[i].version->funcs->suspend(adev);
r = adev->ip_blocks[i].version->funcs->suspend(&adev->ip_blocks[i]);
if (r) {
dev_err(adev->dev,

View file

@ -1318,9 +1318,9 @@ static int soc15_common_hw_fini(void *handle)
return 0;
}
static int soc15_common_suspend(void *handle)
static int soc15_common_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return soc15_common_hw_fini(adev);
}

View file

@ -890,9 +890,9 @@ static int soc21_common_hw_fini(void *handle)
return 0;
}
static int soc21_common_suspend(void *handle)
static int soc21_common_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return soc21_common_hw_fini(adev);
}

View file

@ -512,9 +512,9 @@ static int soc24_common_hw_fini(void *handle)
return 0;
}
static int soc24_common_suspend(void *handle)
static int soc24_common_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return soc24_common_hw_fini(adev);
}

View file

@ -345,9 +345,9 @@ static int tonga_ih_hw_fini(void *handle)
return 0;
}
static int tonga_ih_suspend(void *handle)
static int tonga_ih_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return tonga_ih_hw_fini(adev);
}

View file

@ -711,10 +711,10 @@ static int uvd_v3_1_prepare_suspend(struct amdgpu_ip_block *ip_block)
return amdgpu_uvd_prepare_suspend(adev);
}
static int uvd_v3_1_suspend(void *handle)
static int uvd_v3_1_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
/*
* Proper cleanups before halting the HW engine:

View file

@ -225,10 +225,10 @@ static int uvd_v4_2_prepare_suspend(struct amdgpu_ip_block *ip_block)
return amdgpu_uvd_prepare_suspend(adev);
}
static int uvd_v4_2_suspend(void *handle)
static int uvd_v4_2_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
/*
* Proper cleanups before halting the HW engine:

View file

@ -223,10 +223,10 @@ static int uvd_v5_0_prepare_suspend(struct amdgpu_ip_block *ip_block)
return amdgpu_uvd_prepare_suspend(adev);
}
static int uvd_v5_0_suspend(void *handle)
static int uvd_v5_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
/*
* Proper cleanups before halting the HW engine:

View file

@ -547,10 +547,10 @@ static int uvd_v6_0_prepare_suspend(struct amdgpu_ip_block *ip_block)
return amdgpu_uvd_prepare_suspend(adev);
}
static int uvd_v6_0_suspend(void *handle)
static int uvd_v6_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
/*
* Proper cleanups before halting the HW engine:

View file

@ -615,10 +615,10 @@ static int uvd_v7_0_prepare_suspend(struct amdgpu_ip_block *ip_block)
return amdgpu_uvd_prepare_suspend(adev);
}
static int uvd_v7_0_suspend(void *handle)
static int uvd_v7_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
/*
* Proper cleanups before halting the HW engine:

View file

@ -490,10 +490,10 @@ static int vce_v2_0_hw_fini(void *handle)
return 0;
}
static int vce_v2_0_suspend(void *handle)
static int vce_v2_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
/*

View file

@ -505,10 +505,10 @@ static int vce_v3_0_hw_fini(void *handle)
return vce_v3_0_set_clockgating_state(adev, AMD_CG_STATE_GATE);
}
static int vce_v3_0_suspend(void *handle)
static int vce_v3_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
/*
* Proper cleanups before halting the HW engine:
@ -713,7 +713,7 @@ static int vce_v3_0_pre_soft_reset(struct amdgpu_ip_block *ip_block)
mdelay(5);
return vce_v3_0_suspend(adev);
return vce_v3_0_suspend(ip_block);
}

View file

@ -558,9 +558,9 @@ static int vce_v4_0_hw_fini(void *handle)
return 0;
}
static int vce_v4_0_suspend(void *handle)
static int vce_v4_0_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r, idx;
if (adev->vce.vcpu_bo == NULL)

View file

@ -294,10 +294,10 @@ static int vcn_v1_0_hw_fini(void *handle)
*
* HW fini and suspend VCN block
*/
static int vcn_v1_0_suspend(void *handle)
static int vcn_v1_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
bool idle_work_unexecuted;
idle_work_unexecuted = cancel_delayed_work_sync(&adev->vcn.idle_work);

View file

@ -330,10 +330,10 @@ static int vcn_v2_0_hw_fini(void *handle)
*
* HW fini and suspend VCN block
*/
static int vcn_v2_0_suspend(void *handle)
static int vcn_v2_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
r = vcn_v2_0_hw_fini(adev);
if (r)

View file

@ -415,10 +415,10 @@ static int vcn_v2_5_hw_fini(void *handle)
*
* HW fini and suspend VCN block
*/
static int vcn_v2_5_suspend(void *handle)
static int vcn_v2_5_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
r = vcn_v2_5_hw_fini(adev);
if (r)

View file

@ -447,10 +447,10 @@ static int vcn_v3_0_hw_fini(void *handle)
*
* HW fini and suspend VCN block
*/
static int vcn_v3_0_suspend(void *handle)
static int vcn_v3_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
r = vcn_v3_0_hw_fini(adev);
if (r)

View file

@ -376,10 +376,10 @@ static int vcn_v4_0_hw_fini(void *handle)
*
* HW fini and suspend VCN block
*/
static int vcn_v4_0_suspend(void *handle)
static int vcn_v4_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
r = vcn_v4_0_hw_fini(adev);
if (r)

View file

@ -331,9 +331,9 @@ static int vcn_v4_0_3_hw_fini(void *handle)
*
* HW fini and suspend VCN block
*/
static int vcn_v4_0_3_suspend(void *handle)
static int vcn_v4_0_3_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
int r;
r = vcn_v4_0_3_hw_fini(adev);

View file

@ -324,10 +324,10 @@ static int vcn_v4_0_5_hw_fini(void *handle)
*
* HW fini and suspend VCN block
*/
static int vcn_v4_0_5_suspend(void *handle)
static int vcn_v4_0_5_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
r = vcn_v4_0_5_hw_fini(adev);
if (r)

View file

@ -288,10 +288,10 @@ static int vcn_v5_0_0_hw_fini(void *handle)
*
* HW fini and suspend VCN block
*/
static int vcn_v5_0_0_suspend(void *handle)
static int vcn_v5_0_0_suspend(struct amdgpu_ip_block *ip_block)
{
int r;
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
r = vcn_v5_0_0_hw_fini(adev);
if (r)

View file

@ -550,9 +550,9 @@ static int vega10_ih_hw_fini(void *handle)
return 0;
}
static int vega10_ih_suspend(void *handle)
static int vega10_ih_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return vega10_ih_hw_fini(adev);
}

View file

@ -616,9 +616,9 @@ static int vega20_ih_hw_fini(void *handle)
return 0;
}
static int vega20_ih_suspend(void *handle)
static int vega20_ih_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return vega20_ih_hw_fini(adev);
}

View file

@ -1731,9 +1731,9 @@ static int vi_common_hw_fini(void *handle)
return 0;
}
static int vi_common_suspend(void *handle)
static int vi_common_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
return vi_common_hw_fini(adev);
}

View file

@ -2936,9 +2936,9 @@ static void hpd_rx_irq_work_suspend(struct amdgpu_display_manager *dm)
}
}
static int dm_suspend(void *handle)
static int dm_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = handle;
struct amdgpu_device *adev = ip_block->adev;
struct amdgpu_display_manager *dm = &adev->dm;
int ret = 0;

View file

@ -388,7 +388,7 @@ struct amd_ip_funcs {
int (*hw_fini)(void *handle);
void (*late_fini)(struct amdgpu_ip_block *ip_block);
int (*prepare_suspend)(struct amdgpu_ip_block *ip_block);
int (*suspend)(void *handle);
int (*suspend)(struct amdgpu_ip_block *ip_block);
int (*resume)(void *handle);
bool (*is_idle)(void *handle);
int (*wait_for_idle)(struct amdgpu_ip_block *ip_block);

View file

@ -3062,9 +3062,9 @@ static int kv_dpm_hw_fini(void *handle)
return 0;
}
static int kv_dpm_suspend(void *handle)
static int kv_dpm_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
if (adev->pm.dpm_enabled) {
/* disable dpm */

View file

@ -7805,9 +7805,9 @@ static int si_dpm_hw_fini(void *handle)
return 0;
}
static int si_dpm_suspend(void *handle)
static int si_dpm_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
if (adev->pm.dpm_enabled) {
/* disable dpm */

View file

@ -261,9 +261,9 @@ static int pp_set_powergating_state(void *handle,
return 0;
}
static int pp_suspend(void *handle)
static int pp_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = handle;
struct amdgpu_device *adev = ip_block->adev;
struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
cancel_delayed_work_sync(&hwmgr->swctf_delayed_work);

View file

@ -2075,9 +2075,9 @@ static int smu_reset(struct smu_context *smu)
return 0;
}
static int smu_suspend(void *handle)
static int smu_suspend(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
struct amdgpu_device *adev = ip_block->adev;
struct smu_context *smu = adev->powerplay.pp_handle;
int ret;
uint64_t count;