linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michel Dänzer" <michel.daenzer@mailbox.org>
To: Sebastian Wick <sebastian.wick@redhat.com>,
	Rob Clark <robdclark@gmail.com>
Cc: "Rob Clark" <robdclark@chromium.org>,
	"Pekka Paalanen" <pekka.paalanen@collabora.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Christian König" <ckoenig.leichtzumerken@gmail.com>,
	intel-gfx@lists.freedesktop.org,
	"open list:DOCUMENTATION" <linux-doc@vger.kernel.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	dri-devel@lists.freedesktop.org,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"moderated list:DMA BUFFER SHARING FRAMEWORK"
	<linaro-mm-sig@lists.linaro.org>,
	"Luben Tuikov" <luben.tuikov@amd.com>,
	"Bagas Sanjaya" <bagasdotme@gmail.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Gustavo Padovan" <gustavo@padovan.org>,
	"Matt Turner" <mattst88@gmail.com>,
	freedreno@lists.freedesktop.org,
	"Christian König" <christian.koenig@amd.com>,
	"open list:DMA BUFFER SHARING FRAMEWORK"
	<linux-media@vger.kernel.org>
Subject: Re: [PATCH v10 01/15] dma-buf/dma-fence: Add deadline awareness
Date: Fri, 17 Mar 2023 10:10:44 +0100	[thread overview]
Message-ID: <12626002-98db-7702-598e-28ea4a3e5061@mailbox.org> (raw)
In-Reply-To: <CA+hFU4xbssR+=Sf4ia5kPdsSb4y9SQUd4nx_2p1Szcbtna28CA@mail.gmail.com>

On 3/16/23 23:22, Sebastian Wick wrote:
> On Thu, Mar 16, 2023 at 5:29 PM Rob Clark <robdclark@gmail.com> wrote:
>> On Thu, Mar 16, 2023 at 2:26 AM Jonas Ådahl <jadahl@gmail.com> wrote:
>>> On Wed, Mar 15, 2023 at 09:19:49AM -0700, Rob Clark wrote:
>>>> On Wed, Mar 15, 2023 at 6:53 AM Jonas Ådahl <jadahl@gmail.com> wrote:
>>>>> On Fri, Mar 10, 2023 at 09:38:18AM -0800, Rob Clark wrote:
>>>>>> On Fri, Mar 10, 2023 at 7:45 AM Jonas Ådahl <jadahl@gmail.com> wrote:
>>>>>>>
>>>>>>>> + *
>>>>>>>> + * To this end, deadline hint(s) can be set on a &dma_fence via &dma_fence_set_deadline.
>>>>>>>> + * The deadline hint provides a way for the waiting driver, or userspace, to
>>>>>>>> + * convey an appropriate sense of urgency to the signaling driver.
>>>>>>>> + *
>>>>>>>> + * A deadline hint is given in absolute ktime (CLOCK_MONOTONIC for userspace
>>>>>>>> + * facing APIs).  The time could either be some point in the future (such as
>>>>>>>> + * the vblank based deadline for page-flipping, or the start of a compositor's
>>>>>>>> + * composition cycle), or the current time to indicate an immediate deadline
>>>>>>>> + * hint (Ie. forward progress cannot be made until this fence is signaled).
>>>>>>>
>>>>>>> Is it guaranteed that a GPU driver will use the actual start of the
>>>>>>> vblank as the effective deadline? I have some memories of seing
>>>>>>> something about vblank evasion browsing driver code, which I might have
>>>>>>> misunderstood, but I have yet to find whether this is something
>>>>>>> userspace can actually expect to be something it can rely on.
>>>>>>
>>>>>> I guess you mean s/GPU driver/display driver/ ?  It makes things more
>>>>>> clear if we talk about them separately even if they happen to be the
>>>>>> same device.
>>>>>
>>>>> Sure, sorry about being unclear about that.
>>>>>
>>>>>>
>>>>>> Assuming that is what you mean, nothing strongly defines what the
>>>>>> deadline is.  In practice there is probably some buffering in the
>>>>>> display controller.  For ex, block based (including bandwidth
>>>>>> compressed) formats, you need to buffer up a row of blocks to
>>>>>> efficiently linearize for scanout.  So you probably need to latch some
>>>>>> time before you start sending pixel data to the display.  But details
>>>>>> like this are heavily implementation dependent.  I think the most
>>>>>> reasonable thing to target is start of vblank.
>>>>>
>>>>> The driver exposing those details would be quite useful for userspace
>>>>> though, so that it can delay committing updates to late, but not too
>>>>> late. Setting a deadline to be the vblank seems easy enough, but it
>>>>> isn't enough for scheduling the actual commit.
>>>>
>>>> I'm not entirely sure how that would even work.. but OTOH I think you
>>>> are talking about something on the order of 100us?  But that is a bit
>>>> of another topic.
>>>
>>> Yes, something like that. But yea, it's not really related. Scheduling
>>> commits closer to the deadline has more complex behavior than that too,
>>> e.g. the need for real time scheduling, and knowing how long it usually
>>> takes to create and commit and for the kernel to process.
> 
> Vblank can be really long, especially with VRR where the additional
> time you get to finish the frame comes from making vblank longer.
> Using the start of vblank as a deadline makes VRR useless.

Not really. We normally still want to aim for start of vblank with VRR, which would result in the maximum refresh rate. Missing that target just incurs less of a penalty than with fixed refresh rate.


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer


  parent reply	other threads:[~2023-03-17  9:11 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 15:52 [PATCH v10 00/15] dma-fence: Deadline awareness Rob Clark
2023-03-08 15:52 ` [PATCH v10 01/15] dma-buf/dma-fence: Add deadline awareness Rob Clark
2023-03-10 15:45   ` Jonas Ådahl
2023-03-10 17:38     ` Rob Clark
2023-03-15 13:53       ` Jonas Ådahl
2023-03-15 16:19         ` Rob Clark
2023-03-16  9:26           ` Jonas Ådahl
2023-03-16 16:28             ` Rob Clark
2023-03-16 22:22               ` Sebastian Wick
2023-03-16 22:59                 ` Rob Clark
2023-03-17 15:07                   ` Sebastian Wick
2023-03-17  9:10                 ` Michel Dänzer [this message]
2023-03-17 10:23               ` Jonas Ådahl
2023-03-17 15:59                 ` Rob Clark
2023-03-21 13:24                   ` Jonas Ådahl
2023-03-21 14:34                     ` Rob Clark
2023-03-08 15:52 ` [PATCH v10 02/15] dma-buf/fence-array: Add fence deadline support Rob Clark
2023-03-08 15:52 ` [PATCH v10 03/15] dma-buf/fence-chain: " Rob Clark
2023-03-08 15:52 ` [PATCH v10 04/15] dma-buf/dma-resv: Add a way to set fence deadline Rob Clark
2023-03-08 15:52 ` [PATCH v10 05/15] dma-buf/sync_file: Surface sync-file uABI Rob Clark
2023-03-08 15:52 ` [PATCH v10 06/15] dma-buf/sync_file: Add SET_DEADLINE ioctl Rob Clark
2023-03-08 15:52 ` [PATCH v10 07/15] dma-buf/sw_sync: Add fence deadline support Rob Clark
2023-03-28 13:57   ` Tvrtko Ursulin
2023-03-08 15:52 ` [PATCH v10 08/15] drm/scheduler: " Rob Clark
2023-03-08 15:53 ` [PATCH v10 09/15] drm/syncobj: Add deadline support for syncobj waits Rob Clark
     [not found]   ` <CAOFGe944_xJOJ3a-uJDVyca_1_+aYTqat4=Qc3CC1wUubxw3XQ@mail.gmail.com>
2023-03-17 19:38     ` [Intel-gfx] " Rob Clark
2023-03-18 16:07     ` Rob Clark
2023-03-28 14:24   ` Tvrtko Ursulin
2023-03-08 15:53 ` [PATCH v10 10/15] drm/vblank: Add helper to get next vblank time Rob Clark
2023-03-08 15:53 ` [PATCH v10 11/15] drm/atomic-helper: Set fence deadline for vblank Rob Clark
2023-03-31 20:44   ` Nathan Chancellor
2023-03-31 22:14     ` Rob Clark
2023-03-31 23:30       ` Nathan Chancellor
2023-04-01 15:39         ` Rob Clark
2023-04-04 17:22   ` Dmitry Baryshkov
2023-04-04 19:16     ` Daniel Vetter
2023-04-04 21:53       ` Dmitry Baryshkov
2023-04-05  7:58         ` Daniel Vetter
2023-03-08 15:53 ` [PATCH v10 12/15] drm/msm: Add deadline based boost support Rob Clark
2023-03-08 15:53 ` [PATCH v10 13/15] drm/msm: Add wait-boost support Rob Clark
2023-03-08 15:53 ` [PATCH v10 14/15] drm/msm/atomic: Switch to vblank_start helper Rob Clark
2023-03-08 15:53 ` [PATCH v10 15/15] drm/i915: Add deadline based boost support Rob Clark
2023-03-09 10:21 ` [PATCH v10 00/15] dma-fence: Deadline awareness Pekka Paalanen
2023-03-16 21:22 ` Rob Clark
2023-03-27 19:05 ` Matt Turner

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=12626002-98db-7702-598e-28ea4a3e5061@mailbox.org \
    --to=michel.daenzer@mailbox.org \
    --cc=bagasdotme@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=luben.tuikov@amd.com \
    --cc=mattst88@gmail.com \
    --cc=pekka.paalanen@collabora.com \
    --cc=robdclark@chromium.org \
    --cc=robdclark@gmail.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=sebastian.wick@redhat.com \
    --cc=sumit.semwal@linaro.org \
    /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).