Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Matthew Auld <matthew.auld@intel.com>
Cc: <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v6 3/7] drm/xe: Add xe_exec_queue_last_fence_test_dep
Date: Thu, 27 Jun 2024 17:59:06 +0000	[thread overview]
Message-ID: <Zn2oajnReHlJH+6j@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <2434297e-bbf5-456a-886c-4abd9a1aed22@intel.com>

On Thu, Jun 27, 2024 at 05:36:42PM +0100, Matthew Auld wrote:
> On 26/06/2024 22:15, Matthew Brost wrote:
> > Helpful to determine if a bind can immediately use CPU or needs to be
> > deferred a drm scheduler job.
> > 
> > Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> > ---
> >   drivers/gpu/drm/xe/xe_exec_queue.c | 23 +++++++++++++++++++++++
> >   drivers/gpu/drm/xe/xe_exec_queue.h |  2 ++
> >   2 files changed, 25 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
> > index 0ba37835849b..65b4d1da6c93 100644
> > --- a/drivers/gpu/drm/xe/xe_exec_queue.c
> > +++ b/drivers/gpu/drm/xe/xe_exec_queue.c
> > @@ -906,3 +906,26 @@ void xe_exec_queue_last_fence_set(struct xe_exec_queue *q, struct xe_vm *vm,
> >   	xe_exec_queue_last_fence_put(q, vm);
> >   	q->last_fence = dma_fence_get(fence);
> >   }
> > +
> > +/**
> > + * xe_exec_queue_last_fence_test_dep - Test last fence dependency of queue
> > + * @q: The exec queue
> > + * @vm: The VM the engine does a bind or exec for
> > + *
> > + * Returns:
> > + * 0 on success on dependency, -ETIME on dependency
> 
> Could maybe improve the wording here?
> 
> "-ETIME if there exists an unsignalled last fence dependency, zero
> otherwise."
> 

Will fix upon merge or in next rev if one is required.

Matt

> ?
> 
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> 
> > + */
> > +int xe_exec_queue_last_fence_test_dep(struct xe_exec_queue *q, struct xe_vm *vm)
> > +{
> > +	struct dma_fence *fence;
> > +	int err = 0;
> > +
> > +	fence = xe_exec_queue_last_fence_get(q, vm);
> > +	if (fence) {
> > +		err = test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) ?
> > +			0 : -ETIME;
> > +		dma_fence_put(fence);
> > +	}
> > +
> > +	return err;
> > +}
> > diff --git a/drivers/gpu/drm/xe/xe_exec_queue.h b/drivers/gpu/drm/xe/xe_exec_queue.h
> > index 289a3a51d2a2..ded77b0f3b90 100644
> > --- a/drivers/gpu/drm/xe/xe_exec_queue.h
> > +++ b/drivers/gpu/drm/xe/xe_exec_queue.h
> > @@ -75,6 +75,8 @@ struct dma_fence *xe_exec_queue_last_fence_get(struct xe_exec_queue *e,
> >   					       struct xe_vm *vm);
> >   void xe_exec_queue_last_fence_set(struct xe_exec_queue *e, struct xe_vm *vm,
> >   				  struct dma_fence *fence);
> > +int xe_exec_queue_last_fence_test_dep(struct xe_exec_queue *q,
> > +				      struct xe_vm *vm);
> >   void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q);
> >   #endif

  reply	other threads:[~2024-06-27 17:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-26 21:15 [PATCH v6 0/7] Convert multiple bind ops to 1 job Matthew Brost
2024-06-26 21:15 ` [PATCH v6 1/7] drm/xe: s/xe_tile_migrate_engine/xe_tile_migrate_exec_queue Matthew Brost
2024-06-26 21:15 ` [PATCH v6 2/7] drm/xe: Add xe_vm_pgtable_update_op to xe_vma_ops Matthew Brost
2024-06-26 21:15 ` [PATCH v6 3/7] drm/xe: Add xe_exec_queue_last_fence_test_dep Matthew Brost
2024-06-27 16:36   ` Matthew Auld
2024-06-27 17:59     ` Matthew Brost [this message]
2024-06-26 21:15 ` [PATCH v6 4/7] drm/xe: Convert multiple bind ops into single job Matthew Brost
2024-06-27 16:20   ` Matthew Auld
2024-06-26 21:15 ` [PATCH v6 5/7] drm/xe: Update VM trace events Matthew Brost
2024-06-26 21:15 ` [PATCH v6 6/7] drm/xe: Update PT layer with better error handling Matthew Brost
2024-06-28 15:00   ` Matthew Auld
2024-06-28 15:55     ` Matthew Brost
2024-06-26 21:15 ` [PATCH v6 7/7] drm/xe: Add VM bind IOCTL error injection Matthew Brost
2024-06-26 23:28 ` ✓ CI.Patch_applied: success for Convert multiple bind ops to 1 job (rev6) Patchwork
2024-06-26 23:29 ` ✓ CI.checkpatch: " Patchwork
2024-06-26 23:30 ` ✓ CI.KUnit: " Patchwork
2024-06-26 23:42 ` ✓ CI.Build: " Patchwork
2024-06-26 23:44 ` ✓ CI.Hooks: " Patchwork
2024-06-26 23:45 ` ✓ CI.checksparse: " Patchwork
2024-06-27  0:09 ` ✓ CI.BAT: " Patchwork
2024-06-27 12:29 ` ✓ CI.FULL: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zn2oajnReHlJH+6j@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox