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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: Save VCN shared memory with init reset

VCN shared memory is in framebuffer and there are some flags initialized
during sw_init. Ideally, such programming should be during hw_init.

Make sure the flags are saved during reset on initialization since that
reset will affect frame buffer region. For clarity, separate it out to
another function.

Fixes: 1e4acf4d93cd ("drm/amdgpu: Add reset on init handler for XGMI")
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reported-by: Hao Zhou <hao.zhou@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Lijo Lazar and committed by
Alex Deucher
591aec15 971d8e1c

+23 -10
+6
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
··· 44 44 adev->ip_blocks[i].status.hw = false; 45 45 } 46 46 47 + /* VCN FW shared region is in frambuffer, there are some flags 48 + * initialized in that region during sw_init. Make sure the region is 49 + * backed up. 50 + */ 51 + amdgpu_vcn_save_vcpu_bo(adev); 52 + 47 53 return 0; 48 54 } 49 55
+16 -10
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
··· 294 294 return ret; 295 295 } 296 296 297 - int amdgpu_vcn_suspend(struct amdgpu_device *adev) 297 + int amdgpu_vcn_save_vcpu_bo(struct amdgpu_device *adev) 298 298 { 299 299 unsigned int size; 300 300 void *ptr; 301 301 int i, idx; 302 - 303 - bool in_ras_intr = amdgpu_ras_intr_triggered(); 304 - 305 - cancel_delayed_work_sync(&adev->vcn.idle_work); 306 - 307 - /* err_event_athub will corrupt VCPU buffer, so we need to 308 - * restore fw data and clear buffer in amdgpu_vcn_resume() */ 309 - if (in_ras_intr) 310 - return 0; 311 302 312 303 for (i = 0; i < adev->vcn.num_vcn_inst; ++i) { 313 304 if (adev->vcn.harvest_config & (1 << i)) ··· 318 327 drm_dev_exit(idx); 319 328 } 320 329 } 330 + 321 331 return 0; 332 + } 333 + 334 + int amdgpu_vcn_suspend(struct amdgpu_device *adev) 335 + { 336 + bool in_ras_intr = amdgpu_ras_intr_triggered(); 337 + 338 + cancel_delayed_work_sync(&adev->vcn.idle_work); 339 + 340 + /* err_event_athub will corrupt VCPU buffer, so we need to 341 + * restore fw data and clear buffer in amdgpu_vcn_resume() */ 342 + if (in_ras_intr) 343 + return 0; 344 + 345 + return amdgpu_vcn_save_vcpu_bo(adev); 322 346 } 323 347 324 348 int amdgpu_vcn_resume(struct amdgpu_device *adev)
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
··· 518 518 519 519 int amdgpu_vcn_psp_update_sram(struct amdgpu_device *adev, int inst_idx, 520 520 enum AMDGPU_UCODE_ID ucode_id); 521 + int amdgpu_vcn_save_vcpu_bo(struct amdgpu_device *adev); 521 522 522 523 #endif