[Public]
> From: Alex Deucher <[email protected]> > Sent: Wednesday, June 25, 2025 1:06 AM > To: Liang, Prike <[email protected]> > Cc: [email protected]; Deucher, Alexander > <[email protected]>; Koenig, Christian <[email protected]> > Subject: Re: [PATCH v4 10/11] drm/amdgpu: only bound the eviction fence to > userq > bo > > On Tue, Jun 24, 2025 at 4:46 AM Prike Liang <[email protected]> wrote: > > > > It doesn't need to attach the invalid eviction fence to non-userq's > > BOs. > > > > Signed-off-by: Prike Liang <[email protected]> > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 16 +++++++++------- > > 1 file changed, 9 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > > index 2c68118fe9fd..50356aa23a99 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c > > @@ -294,12 +294,14 @@ static int amdgpu_gem_object_open(struct > drm_gem_object *obj, > > else > > ++bo_va->ref_count; > > > > - /* attach gfx eviction fence */ > > - r = amdgpu_eviction_fence_attach(&fpriv->evf_mgr, abo); > > - if (r) { > > - DRM_DEBUG_DRIVER("Failed to attach eviction fence to BO\n"); > > - amdgpu_bo_unreserve(abo); > > - return r; > > + /* attach gfx eviction fence when userq created*/ > > + if (vm->is_userq_context) { > > + r = amdgpu_eviction_fence_attach(&fpriv->evf_mgr, abo); > > + if (r) { > > + DRM_DEBUG_DRIVER("Failed to attach eviction fence > > to BO\n"); > > + amdgpu_bo_unreserve(abo); > > + return r; > > + } > > } > > > > amdgpu_bo_unreserve(abo); > > @@ -365,7 +367,7 @@ static void amdgpu_gem_object_close(struct > drm_gem_object *obj, > > goto out_unlock; > > } > > > > - if (!amdgpu_vm_is_bo_always_valid(vm, bo)) > > + if (!amdgpu_vm_is_bo_always_valid(vm, bo) && > > + vm->is_compute_context) > > Did you mean vm->is_userq_context here? Yes, it's a typo and will correct it in the later patch. > > Alex > > > amdgpu_eviction_fence_detach(&fpriv->evf_mgr, bo); > > > > bo_va = amdgpu_vm_bo_find(vm, bo); > > -- > > 2.34.1 > >
