[AMD Official Use Only - AMD Internal Distribution Only] > -----Original Message----- > From: Koenig, Christian <Christian.Koenig@xxxxxxx> > Sent: October 16, 2024 9:16 AM > To: Lazar, Lijo <Lijo.Lazar@xxxxxxx>; amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Liu, Leo > <Leo.Liu@xxxxxxx> > Cc: Zhang, Hawking <Hawking.Zhang@xxxxxxx>; Deucher, Alexander > <Alexander.Deucher@xxxxxxx>; Sundararaju, Sathishkumar > <Sathishkumar.Sundararaju@xxxxxxx>; Jiang, Sonny > <Sonny.Jiang@xxxxxxx>; Zhou, Hao (Claire) <Hao.Zhou@xxxxxxx> > 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 > +} > +