Hamza Mahfooz
2023-Nov-27 15:53 UTC
[Nouveau] [PATCH 2/2] drm/amdgpu: use GTT only as fallback for VRAM|GTT
On 11/27/23 09:54, Christian K?nig wrote:> Try to fill up VRAM as well by setting the busy flag on GTT allocations. > > This fixes the issue that when VRAM was evacuated for suspend it's never > filled up again unless the application is restarted. >Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2893> Signed-off-by: Christian K?nig <christian.koenig at amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > index aa0dd6dad068..ddc8fb4db678 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > @@ -173,6 +173,12 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain) > abo->flags & AMDGPU_GEM_CREATE_PREEMPTIBLE ? > AMDGPU_PL_PREEMPT : TTM_PL_TT; > places[c].flags = 0; > + /* > + * When GTT is just an alternative to VRAM make sure that we > + * only use it as fallback and still try to fill up VRAM first. > + */ > + if (domain & AMDGPU_GEM_DOMAIN_VRAM) > + places[c].flags |= TTM_PL_FLAG_BUSY; > c++; > } >-- Hamza
Bhardwaj, Rajneesh
2023-Nov-27 16:47 UTC
[PATCH 2/2] drm/amdgpu: use GTT only as fallback for VRAM|GTT
[AMD Official Use Only - General] -----Original Message----- From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Hamza Mahfooz Sent: Monday, November 27, 2023 10:53 AM To: Christian K?nig <ckoenig.leichtzumerken at gmail.com>; jani.nikula at linux.intel.com; kherbst at redhat.com; dakr at redhat.com; zackr at vmware.com; Olsak, Marek <Marek.Olsak at amd.com>; linux-graphics-maintainer at vmware.com; amd-gfx at lists.freedesktop.org; nouveau at lists.freedesktop.org; intel-gfx at lists.freedesktop.org; virtualization at lists.linux.dev; spice-devel at lists.freedesktop.org; dri-devel at lists.freedesktop.org Subject: Re: [PATCH 2/2] drm/amdgpu: use GTT only as fallback for VRAM|GTT On 11/27/23 09:54, Christian K?nig wrote:> Try to fill up VRAM as well by setting the busy flag on GTT allocations. > > This fixes the issue that when VRAM was evacuated for suspend it's > never filled up again unless the application is restarted.I found the subject description a bit misleading. Maybe use a Fixes tag describing it is a fix for suspend resume regression other than that, looks good to me. Acked-by: Rajneesh Bhardwaj <rajneesh.bhardwaj at amd.com>>Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2893> Signed-off-by: Christian K?nig <christian.koenig at amd.com> > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > index aa0dd6dad068..ddc8fb4db678 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c > @@ -173,6 +173,12 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain) > abo->flags & AMDGPU_GEM_CREATE_PREEMPTIBLE ? > AMDGPU_PL_PREEMPT : TTM_PL_TT; > places[c].flags = 0; > + /* > + * When GTT is just an alternative to VRAM make sure that we > + * only use it as fallback and still try to fill up VRAM first. > + */ > + if (domain & AMDGPU_GEM_DOMAIN_VRAM) > + places[c].flags |= TTM_PL_FLAG_BUSY; > c++; > } >-- Hamza
Christian König
2023-Nov-27 18:59 UTC
[Nouveau] [PATCH 2/2] drm/amdgpu: use GTT only as fallback for VRAM|GTT
Am 27.11.23 um 17:47 schrieb Bhardwaj, Rajneesh:> [AMD Official Use Only - General] > > -----Original Message----- > From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Hamza Mahfooz > Sent: Monday, November 27, 2023 10:53 AM > To: Christian K?nig <ckoenig.leichtzumerken at gmail.com>; jani.nikula at linux.intel.com; kherbst at redhat.com; dakr at redhat.com; zackr at vmware.com; Olsak, Marek <Marek.Olsak at amd.com>; linux-graphics-maintainer at vmware.com; amd-gfx at lists.freedesktop.org; nouveau at lists.freedesktop.org; intel-gfx at lists.freedesktop.org; virtualization at lists.linux.dev; spice-devel at lists.freedesktop.org; dri-devel at lists.freedesktop.org > Subject: Re: [PATCH 2/2] drm/amdgpu: use GTT only as fallback for VRAM|GTT > > On 11/27/23 09:54, Christian K?nig wrote: >> Try to fill up VRAM as well by setting the busy flag on GTT allocations. >> >> This fixes the issue that when VRAM was evacuated for suspend it's >> never filled up again unless the application is restarted. > I found the subject description a bit misleading. Maybe use a Fixes tag describing it is a fix for suspend resume regression other than that, looks good to me.Well exactly that's the problem, this isn't really a fix and we also don't want to backport it. Basically the previous behavior was working as design, it's just that it was never intended to be used like this.> > Acked-by: Rajneesh Bhardwaj <rajneesh.bhardwaj at amd.com> > > Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2893Thanks, Christian.> >> Signed-off-by: Christian K?nig <christian.koenig at amd.com> >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c >> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c >> index aa0dd6dad068..ddc8fb4db678 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c >> @@ -173,6 +173,12 @@ void amdgpu_bo_placement_from_domain(struct amdgpu_bo *abo, u32 domain) >> abo->flags & AMDGPU_GEM_CREATE_PREEMPTIBLE ? >> AMDGPU_PL_PREEMPT : TTM_PL_TT; >> places[c].flags = 0; >> + /* >> + * When GTT is just an alternative to VRAM make sure that we >> + * only use it as fallback and still try to fill up VRAM first. >> + */ >> + if (domain & AMDGPU_GEM_DOMAIN_VRAM) >> + places[c].flags |= TTM_PL_FLAG_BUSY; >> c++; >> } >> > -- > Hamza >