From: Philipp Stanner <phasta@mailbox.org>
To: Matthew Brost <matthew.brost@intel.com>,
Philipp Stanner <phasta@kernel.org>
Cc: "Sumit Semwal" <sumit.semwal@linaro.org>,
"Gustavo Padovan" <gustavo@padovan.org>,
"Christian König" <christian.koenig@amd.com>,
"Felix Kuehling" <Felix.Kuehling@amd.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>,
"Jani Nikula" <jani.nikula@linux.intel.com>,
"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Tvrtko Ursulin" <tursulin@ursulin.net>,
"Huang Rui" <ray.huang@amd.com>,
"Matthew Auld" <matthew.auld@intel.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Lucas De Marchi" <lucas.demarchi@intel.com>,
"Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v2 8/8] drm/xe: Use dma_fence_test_signaled_flag()
Date: Tue, 02 Dec 2025 09:29:09 +0100 [thread overview]
Message-ID: <1aaaa2fe56fc7598b653a5e45fc26aa0b8703ad5.camel@mailbox.org> (raw)
In-Reply-To: <aS3touSB1ZyR2hfM@lstrano-desk.jf.intel.com>
On Mon, 2025-12-01 at 11:33 -0800, Matthew Brost wrote:
> On Mon, Dec 01, 2025 at 11:50:12AM +0100, Philipp Stanner wrote:
> > There is a new dma_fence helper which simplifies testing for a fence's
> > signaled_flag. Use it in xe.
> >
> > Signed-off-by: Philipp Stanner <phasta@kernel.org>
>
> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Doesn't apply on drm-misc-next. Suggestions about what to do about
that?
P.
>
> > ---
> > drivers/gpu/drm/xe/xe_exec_queue.c | 9 +++------
> > drivers/gpu/drm/xe/xe_pt.c | 3 +--
> > drivers/gpu/drm/xe/xe_sched_job.c | 2 +-
> > 3 files changed, 5 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_exec_queue.c b/drivers/gpu/drm/xe/xe_exec_queue.c
> > index cb5f204c08ed..06736f52fbaa 100644
> > --- a/drivers/gpu/drm/xe/xe_exec_queue.c
> > +++ b/drivers/gpu/drm/xe/xe_exec_queue.c
> > @@ -1037,8 +1037,7 @@ struct dma_fence *xe_exec_queue_last_fence_get(struct xe_exec_queue *q,
> >
> > xe_exec_queue_last_fence_lockdep_assert(q, vm);
> >
> > - if (q->last_fence &&
> > - test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &q->last_fence->flags))
> > + if (q->last_fence && dma_fence_test_signaled_flag(q->last_fence))
> > xe_exec_queue_last_fence_put(q, vm);
> >
> > fence = q->last_fence ? q->last_fence : dma_fence_get_stub();
> > @@ -1064,8 +1063,7 @@ struct dma_fence *xe_exec_queue_last_fence_get_for_resume(struct xe_exec_queue *
> >
> > lockdep_assert_held_write(&q->hwe->hw_engine_group->mode_sem);
> >
> > - if (q->last_fence &&
> > - test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &q->last_fence->flags))
> > + if (q->last_fence && dma_fence_test_signaled_flag(q->last_fence))
> > xe_exec_queue_last_fence_put_unlocked(q);
> >
> > fence = q->last_fence ? q->last_fence : dma_fence_get_stub();
> > @@ -1106,8 +1104,7 @@ int xe_exec_queue_last_fence_test_dep(struct xe_exec_queue *q, struct xe_vm *vm)
> >
> > fence = xe_exec_queue_last_fence_get(q, vm);
> > if (fence) {
> > - err = test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) ?
> > - 0 : -ETIME;
> > + err = dma_fence_test_signaled_flag(fence) ? 0 : -ETIME;
> > dma_fence_put(fence);
> > }
> >
> > diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
> > index 07f96bda638a..1ca2dec18e51 100644
> > --- a/drivers/gpu/drm/xe/xe_pt.c
> > +++ b/drivers/gpu/drm/xe/xe_pt.c
> > @@ -1208,8 +1208,7 @@ static bool no_in_syncs(struct xe_sync_entry *syncs, u32 num_syncs)
> > for (i = 0; i < num_syncs; i++) {
> > struct dma_fence *fence = syncs[i].fence;
> >
> > - if (fence && !test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
> > - &fence->flags))
> > + if (fence && !dma_fence_test_signaled_flag(fence))
> > return false;
> > }
> >
> > diff --git a/drivers/gpu/drm/xe/xe_sched_job.c b/drivers/gpu/drm/xe/xe_sched_job.c
> > index d21bf8f26964..1c9ba49a325b 100644
> > --- a/drivers/gpu/drm/xe/xe_sched_job.c
> > +++ b/drivers/gpu/drm/xe/xe_sched_job.c
> > @@ -188,7 +188,7 @@ static bool xe_fence_set_error(struct dma_fence *fence, int error)
> > bool signaled;
> >
> > spin_lock_irqsave(fence->lock, irq_flags);
> > - signaled = test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags);
> > + signaled = dma_fence_test_signaled_flag(fence);
> > if (!signaled)
> > dma_fence_set_error(fence, error);
> > spin_unlock_irqrestore(fence->lock, irq_flags);
> > --
> > 2.49.0
> >
next prev parent reply other threads:[~2025-12-02 14:23 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 10:50 [PATCH 0/6] dma-fence: Remove return code of dma_fence_signal() et al Philipp Stanner
2025-12-01 10:50 ` [PATCH v2 1/8] dma-buf/dma-fence: Add dma_fence_test_signaled_flag() Philipp Stanner
2025-12-03 13:03 ` Christian König
2025-12-01 10:50 ` [PATCH v2 2/8] dma-buf/dma-fence: Add dma_fence_check_and_signal() Philipp Stanner
2025-12-01 13:23 ` Christian König
2025-12-01 13:55 ` Philipp Stanner
2025-12-01 15:20 ` Christian König
2025-12-01 15:34 ` Philipp Stanner
2025-12-01 16:06 ` Christian König
2025-12-01 15:53 ` Philipp Stanner
2025-12-01 16:08 ` Christian König
2025-12-02 9:19 ` Philipp Stanner
2025-12-03 13:05 ` Christian König
2025-12-01 10:50 ` [PATCH v2 3/8] amd/amdkfd: Use dma_fence_check_and_signal() Philipp Stanner
2025-12-01 15:21 ` Felix Kuehling
2025-12-03 13:10 ` Christian König
2025-12-01 10:50 ` [PATCH v2 4/8] drm/xe: Use dma_fence_check_and_signal_locked() Philipp Stanner
2025-12-01 19:38 ` Matthew Brost
2025-12-02 7:17 ` Philipp Stanner
2025-12-02 15:57 ` Matthew Brost
2025-12-02 20:47 ` Andi Shyti
2025-12-02 21:04 ` Matthew Brost
2025-12-03 21:13 ` Rodrigo Vivi
2025-12-03 13:14 ` Christian König
2025-12-01 10:50 ` [PATCH v2 5/8] dma-buf: Don't misuse dma_fence_signal() Philipp Stanner
2025-12-03 13:11 ` Christian König
2025-12-01 10:50 ` [PATCH v2 6/8] drm/ttm: Use dma_fence_check_and_signal() Philipp Stanner
2025-12-03 13:11 ` Christian König
2025-12-01 10:50 ` [PATCH v2 7/8] dma-buf/dma-fence: Remove return code of signaling-functions Philipp Stanner
2025-12-03 13:13 ` Christian König
2025-12-01 10:50 ` [PATCH v2 8/8] drm/xe: Use dma_fence_test_signaled_flag() Philipp Stanner
2025-12-01 19:33 ` Matthew Brost
2025-12-02 8:29 ` Philipp Stanner [this message]
2025-12-03 13:15 ` Christian König
2025-12-03 15:18 ` Philipp Stanner
2025-12-03 15:24 ` Christian König
2025-12-03 17:31 ` Matthew Brost
2025-12-03 21:12 ` Rodrigo Vivi
2025-12-04 14:10 ` [PATCH 0/6] dma-fence: Remove return code of dma_fence_signal() et al Philipp Stanner
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=1aaaa2fe56fc7598b653a5e45fc26aa0b8703ad5.camel@mailbox.org \
--to=phasta@mailbox.org \
--cc=Felix.Kuehling@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo@padovan.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=matthew.auld@intel.com \
--cc=matthew.brost@intel.com \
--cc=mripard@kernel.org \
--cc=phasta@kernel.org \
--cc=ray.huang@amd.com \
--cc=rodrigo.vivi@intel.com \
--cc=simona@ffwll.ch \
--cc=sumit.semwal@linaro.org \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tursulin@ursulin.net \
--cc=tzimmermann@suse.de \
/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;
as well as URLs for NNTP newsgroup(s).