On Thu, May 7, 2020 at 6:26 AM Evan Quan <evan.quan@xxxxxxx> wrote: > > BACO is needed to support hibernate on Navi1X. > > Change-Id: Ia283612919e9a5b4e1e198ab2cc0bc15f7f94760 > Signed-off-by: Evan Quan <evan.quan@xxxxxxx> Acked-by: Alex Deucher <alexander.deucher@xxxxxxx> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + > drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 ++ > drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +- > 3 files changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > index 5bd213f88ae5..e649a3d3fd7c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h > @@ -1010,6 +1010,7 @@ struct amdgpu_device { > > /* s3/s4 mask */ > bool in_suspend; > + bool in_hibernate; > > bool in_gpu_reset; > enum pp_mp1_state mp1_state; > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > index eb351844e46c..5eaa5ea83d0c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > @@ -1260,7 +1260,9 @@ static int amdgpu_pmops_freeze(struct device *dev) > struct amdgpu_device *adev = drm_dev->dev_private; > int r; > > + adev->in_hibernate = true; > r = amdgpu_device_suspend(drm_dev, true); > + adev->in_hibernate = false; > if (r) > return r; > return amdgpu_asic_reset(adev); > diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > index 8a0c37dc5182..f1621147db61 100644 > --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c > @@ -1500,7 +1500,7 @@ static int smu_disable_dpm(struct smu_context *smu) > bool use_baco = !smu->is_apu && > ((adev->in_gpu_reset && > (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) || > - (adev->in_runpm && amdgpu_asic_supports_baco(adev))); > + ((adev->in_runpm || adev->in_hibernate) && amdgpu_asic_supports_baco(adev))); > > ret = smu_get_smc_version(smu, NULL, &smu_version); > if (ret) { > -- > 2.26.2 > > _______________________________________________ > amd-gfx mailing list > amd-gfx@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/amd-gfx _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx