mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Chia-I Wu <olvaffe@gmail.com>,
	boris.brezillon@collabora.com,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Chunming Zhou <david1.zhou@amd.com>,
	Lionel Landwerlin <lionel.g.landwerlin@intel.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: faith.ekstrand@collabora.com
Subject: Re: [PATCH v2] drm/syncobj: ensure progress for syncobj queries
Date: Tue, 22 Oct 2024 18:53:07 +0200	[thread overview]
Message-ID: <900f8658-726c-4034-90ff-398e6c57ec47@amd.com> (raw)
In-Reply-To: <20241022161825.228278-1-olvaffe@gmail.com>

Am 22.10.24 um 18:18 schrieb Chia-I Wu:
> Userspace might poll a syncobj with the query ioctl.  Call
> dma_fence_enable_sw_signaling to ensure dma_fence_is_signaled returns
> true in finite time.

Wait a second, just querying the fence status is absolutely not 
guaranteed to return true in finite time. That is well documented on the 
dma_fence() object.

When you want to poll on signaling from userspace you really need to 
call poll or the wait IOCTL with a zero timeout. That will also return 
immediately but should enable signaling while doing that.

So just querying the status should absolutely *not* enable signaling. 
That's an intentional separation.

Regards,
Christian.

>
> Fixes: 27b575a9aa2f ("drm/syncobj: add timeline payload query ioctl v6")
> Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
>
> ---
>
> v2: add Signed-off-by and Fixes tags
> ---
>   drivers/gpu/drm/drm_syncobj.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
> index 4fcfc0b9b386c..58c5593c897a2 100644
> --- a/drivers/gpu/drm/drm_syncobj.c
> +++ b/drivers/gpu/drm/drm_syncobj.c
> @@ -1689,6 +1689,9 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data,
>   			    DRM_SYNCOBJ_QUERY_FLAGS_LAST_SUBMITTED) {
>   				point = fence->seqno;
>   			} else {
> +				/* ensure forward progress */
> +				dma_fence_enable_sw_signaling(fence);
> +
>   				dma_fence_chain_for_each(iter, fence) {
>   					if (iter->context != fence->context) {
>   						dma_fence_put(iter);


  reply	other threads:[~2024-10-22 16:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-22 16:18 Chia-I Wu
2024-10-22 16:53 ` Christian König [this message]
2024-10-22 17:24   ` Chia-I Wu
2024-11-04 21:32     ` Chia-I Wu
     [not found]       ` <301110a2-c004-4385-9231-b9354904b5e0@amd.com>
2024-11-05 17:56         ` Chia-I Wu
2024-11-06  8:14           ` Boris Brezillon
     [not found]             ` <048c2dca-48fd-4627-ba0c-bc9daa17ac29@amd.com>
2024-11-06 13:12               ` Boris Brezillon

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=900f8658-726c-4034-90ff-398e6c57ec47@amd.com \
    --to=christian.koenig@amd.com \
    --cc=airlied@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=david1.zhou@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=faith.ekstrand@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lionel.g.landwerlin@intel.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=olvaffe@gmail.com \
    --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

all inboxes | Powered by JetHome®