public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Pekka Paalanen <ppaalanen@gmail.com>
To: Rob Clark <robdclark@gmail.com>
Cc: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Christian König" <ckoenig.leichtzumerken@gmail.com>,
	"Michel Dänzer" <michel@daenzer.net>,
	"Tvrtko Ursulin" <tvrtko.ursulin@intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Simon Ser" <contact@emersion.fr>,
	"Luben Tuikov" <luben.tuikov@amd.com>,
	"Rob Clark" <robdclark@chromium.org>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Gustavo Padovan" <gustavo@padovan.org>,
	"Christian König" <christian.koenig@amd.com>,
	linux-media@vger.kernel.org (open list:SYNC FILE FRAMEWORK),
	linaro-mm-sig@lists.linaro.org (moderated list:DMA BUFFER
	SHARING FRAMEWORK), linux-kernel@vger.kernel.org (open list)
Subject: Re: [PATCH v7 06/15] dma-buf/sync_file: Support (E)POLLPRI
Date: Tue, 28 Feb 2023 11:22:38 +0200	[thread overview]
Message-ID: <20230228112238.40e2ad43@eldfell> (raw)
In-Reply-To: <20230227193535.2822389-7-robdclark@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]

On Mon, 27 Feb 2023 11:35:12 -0800
Rob Clark <robdclark@gmail.com> wrote:

> From: Rob Clark <robdclark@chromium.org>
> 
> Allow userspace to use the EPOLLPRI/POLLPRI flag to indicate an urgent
> wait (as opposed to a "housekeeping" wait to know when to cleanup after
> some work has completed).  Usermode components of GPU driver stacks
> often poll() on fence fd's to know when it is safe to do things like
> free or reuse a buffer, but they can also poll() on a fence fd when
> waiting to read back results from the GPU.  The EPOLLPRI/POLLPRI flag
> lets the kernel differentiate these two cases.
> 
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>  drivers/dma-buf/sync_file.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
> index 418021cfb87c..cbe96295373b 100644
> --- a/drivers/dma-buf/sync_file.c
> +++ b/drivers/dma-buf/sync_file.c
> @@ -192,6 +192,14 @@ static __poll_t sync_file_poll(struct file *file, poll_table *wait)
>  {
>  	struct sync_file *sync_file = file->private_data;
>  
> +	/*
> +	 * The POLLPRI/EPOLLPRI flag can be used to signal that
> +	 * userspace wants the fence to signal ASAP, express this
> +	 * as an immediate deadline.
> +	 */
> +	if (poll_requested_events(wait) & EPOLLPRI)
> +		dma_fence_set_deadline(sync_file->fence, ktime_get());

Hi,

I don't think this doc will appear anywhere where it could be found,
maybe not in kernel HTML doc at all?

I also think this is not a good idea, but not my call.


Thanks,
pq


> +
>  	poll_wait(file, &sync_file->wq, wait);
>  
>  	if (list_empty(&sync_file->cb.node) &&


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-02-28  9:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-27 19:35 [PATCH v7 00/15] dma-fence: Deadline awareness Rob Clark
2023-02-27 19:35 ` [PATCH v7 01/15] dma-buf/dma-fence: Add deadline awareness Rob Clark
2023-02-28  9:21   ` Pekka Paalanen
2023-02-28 17:32     ` Rob Clark
2023-03-01  3:50   ` Bagas Sanjaya
2023-02-27 19:35 ` [PATCH v7 02/15] dma-buf/fence-array: Add fence deadline support Rob Clark
2023-02-27 19:35 ` [PATCH v7 03/15] dma-buf/fence-chain: " Rob Clark
2023-02-27 19:35 ` [PATCH v7 04/15] dma-buf/dma-resv: Add a way to set fence deadline Rob Clark
2023-02-27 19:35 ` [PATCH v7 05/15] dma-buf/sync_file: Add SET_DEADLINE ioctl Rob Clark
2023-02-28  9:22   ` Pekka Paalanen
2023-02-28 19:37     ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 06/15] dma-buf/sync_file: Support (E)POLLPRI Rob Clark
2023-02-28  9:22   ` Pekka Paalanen [this message]
2023-02-27 19:35 ` [PATCH v7 07/15] dma-buf/sw_sync: Add fence deadline support Rob Clark
2023-02-28  9:23   ` Pekka Paalanen
2023-02-28 19:47     ` Rob Clark
2023-02-27 19:35 ` [PATCH v7 08/15] drm/scheduler: " Rob Clark
2023-02-27 19:35 ` [PATCH v7 12/15] drm/msm: Add deadline based boost support Rob Clark
2023-02-27 19:35 ` [PATCH v7 15/15] drm/i915: " Rob Clark
2023-02-28 12:42 ` [PATCH v7 00/15] dma-fence: Deadline awareness Bagas Sanjaya
2023-02-28 15:44   ` Rob Clark
2023-03-01  2:42     ` Bagas Sanjaya

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=20230228112238.40e2ad43@eldfell \
    --to=ppaalanen@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=christian.koenig@amd.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=contact@emersion.fr \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=luben.tuikov@amd.com \
    --cc=michel@daenzer.net \
    --cc=robdclark@chromium.org \
    --cc=robdclark@gmail.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tvrtko.ursulin@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