diff options
| author | Tao Zhou <[email protected]> | 2022-10-20 08:40:50 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2022-11-17 23:08:14 +0000 |
| commit | 214c76427d2276ba48dde4097ba57b963286657d (patch) | |
| tree | 52138d1ba1bf545ab73a16a40c5d151e74157654 /drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | |
| parent | drm/amdgpu: define common vcn_set_ras_funcs (diff) | |
| download | kernel-214c76427d2276ba48dde4097ba57b963286657d.tar.gz kernel-214c76427d2276ba48dde4097ba57b963286657d.zip | |
drm/amdgpu: define common jpeg_set_ras_funcs
Make the code reusable.
Signed-off-by: Tao Zhou <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c index 518eb0e40d32..8f472517d181 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c @@ -234,3 +234,20 @@ int amdgpu_jpeg_process_poison_irq(struct amdgpu_device *adev, return 0; } + +void jpeg_set_ras_funcs(struct amdgpu_device *adev) +{ + if (!adev->jpeg.ras) + return; + + amdgpu_ras_register_ras_block(adev, &adev->jpeg.ras->ras_block); + + strcpy(adev->jpeg.ras->ras_block.ras_comm.name, "jpeg"); + adev->jpeg.ras->ras_block.ras_comm.block = AMDGPU_RAS_BLOCK__JPEG; + adev->jpeg.ras->ras_block.ras_comm.type = AMDGPU_RAS_ERROR__POISON; + adev->jpeg.ras_if = &adev->jpeg.ras->ras_block.ras_comm; + + /* If don't define special ras_late_init function, use default ras_late_init */ + if (!adev->jpeg.ras->ras_block.ras_late_init) + adev->jpeg.ras->ras_block.ras_late_init = amdgpu_ras_block_late_init; +} |
