dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: "Harry Wentland" <harry.wentland-5C7GfCeVMHo@public.gmane.org>,
	"Michel Dänzer" <michel-otUistvHUpPR7s880joybQ@public.gmane.org>,
	"Christian König" <christian.koenig-5C7GfCeVMHo@public.gmane.org>,
	"Manasi Navare"
	<manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "Cyr, Aric" <Aric.Cyr-5C7GfCeVMHo@public.gmane.org>,
	"Nicolai Hähnle" <nicolai.haehnle-5C7GfCeVMHo@public.gmane.org>,
	"Daniel Vetter" <daniel.vetter-/w4YWyX8dFk@public.gmane.org>,
	"Michel Dänzer" <michel.daenzer-5C7GfCeVMHo@public.gmane.org>,
	dri-devel
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"amd-gfx mailing list"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	"Deucher,
	Alexander" <Alexander.Deucher-5C7GfCeVMHo@public.gmane.org>,
	"Koo, Anthony" <Anthony.Koo-5C7GfCeVMHo@public.gmane.org>
Subject: Re: RFC for a render API to support adaptive sync and VRR
Date: Tue, 10 Apr 2018 17:28:18 +0200	[thread overview]
Message-ID: <6923ac2b-4da1-6650-5ac7-8d4fbabdfba0@gmail.com> (raw)
In-Reply-To: <ae9992e5-43ab-9636-13e1-8a5c692480b5-5C7GfCeVMHo@public.gmane.org>

Am 10.04.2018 um 17:08 schrieb Harry Wentland:
> On 2018-04-10 03:37 AM, Michel Dänzer wrote:
>> On 2018-04-10 08:45 AM, Christian König wrote:
>>> Am 09.04.2018 um 23:45 schrieb Manasi Navare:
>>>> Thanks for initiating the discussion. Find my comments below:
>>>> On Mon, Apr 09, 2018 at 04:00:21PM -0400, Harry Wentland wrote:
>>>>> On 2018-04-09 03:56 PM, Harry Wentland wrote:
>>>>>> === A DRM render API to support variable refresh rates ===
>>>>>>
>>>>>> In order to benefit from adaptive sync and VRR userland needs a way
>>>>>> to let us know whether to vary frame timings or to target a
>>>>>> different frame time. These can be provided as atomic properties on
>>>>>> a CRTC:
>>>>>>    * bool    variable_refresh_compatible
>>>>>>    * int    target_frame_duration_ns (nanosecond frame duration)
>>>>>>
>>>>>> This gives us the following cases:
>>>>>>
>>>>>> variable_refresh_compatible = 0, target_frame_duration_ns = 0
>>>>>>    * drive monitor at timing's normal refresh rate
>>>>>>
>>>>>> variable_refresh_compatible = 1, target_frame_duration_ns = 0
>>>>>>    * send new frame to monitor as soon as it's available, if within
>>>>>> min/max of monitor's reported capabilities
>>>>>>
>>>>>> variable_refresh_compatible = 0/1, target_frame_duration_ns = > 0
>>>>>>    * send new frame to monitor with the specified
>>>>>> target_frame_duration_ns
>>>>>>
>>>>>> When a target_frame_duration_ns or variable_refresh_compatible
>>>>>> cannot be supported the atomic check will reject the commit.
>>>>>>
>>>> What I would like is two sets of properties on a CRTC or preferably on
>>>> a connector:
>>>>
>>>> KMD properties that UMD can query:
>>>> * vrr_capable -  This will be an immutable property for exposing
>>>> hardware's capability of supporting VRR. This will be set by the
>>>> kernel after
>>>> reading the EDID mode information and monitor range capabilities.
>>>> * vrr_vrefresh_max, vrr_vrefresh_min - To expose the min and max
>>>> refresh rates supported.
>>>> These properties are optional and will be created and attached to the
>>>> DP/eDP connector when the connector
>>>> is getting intialized.
>>> Mhm, aren't those properties actually per mode and not per CRTC/connector?
>>>
>>>> Properties that you mentioned above that the UMD can set before kernel
>>>> can enable VRR functionality
>>>> *bool vrr_enable or vrr_compatible
>>>> target_frame_duration_ns
>>> Yeah, that certainly makes sense. But target_frame_duration_ns is a bad
>>> name/semantics.
>>>
>>> We should use an absolute timestamp where the frame should be presented,
>>> otherwise you could run into a bunch of trouble with IOCTL restarts or
>>> missed blanks.
>> Also, a fixed target frame duration isn't suitable even for video
>> playback, due to drift between the video and audio clocks.
>>
>> Time-based presentation seems to be the right approach for preventing
>> micro-stutter in games as well, Croteam developers have been researching
>> this.
>>
> I'm not sure if the driver can ever give a guarantee of the exact time a flip occurs. What we have control over with our HW is frame duration.

Sounds like you misunderstood what we mean here.

The driver does not need to give an exact guarantee that a flip happens 
at that time. It should just not flip before that specific time.

E.g. when we missed a VBLANK your approach would still wait for the 
specific amount of time, while an absolute timestamp would mean to flip 
as soon as possible after that timestamp passed.

As Michel noted that is also exactly what video players need.

>
> Are Croteam devs trying to predict render times? I'm not sure how that would work. We've had bad experience in the past with games that try to do framepacing as that's usually not accurate and tends to lead to more problems than benefits.

As far as I understand that is just a regulated feedback system, e.g. 
the application records the timestamps of the last three frames (or so) 
and then uses that + margin to as world time for the 3D rendering.

When the application has finished sending all rendering commands it 
sends the frame to be displayed exactly with that timestamp as well.

The timestamp when the frame was actually displayed is then used again 
as input to the algorithm.

Regards,
Christian.

>
> Harry
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2018-04-10 15:28 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <c79421ce-9408-5cd6-5de3-0fa521146e4b@amd.com>
     [not found] ` <c79421ce-9408-5cd6-5de3-0fa521146e4b-5C7GfCeVMHo@public.gmane.org>
2018-04-09 20:00   ` RFC for a render API to support adaptive sync and VRR Harry Wentland
     [not found]     ` <435ebd04-0435-5a6a-9f1e-e4c4fc629aa9-5C7GfCeVMHo@public.gmane.org>
2018-04-09 21:45       ` Manasi Navare
     [not found]         ` <20180409214554.GB13967-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-04-10  6:45           ` Christian König
2018-04-10  7:37             ` Michel Dänzer
     [not found]               ` <b75e31f7-ce59-de97-5445-cb4c03ff7336-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-10 15:08                 ` Harry Wentland
     [not found]                   ` <ae9992e5-43ab-9636-13e1-8a5c692480b5-5C7GfCeVMHo@public.gmane.org>
2018-04-10 15:28                     ` Christian König [this message]
2018-04-10 15:35                     ` Cyr, Aric
2018-04-10 15:43                       ` Christian König
     [not found]                         ` <fc53ce53-f02c-891d-4aa5-e9a11cbe3007-5C7GfCeVMHo@public.gmane.org>
2018-04-10 16:26                           ` Cyr, Aric
     [not found]                             ` <MWHPR12MB1837488A047C03E955282A4182BE0-Gy0DoCVfaSXe1Hf+mWOIywdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-04-10 16:37                               ` Nicolai Hähnle
     [not found]                                 ` <54baa87e-33a9-bd69-a309-d61176eb4e8d-5C7GfCeVMHo@public.gmane.org>
2018-04-10 17:52                                   ` Harry Wentland
     [not found]                             ` <063d6dff-2b97-ef01-12bb-8a24125a58ec@daenzer.net>
2018-04-10 17:13                               ` Cyr, Aric
     [not found]                                 ` <65006f34-39b9-5aca-e0c0-77a591b69c3a@daenzer.net>
     [not found]                                   ` <65006f34-39b9-5aca-e0c0-77a591b69c3a-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-10 17:25                                     ` Cyr, Aric
     [not found]                                       ` <f85e3590-b283-843b-12d0-5f6f0c4c0952@amd.com>
2018-04-10 21:45                                         ` Cyr, Aric
2018-04-11  6:57                                           ` Nicolai Hähnle
     [not found]                                             ` <72c1d357-db72-b181-9421-04f99b3bbf2f-5C7GfCeVMHo@public.gmane.org>
2018-04-11  9:50                                               ` Michel Dänzer
     [not found]                                                 ` <2005817c-09c0-aebe-bb96-9e22d6f16df5-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-11 23:30                                                   ` Cyr, Aric
     [not found]                                                     ` <MWHPR12MB1837F8120B126FA3A4CE899982BD0-Gy0DoCVfaSXe1Hf+mWOIywdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-04-12  8:48                                                       ` Michel Dänzer
2018-04-12 11:39                                                     ` Nicolai Hähnle
     [not found]                                                       ` <a5b5c31f-e7c5-8ae0-1239-06bfa86b939b-5C7GfCeVMHo@public.gmane.org>
2018-04-12 14:57                                                         ` Michel Dänzer
2018-04-12 17:39                                                         ` Harry Wentland
2018-04-11 10:28                                       ` Michel Dänzer
2018-04-11 15:45                             ` Michel Dänzer
     [not found]                       ` <MWHPR12MB1837C57016A470A5199E855282BE0-Gy0DoCVfaSXe1Hf+mWOIywdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-04-10 17:13                         ` Michel Dänzer
2018-04-12 21:38                 ` Stéphane Marchesin
2018-04-13 19:24                   ` Harry Wentland
2018-04-18  3:58                 ` Keith Packard
2018-04-18  7:39                   ` Daniel Vetter
2018-04-20 20:32                     ` Manasi Navare
     [not found]                       ` <20180420203240.GA9472-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-04-21 10:30                         ` Daniel Stone
2018-04-23 14:40                         ` Harry Wentland
2018-04-23 21:19                           ` Manasi Navare
     [not found]                             ` <20180423211944.GC9472-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-04-24 12:09                               ` Daniel Vetter
2018-04-24 14:20                                 ` Cyr, Aric
     [not found]                                 ` <20180424120946.GW31310-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-04-24 14:28                                   ` Harry Wentland
     [not found]                                     ` <b9c33eeb-1db8-f782-cfbe-411d94fecb67-5C7GfCeVMHo@public.gmane.org>
2018-04-24 21:57                                       ` Daniel Vetter
     [not found]                                         ` <CAKMK7uHzLRUwZSFbMb4qDzXBODVSQVTTw6BxgmvJdES4gJmBDg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-08-17 10:20                                           ` Ernst Sjöstrand
2018-04-10 15:03           ` Harry Wentland
2018-04-10 21:36             ` Manasi Navare
2018-04-10 22:00               ` Cyr, Aric
2018-04-13 16:04       ` Daniel Vetter
     [not found]         ` <20180413160453.GC31310-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-04-13 19:20           ` Harry Wentland

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=6923ac2b-4da1-6650-5ac7-8d4fbabdfba0@gmail.com \
    --to=ckoenig.leichtzumerken-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=Alexander.Deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=Anthony.Koo-5C7GfCeVMHo@public.gmane.org \
    --cc=Aric.Cyr-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=daniel.vetter-/w4YWyX8dFk@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=harry.wentland-5C7GfCeVMHo@public.gmane.org \
    --cc=manasi.d.navare-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=michel-otUistvHUpPR7s880joybQ@public.gmane.org \
    --cc=michel.daenzer-5C7GfCeVMHo@public.gmane.org \
    --cc=nicolai.haehnle-5C7GfCeVMHo@public.gmane.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