Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu/atomfirmware: add function to update engine hang status

Update the scratch reg for when the engine is hung.

Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

+15
+13
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
··· 88 88 WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]); 89 89 } 90 90 91 + void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev, 92 + bool hung) 93 + { 94 + u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3); 95 + 96 + if (hung) 97 + tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG; 98 + else 99 + tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG; 100 + 101 + WREG32(adev->bios_scratch_reg_offset + 3, tmp); 102 + } 103 + 91 104 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev) 92 105 { 93 106 struct atom_context *ctx = adev->mode_info.atom_context;
+2
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.h
··· 28 28 void amdgpu_atomfirmware_scratch_regs_init(struct amdgpu_device *adev); 29 29 void amdgpu_atomfirmware_scratch_regs_save(struct amdgpu_device *adev); 30 30 void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev); 31 + void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev, 32 + bool hung); 31 33 int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev); 32 34 33 35 #endif