Skip to content

Commit 2ddb629

Browse files
Tao Zhoualexdeucher
authored andcommitted
drm/amdgpu: define common vcn_set_ras_funcs
So the code can be reused. Signed-off-by: Tao Zhou <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 07615da commit 2ddb629

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,3 +1248,20 @@ int amdgpu_vcn_process_poison_irq(struct amdgpu_device *adev,
12481248

12491249
return 0;
12501250
}
1251+
1252+
void amdgpu_vcn_set_ras_funcs(struct amdgpu_device *adev)
1253+
{
1254+
if (!adev->vcn.ras)
1255+
return;
1256+
1257+
amdgpu_ras_register_ras_block(adev, &adev->vcn.ras->ras_block);
1258+
1259+
strcpy(adev->vcn.ras->ras_block.ras_comm.name, "vcn");
1260+
adev->vcn.ras->ras_block.ras_comm.block = AMDGPU_RAS_BLOCK__VCN;
1261+
adev->vcn.ras->ras_block.ras_comm.type = AMDGPU_RAS_ERROR__POISON;
1262+
adev->vcn.ras_if = &adev->vcn.ras->ras_block.ras_comm;
1263+
1264+
/* If don't define special ras_late_init function, use default ras_late_init */
1265+
if (!adev->vcn.ras->ras_block.ras_late_init)
1266+
adev->vcn.ras->ras_block.ras_late_init = amdgpu_ras_block_late_init;
1267+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,5 +399,6 @@ void amdgpu_debugfs_vcn_fwlog_init(struct amdgpu_device *adev,
399399
int amdgpu_vcn_process_poison_irq(struct amdgpu_device *adev,
400400
struct amdgpu_irq_src *source,
401401
struct amdgpu_iv_entry *entry);
402+
void amdgpu_vcn_set_ras_funcs(struct amdgpu_device *adev);
402403

403404
#endif

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,16 +2002,5 @@ static void vcn_v2_5_set_ras_funcs(struct amdgpu_device *adev)
20022002
break;
20032003
}
20042004

2005-
if (adev->vcn.ras) {
2006-
amdgpu_ras_register_ras_block(adev, &adev->vcn.ras->ras_block);
2007-
2008-
strcpy(adev->vcn.ras->ras_block.ras_comm.name, "vcn");
2009-
adev->vcn.ras->ras_block.ras_comm.block = AMDGPU_RAS_BLOCK__VCN;
2010-
adev->vcn.ras->ras_block.ras_comm.type = AMDGPU_RAS_ERROR__POISON;
2011-
adev->vcn.ras_if = &adev->vcn.ras->ras_block.ras_comm;
2012-
2013-
/* If don't define special ras_late_init function, use default ras_late_init */
2014-
if (!adev->vcn.ras->ras_block.ras_late_init)
2015-
adev->vcn.ras->ras_block.ras_late_init = amdgpu_ras_block_late_init;
2016-
}
2005+
amdgpu_vcn_set_ras_funcs(adev);
20172006
}

0 commit comments

Comments
 (0)