[AMD Official Use Only - AMD Internal Distribution Only]
> -----Original Message-----
> From: Koenig, Christian <[email protected]>
> Sent: October 16, 2024 9:16 AM
> To: Lazar, Lijo <[email protected]>; [email protected]; Liu, Leo
> <[email protected]>
> Cc: Zhang, Hawking <[email protected]>; Deucher, Alexander
> <[email protected]>; Sundararaju, Sathishkumar
> <[email protected]>; Jiang, Sonny
> <[email protected]>; Zhou, Hao (Claire) <[email protected]>
> Subject: Re: [PATCH] drm/amdgpu: Save VCN shared memory with init reset
>
> Am 15.10.24 um 08:23 schrieb Lijo Lazar:
> > VCN shared memory is in framebuffer and there are some flags
> > initialized during sw_init. Ideally, such programming should be during
> hw_init.
>
> IIRC that was intentionally not done during hw_init for some reason.
> @Leo do you remember why?
>
We need to keep some of the status from share memory(driver and FW), since some
of them are changed by FW, that is why the init cannot be in the hw_init stage
with suspend/resume case.
+int amdgpu_vcn_suspend(struct amdgpu_device *adev) {
> + bool in_ras_intr = amdgpu_ras_intr_triggered();
> +
> + cancel_delayed_work_sync(&adev->vcn.idle_work);
> +
> + /* err_event_athub will corrupt VCPU buffer, so we need to
> + * restore fw data and clear buffer in amdgpu_vcn_resume() */
> + if (in_ras_intr)
> + return 0;
> +
> + return amdgpu_vcn_save_fw_shared_region(adev);
The saved bo here is not only for fw shared memory, also for FW runtime
stack/heap as well.
Regards,
Leo
> +}
> +