From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Souza, Jose" <jose.souza@intel.com>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 3/7] drm/xe/oa: Add input fence dependencies
Date: Wed, 18 Sep 2024 12:56:08 -0700 [thread overview]
Message-ID: <85cyl07n3b.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <9b011eebe08c4458b48f9248d7e8082cb33a6501.camel@intel.com>
On Wed, 18 Sep 2024 04:59:59 -0700, Souza, Jose wrote:
>
Hi Jose,
> On Fri, 2024-08-30 at 15:16 -0700, Ashutosh Dixit wrote:
> > Add input fence dependencies which will make OA configuration wait till
> > these dependencies are met (till input fences signal).
> >
> > v2: Change add_deps arg to xe_oa_submit_bb from bool to enum (Matt Brost)
> >
> > Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> > Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> > ---
> > drivers/gpu/drm/xe/xe_oa.c | 25 +++++++++++++++++++++----
> > 1 file changed, 21 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
> > index 8ada74da3da19..b4b68019d35b7 100644
> > --- a/drivers/gpu/drm/xe/xe_oa.c
> > +++ b/drivers/gpu/drm/xe/xe_oa.c
> > @@ -42,6 +42,11 @@
> > #define DEFAULT_POLL_PERIOD_NS (NSEC_PER_SEC / DEFAULT_POLL_FREQUENCY_HZ)
> > #define XE_OA_UNIT_INVALID U32_MAX
> >
> > +enum xe_oa_submit_deps {
> > + XE_OA_SUBMIT_NO_DEPS,
> > + XE_OA_SUBMIT_ADD_DEPS,
> > +};
> > +
> > struct xe_oa_reg {
> > struct xe_reg addr;
> > u32 value;
> > @@ -568,7 +573,8 @@ static __poll_t xe_oa_poll(struct file *file, poll_table *wait)
> > return ret;
> > }
> >
> > -static struct dma_fence *xe_oa_submit_bb(struct xe_oa_stream *stream, struct xe_bb *bb)
> > +static struct dma_fence *xe_oa_submit_bb(struct xe_oa_stream *stream, enum xe_oa_submit_deps deps,
> > + struct xe_bb *bb)
> > {
> > struct xe_sched_job *job;
> > struct dma_fence *fence;
> > @@ -581,11 +587,22 @@ static struct dma_fence *xe_oa_submit_bb(struct xe_oa_stream *stream, struct xe_
> > goto exit;
> > }
> >
> > + if (deps == XE_OA_SUBMIT_ADD_DEPS) {
> > + for (int i = 0; i < stream->num_syncs && !err; i++)
> > + err = xe_sync_entry_add_deps(&stream->syncs[i], job);
>
> err needs to be initialize to 0 otherwise it could take the error path
> below when there is no syncs set.
Somehow I missed this because I never see the drm_dbg print below. Anyway,
I have added the initialization, though the change is in Patch 1 of the
series since the initialization was there and it was removed in Patch 1.
Thanks for catching this,
Ashutosh
>
> > + if (err) {
> > + drm_dbg(&stream->oa->xe->drm, "xe_sync_entry_add_deps err %d\n", err);
> > + goto err_put_job;
> > + }
> > + }
> > +
> > xe_sched_job_arm(job);
> > fence = dma_fence_get(&job->drm.s_fence->finished);
> > xe_sched_job_push(job);
> >
> > return fence;
> > +err_put_job:
> > + xe_sched_job_put(job);
> > exit:
> > return ERR_PTR(err);
> > }
> > @@ -663,7 +680,7 @@ static int xe_oa_modify_ctx_image(struct xe_oa_stream *stream, struct xe_lrc *lr
> >
> > xe_oa_store_flex(stream, lrc, bb, flex, count);
> >
> > - fence = xe_oa_submit_bb(stream, bb);
> > + fence = xe_oa_submit_bb(stream, XE_OA_SUBMIT_NO_DEPS, bb);
> > if (IS_ERR(fence)) {
> > err = PTR_ERR(fence);
> > goto free_bb;
> > @@ -692,7 +709,7 @@ static int xe_oa_load_with_lri(struct xe_oa_stream *stream, struct xe_oa_reg *re
> >
> > write_cs_mi_lri(bb, reg_lri, 1);
> >
> > - fence = xe_oa_submit_bb(stream, bb);
> > + fence = xe_oa_submit_bb(stream, XE_OA_SUBMIT_NO_DEPS, bb);
> > if (IS_ERR(fence)) {
> > err = PTR_ERR(fence);
> > goto free_bb;
> > @@ -943,7 +960,7 @@ static int xe_oa_emit_oa_config(struct xe_oa_stream *stream, struct xe_oa_config
> > goto exit;
> > }
> >
> > - fence = xe_oa_submit_bb(stream, oa_bo->bb);
> > + fence = xe_oa_submit_bb(stream, XE_OA_SUBMIT_ADD_DEPS, oa_bo->bb);
> > if (IS_ERR(fence)) {
> > err = PTR_ERR(fence);
> > goto exit;
>
next prev parent reply other threads:[~2024-09-18 19:56 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-30 22:16 [PATCH v5 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-08-30 22:16 ` [PATCH 1/7] drm/xe/oa: Separate batch submission from waiting for completion Ashutosh Dixit
2024-08-30 22:16 ` [PATCH 2/7] drm/xe/oa/uapi: Define and parse OA sync properties Ashutosh Dixit
2024-08-30 22:16 ` [PATCH 3/7] drm/xe/oa: Add input fence dependencies Ashutosh Dixit
2024-09-18 11:59 ` Souza, Jose
2024-09-18 19:56 ` Dixit, Ashutosh [this message]
2024-08-30 22:16 ` [PATCH 4/7] drm/xe/oa: Signal output fences Ashutosh Dixit
2024-08-30 22:15 ` Dixit, Ashutosh
2024-08-30 22:45 ` Matthew Brost
2024-08-30 22:58 ` Dixit, Ashutosh
2024-09-17 22:18 ` Dixit, Ashutosh
2024-09-17 23:38 ` Matthew Brost
2024-09-18 19:59 ` Dixit, Ashutosh
2024-08-30 22:16 ` [PATCH 5/7] drm/xe/oa: Move functions up so they can be reused for config ioctl Ashutosh Dixit
2024-08-30 22:16 ` [PATCH 6/7] drm/xe/oa: Add syncs support to OA " Ashutosh Dixit
2024-08-30 22:16 ` [PATCH 7/7] drm/xe/oa: Allow only certain property changes from config Ashutosh Dixit
2024-08-30 22:21 ` ✓ CI.Patch_applied: success for drm/xe/oa: xe_syncs for OA (rev5) Patchwork
2024-08-30 22:22 ` ✓ CI.checkpatch: " Patchwork
2024-08-30 22:23 ` ✓ CI.KUnit: " Patchwork
2024-08-30 22:35 ` ✓ CI.Build: " Patchwork
2024-08-30 22:37 ` ✓ CI.Hooks: " Patchwork
2024-08-30 22:38 ` ✓ CI.checksparse: " Patchwork
2024-08-30 22:58 ` ✓ CI.BAT: " Patchwork
2024-08-31 11:25 ` ✗ CI.FULL: failure " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2024-10-22 20:03 [PATCH v7 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-10-22 20:03 ` [PATCH 3/7] drm/xe/oa: Add input fence dependencies Ashutosh Dixit
2024-09-18 19:53 [PATCH v6 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-09-18 19:53 ` [PATCH 3/7] drm/xe/oa: Add input fence dependencies Ashutosh Dixit
2024-08-28 1:50 [PATCH v4 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-08-28 1:50 ` [PATCH 3/7] drm/xe/oa: Add input fence dependencies Ashutosh Dixit
2024-08-21 15:28 [PATCH v3 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-08-21 15:28 ` [PATCH 3/7] drm/xe/oa: Add input fence dependencies Ashutosh Dixit
2024-08-20 0:58 [PATCH v2 0/7] drm/xe/oa: xe_syncs for OA Ashutosh Dixit
2024-08-20 0:58 ` [PATCH 3/7] drm/xe/oa: Add input fence dependencies Ashutosh Dixit
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=85cyl07n3b.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jose.souza@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.