[PATCH] drm/amdgpu: Save VCN shared memory with init reset

Liu, Leo Leo.Liu at amd.com
Wed Oct 16 16:07:09 UTC 2024


[AMD Official Use Only - AMD Internal Distribution Only]

> -----Original Message-----
> From: Koenig, Christian <Christian.Koenig at amd.com>
> Sent: October 16, 2024 9:16 AM
> To: Lazar, Lijo <Lijo.Lazar at amd.com>; amd-gfx at lists.freedesktop.org; Liu, Leo
> <Leo.Liu at amd.com>
> Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Deucher, Alexander
> <Alexander.Deucher at amd.com>; Sundararaju, Sathishkumar
> <Sathishkumar.Sundararaju at amd.com>; Jiang, Sonny
> <Sonny.Jiang at amd.com>; Zhou, Hao (Claire) <Hao.Zhou at amd.com>
> 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

 > +}
 > +


More information about the amd-gfx mailing list