* [PATCH v2 0/2] Use the helpers for locking/unlocking resv object @ 2024-04-24 3:57 Himal Prasad Ghimiray 2024-04-24 3:57 ` [PATCH 1/2] drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers Himal Prasad Ghimiray 2024-04-24 3:57 ` [PATCH 2/2] drm/xe: Use xe_bo_lock()/xe_bo_unlock() helpers Himal Prasad Ghimiray 0 siblings, 2 replies; 8+ messages in thread From: Himal Prasad Ghimiray @ 2024-04-24 3:57 UTC (permalink / raw) To: intel-xe; +Cc: Himal Prasad Ghimiray Use the helpers for locking/unlocking resv object Himal Prasad Ghimiray (2): drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers drm/xe: Use xe_bo_lock()/xe_bo_unlock() helpers drivers/gpu/drm/xe/xe_lrc.c | 4 ++-- drivers/gpu/drm/xe/xe_vm.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) -- 2.25.1 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 1/2] drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers 2024-04-24 3:57 [PATCH v2 0/2] Use the helpers for locking/unlocking resv object Himal Prasad Ghimiray @ 2024-04-24 3:57 ` Himal Prasad Ghimiray 2024-04-24 3:54 ` Matthew Brost 2024-04-24 3:57 ` [PATCH 2/2] drm/xe: Use xe_bo_lock()/xe_bo_unlock() helpers Himal Prasad Ghimiray 1 sibling, 1 reply; 8+ messages in thread From: Himal Prasad Ghimiray @ 2024-04-24 3:57 UTC (permalink / raw) To: intel-xe Cc: Himal Prasad Ghimiray, Badal Nilawar, Matthew Brost, Ashutosh Dixit There is no change in functionality. Using the helper function defined within the driver. -v2 Use xe_vm_unlock() (Ashutosh/Matt) Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> --- drivers/gpu/drm/xe/xe_vm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index 85d6f359142d..c350c561e7d9 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -1279,7 +1279,7 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags) drm_gem_object_put(vm_resv_obj); - err = dma_resv_lock_interruptible(xe_vm_resv(vm), NULL); + err = xe_vm_lock(vm, true); if (err) goto err_close; @@ -1323,7 +1323,7 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags) xe_pt_populate_empty(tile, vm, vm->pt_root[id]); } - dma_resv_unlock(xe_vm_resv(vm)); + xe_vm_unlock(vm); /* Kernel migration VM shouldn't have a circular loop.. */ if (!(flags & XE_VM_FLAG_MIGRATION)) { -- 2.25.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers 2024-04-24 3:57 ` [PATCH 1/2] drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers Himal Prasad Ghimiray @ 2024-04-24 3:54 ` Matthew Brost 2024-04-24 3:57 ` Ghimiray, Himal Prasad 0 siblings, 1 reply; 8+ messages in thread From: Matthew Brost @ 2024-04-24 3:54 UTC (permalink / raw) To: Himal Prasad Ghimiray; +Cc: intel-xe, Badal Nilawar, Ashutosh Dixit On Wed, Apr 24, 2024 at 09:27:55AM +0530, Himal Prasad Ghimiray wrote: > There is no change in functionality. Using the helper function > defined within the driver. > > -v2 > Use xe_vm_unlock() (Ashutosh/Matt) > > Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> > Cc: Matthew Brost <matthew.brost@intel.com> > Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> > Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> > --- > drivers/gpu/drm/xe/xe_vm.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c > index 85d6f359142d..c350c561e7d9 100644 > --- a/drivers/gpu/drm/xe/xe_vm.c > +++ b/drivers/gpu/drm/xe/xe_vm.c > @@ -1279,7 +1279,7 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags) > > drm_gem_object_put(vm_resv_obj); > > - err = dma_resv_lock_interruptible(xe_vm_resv(vm), NULL); > + err = xe_vm_lock(vm, true); > if (err) > goto err_close; > > @@ -1323,7 +1323,7 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags) > > xe_pt_populate_empty(tile, vm, vm->pt_root[id]); > } > - dma_resv_unlock(xe_vm_resv(vm)); > + xe_vm_unlock(vm); There is another dma_resv_unlock below the label 'err_unlock_close' too. Matt > > /* Kernel migration VM shouldn't have a circular loop.. */ > if (!(flags & XE_VM_FLAG_MIGRATION)) { > -- > 2.25.1 > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers 2024-04-24 3:54 ` Matthew Brost @ 2024-04-24 3:57 ` Ghimiray, Himal Prasad 2024-04-24 4:05 ` Nilawar, Badal 0 siblings, 1 reply; 8+ messages in thread From: Ghimiray, Himal Prasad @ 2024-04-24 3:57 UTC (permalink / raw) To: Matthew Brost; +Cc: intel-xe, Badal Nilawar, Ashutosh Dixit On 24-04-2024 09:24, Matthew Brost wrote: > On Wed, Apr 24, 2024 at 09:27:55AM +0530, Himal Prasad Ghimiray wrote: >> There is no change in functionality. Using the helper function >> defined within the driver. >> >> -v2 >> Use xe_vm_unlock() (Ashutosh/Matt) >> >> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> >> Cc: Matthew Brost <matthew.brost@intel.com> >> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> >> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> >> --- >> drivers/gpu/drm/xe/xe_vm.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c >> index 85d6f359142d..c350c561e7d9 100644 >> --- a/drivers/gpu/drm/xe/xe_vm.c >> +++ b/drivers/gpu/drm/xe/xe_vm.c >> @@ -1279,7 +1279,7 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags) >> >> drm_gem_object_put(vm_resv_obj); >> >> - err = dma_resv_lock_interruptible(xe_vm_resv(vm), NULL); >> + err = xe_vm_lock(vm, true); >> if (err) >> goto err_close; >> >> @@ -1323,7 +1323,7 @@ struct xe_vm *xe_vm_create(struct xe_device *xe, u32 flags) >> >> xe_pt_populate_empty(tile, vm, vm->pt_root[id]); >> } >> - dma_resv_unlock(xe_vm_resv(vm)); >> + xe_vm_unlock(vm); > There is another dma_resv_unlock below the label 'err_unlock_close' too. > > Matt Thanks Matt, Addressing it in next version. > >> >> /* Kernel migration VM shouldn't have a circular loop.. */ >> if (!(flags & XE_VM_FLAG_MIGRATION)) { >> -- >> 2.25.1 >> ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers 2024-04-24 3:57 ` Ghimiray, Himal Prasad @ 2024-04-24 4:05 ` Nilawar, Badal 2024-04-24 4:09 ` Nilawar, Badal 0 siblings, 1 reply; 8+ messages in thread From: Nilawar, Badal @ 2024-04-24 4:05 UTC (permalink / raw) To: Ghimiray, Himal Prasad, Matthew Brost; +Cc: intel-xe, Ashutosh Dixit On 24-04-2024 09:27, Ghimiray, Himal Prasad wrote: > > On 24-04-2024 09:24, Matthew Brost wrote: >> On Wed, Apr 24, 2024 at 09:27:55AM +0530, Himal Prasad Ghimiray wrote: >>> There is no change in functionality. Using the helper function >>> defined within the driver. >>> >>> -v2 >>> Use xe_vm_unlock() (Ashutosh/Matt) >>> >>> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> >>> Cc: Matthew Brost <matthew.brost@intel.com> >>> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> >>> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> >>> --- >>> drivers/gpu/drm/xe/xe_vm.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c >>> index 85d6f359142d..c350c561e7d9 100644 >>> --- a/drivers/gpu/drm/xe/xe_vm.c >>> +++ b/drivers/gpu/drm/xe/xe_vm.c >>> @@ -1279,7 +1279,7 @@ struct xe_vm *xe_vm_create(struct xe_device >>> *xe, u32 flags) >>> drm_gem_object_put(vm_resv_obj); >>> - err = dma_resv_lock_interruptible(xe_vm_resv(vm), NULL); >>> + err = xe_vm_lock(vm, true); >>> if (err) >>> goto err_close; >>> @@ -1323,7 +1323,7 @@ struct xe_vm *xe_vm_create(struct xe_device >>> *xe, u32 flags) >>> xe_pt_populate_empty(tile, vm, vm->pt_root[id]); >>> } >>> - dma_resv_unlock(xe_vm_resv(vm)); >>> + xe_vm_unlock(vm); >> There is another dma_resv_unlock below the label 'err_unlock_close' too. >> >> Matt > > > Thanks Matt, Addressing it in next version. I think dma_resv_lock_interruptible also be replaced with wrapper. xe_vm.c:1282: err = dma_resv_lock_interruptible(xe_vm_resv(vm), NULL); xe_vm.c:3117: return dma_resv_lock_interruptible(xe_vm_resv(vm), NULL); xe_bo.c:2050: return dma_resv_lock_interruptible(bo->ttm.base.resv, NULL); Regards, Badal > > >> >>> /* Kernel migration VM shouldn't have a circular loop.. */ >>> if (!(flags & XE_VM_FLAG_MIGRATION)) { >>> -- >>> 2.25.1 >>> ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/2] drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers 2024-04-24 4:05 ` Nilawar, Badal @ 2024-04-24 4:09 ` Nilawar, Badal 0 siblings, 0 replies; 8+ messages in thread From: Nilawar, Badal @ 2024-04-24 4:09 UTC (permalink / raw) To: Ghimiray, Himal Prasad, Matthew Brost; +Cc: intel-xe, Ashutosh Dixit On 24-04-2024 09:35, Nilawar, Badal wrote: > > > On 24-04-2024 09:27, Ghimiray, Himal Prasad wrote: >> >> On 24-04-2024 09:24, Matthew Brost wrote: >>> On Wed, Apr 24, 2024 at 09:27:55AM +0530, Himal Prasad Ghimiray wrote: >>>> There is no change in functionality. Using the helper function >>>> defined within the driver. >>>> >>>> -v2 >>>> Use xe_vm_unlock() (Ashutosh/Matt) >>>> >>>> Reviewed-by: Badal Nilawar <badal.nilawar@intel.com> >>>> Cc: Matthew Brost <matthew.brost@intel.com> >>>> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> >>>> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> >>>> --- >>>> drivers/gpu/drm/xe/xe_vm.c | 4 ++-- >>>> 1 file changed, 2 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c >>>> index 85d6f359142d..c350c561e7d9 100644 >>>> --- a/drivers/gpu/drm/xe/xe_vm.c >>>> +++ b/drivers/gpu/drm/xe/xe_vm.c >>>> @@ -1279,7 +1279,7 @@ struct xe_vm *xe_vm_create(struct xe_device >>>> *xe, u32 flags) >>>> drm_gem_object_put(vm_resv_obj); >>>> - err = dma_resv_lock_interruptible(xe_vm_resv(vm), NULL); >>>> + err = xe_vm_lock(vm, true); >>>> if (err) >>>> goto err_close; >>>> @@ -1323,7 +1323,7 @@ struct xe_vm *xe_vm_create(struct xe_device >>>> *xe, u32 flags) >>>> xe_pt_populate_empty(tile, vm, vm->pt_root[id]); >>>> } >>>> - dma_resv_unlock(xe_vm_resv(vm)); >>>> + xe_vm_unlock(vm); >>> There is another dma_resv_unlock below the label 'err_unlock_close' too. >>> >>> Matt >> >> >> Thanks Matt, Addressing it in next version. > I think dma_resv_lock_interruptible also be replaced with wrapper. > > xe_vm.c:1282: err = dma_resv_lock_interruptible(xe_vm_resv(vm), NULL); > xe_vm.c:3117: return dma_resv_lock_interruptible(xe_vm_resv(vm), NULL); > > xe_bo.c:2050: return dma_resv_lock_interruptible(bo->ttm.base.resv, NULL); Please ignore this, it is already addressed. > > Regards, > Badal >> >> >>> >>>> /* Kernel migration VM shouldn't have a circular loop.. */ >>>> if (!(flags & XE_VM_FLAG_MIGRATION)) { >>>> -- >>>> 2.25.1 >>>> ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] drm/xe: Use xe_bo_lock()/xe_bo_unlock() helpers 2024-04-24 3:57 [PATCH v2 0/2] Use the helpers for locking/unlocking resv object Himal Prasad Ghimiray 2024-04-24 3:57 ` [PATCH 1/2] drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers Himal Prasad Ghimiray @ 2024-04-24 3:57 ` Himal Prasad Ghimiray 2024-04-24 3:55 ` Matthew Brost 1 sibling, 1 reply; 8+ messages in thread From: Himal Prasad Ghimiray @ 2024-04-24 3:57 UTC (permalink / raw) To: intel-xe; +Cc: Himal Prasad Ghimiray, Matthew Brost, Ashutosh Dixit There is no change in functionality. Using the helper function defined within the driver for locking/unlocking the reservation object. Cc: Matthew Brost <matthew.brost@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Suggested-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> --- drivers/gpu/drm/xe/xe_lrc.c | 4 ++-- drivers/gpu/drm/xe/xe_vm.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c index 615bbc372ac6..2066d34ddf0b 100644 --- a/drivers/gpu/drm/xe/xe_lrc.c +++ b/drivers/gpu/drm/xe/xe_lrc.c @@ -1382,7 +1382,7 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot) if (!snapshot->lrc_snapshot) goto put_bo; - dma_resv_lock(bo->ttm.base.resv, NULL); + xe_bo_lock(bo, false); if (!ttm_bo_vmap(&bo->ttm, &src)) { xe_map_memcpy_from(xe_bo_device(bo), snapshot->lrc_snapshot, &src, snapshot->lrc_offset, @@ -1392,7 +1392,7 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot) kvfree(snapshot->lrc_snapshot); snapshot->lrc_snapshot = NULL; } - dma_resv_unlock(bo->ttm.base.resv); + xe_bo_unlock(bo); put_bo: xe_bo_put(bo); } diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c index c350c561e7d9..6606e2a32e2b 100644 --- a/drivers/gpu/drm/xe/xe_vm.c +++ b/drivers/gpu/drm/xe/xe_vm.c @@ -3335,7 +3335,7 @@ void xe_vm_snapshot_capture_delayed(struct xe_vm_snapshot *snap) } if (bo) { - dma_resv_lock(bo->ttm.base.resv, NULL); + xe_bo_lock(bo, false); err = ttm_bo_vmap(&bo->ttm, &src); if (!err) { xe_map_memcpy_from(xe_bo_device(bo), @@ -3344,7 +3344,7 @@ void xe_vm_snapshot_capture_delayed(struct xe_vm_snapshot *snap) snap->snap[i].len); ttm_bo_vunmap(&bo->ttm, &src); } - dma_resv_unlock(bo->ttm.base.resv); + xe_bo_unlock(bo); } else { void __user *userptr = (void __user *)(size_t)snap->snap[i].bo_ofs; -- 2.25.1 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 2/2] drm/xe: Use xe_bo_lock()/xe_bo_unlock() helpers 2024-04-24 3:57 ` [PATCH 2/2] drm/xe: Use xe_bo_lock()/xe_bo_unlock() helpers Himal Prasad Ghimiray @ 2024-04-24 3:55 ` Matthew Brost 0 siblings, 0 replies; 8+ messages in thread From: Matthew Brost @ 2024-04-24 3:55 UTC (permalink / raw) To: Himal Prasad Ghimiray; +Cc: intel-xe, Ashutosh Dixit On Wed, Apr 24, 2024 at 09:27:56AM +0530, Himal Prasad Ghimiray wrote: > There is no change in functionality. Using the helper function > defined within the driver for locking/unlocking the reservation > object. > > Cc: Matthew Brost <matthew.brost@intel.com> > Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> > Suggested-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> > Signed-off-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> > --- > drivers/gpu/drm/xe/xe_lrc.c | 4 ++-- > drivers/gpu/drm/xe/xe_vm.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c > index 615bbc372ac6..2066d34ddf0b 100644 > --- a/drivers/gpu/drm/xe/xe_lrc.c > +++ b/drivers/gpu/drm/xe/xe_lrc.c > @@ -1382,7 +1382,7 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot) > if (!snapshot->lrc_snapshot) > goto put_bo; > > - dma_resv_lock(bo->ttm.base.resv, NULL); > + xe_bo_lock(bo, false); > if (!ttm_bo_vmap(&bo->ttm, &src)) { > xe_map_memcpy_from(xe_bo_device(bo), > snapshot->lrc_snapshot, &src, snapshot->lrc_offset, > @@ -1392,7 +1392,7 @@ void xe_lrc_snapshot_capture_delayed(struct xe_lrc_snapshot *snapshot) > kvfree(snapshot->lrc_snapshot); > snapshot->lrc_snapshot = NULL; > } > - dma_resv_unlock(bo->ttm.base.resv); > + xe_bo_unlock(bo); > put_bo: > xe_bo_put(bo); > } > diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c > index c350c561e7d9..6606e2a32e2b 100644 > --- a/drivers/gpu/drm/xe/xe_vm.c > +++ b/drivers/gpu/drm/xe/xe_vm.c > @@ -3335,7 +3335,7 @@ void xe_vm_snapshot_capture_delayed(struct xe_vm_snapshot *snap) > } > > if (bo) { > - dma_resv_lock(bo->ttm.base.resv, NULL); > + xe_bo_lock(bo, false); > err = ttm_bo_vmap(&bo->ttm, &src); > if (!err) { > xe_map_memcpy_from(xe_bo_device(bo), > @@ -3344,7 +3344,7 @@ void xe_vm_snapshot_capture_delayed(struct xe_vm_snapshot *snap) > snap->snap[i].len); > ttm_bo_vunmap(&bo->ttm, &src); > } > - dma_resv_unlock(bo->ttm.base.resv); > + xe_bo_unlock(bo); > } else { > void __user *userptr = (void __user *)(size_t)snap->snap[i].bo_ofs; > > -- > 2.25.1 > ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-04-24 4:09 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-04-24 3:57 [PATCH v2 0/2] Use the helpers for locking/unlocking resv object Himal Prasad Ghimiray 2024-04-24 3:57 ` [PATCH 1/2] drm/xe/vm: Use xe_vm_lock()/xe_vm_unlock() helpers Himal Prasad Ghimiray 2024-04-24 3:54 ` Matthew Brost 2024-04-24 3:57 ` Ghimiray, Himal Prasad 2024-04-24 4:05 ` Nilawar, Badal 2024-04-24 4:09 ` Nilawar, Badal 2024-04-24 3:57 ` [PATCH 2/2] drm/xe: Use xe_bo_lock()/xe_bo_unlock() helpers Himal Prasad Ghimiray 2024-04-24 3:55 ` Matthew Brost
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox