From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Keith Packard" Subject: Re: [PATCH] vulkan: Add VK_EXT_calibrated_timestamps extension (radv and anv) [v4] Date: Tue, 16 Oct 2018 15:06:57 -0700 Message-ID: <87tvll7dha.fsf@keithp.com> References: <20181015230515.3695-1-keithp@keithp.com> <20181016053150.11453-1-keithp@keithp.com> <87bm7t8z3k.fsf@keithp.com> <8736t58usr.fsf@keithp.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0520523233==" Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Bas Nieuwenhuizen Cc: mesa-dev , ML dri-devel , Jason Ekstrand List-Id: dri-devel@lists.freedesktop.org --===============0520523233== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Bas Nieuwenhuizen writes: > Well the complication here is that in the MONOTONIC (not > MONOTONIC_RAW) case the CPU measurement can happen at the end of the > MONOTONIC_RAW interval (as the order of measurements is based on > argument order), so you can get a tick that started `period` (5 in > this case) monotonic ticks before the start of the interval and a CPU > measurement at the end of the interval. Ah, that's an excellent point. Let's split out raw and monotonic and take a look. You want the GPU sampled at the start of the raw interval and monotonic sampled at the end, I think? w x y z 0 1 2 3 4 5 6 7 8 9 a b c d e f Raw -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- 0 1 2 3 GPU -----_____-----_____-----_____-----_____ x y z 0 1 2 3 4 5 6 7 8 9 a b c Monotonic -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- Interval <-----------------> Deviation <--------------------------> start =3D read(raw) 2 gpu =3D read(GPU) 1 mono =3D read(monotonic) 2 end =3D read(raw) b In this case, the error between the monotonic pulse and the GPU is interval + gpu_period (probably plus one to include the measurement error of the raw clock). Thanks for finding this case. Now, I guess the question is whether we want to try and find the smallest maxDeviation possible for each query. For instance, if the application asks only for raw and gpu, the max_deviation could be max2(interval+1,gpu_period), but if it asks for monotonic and gpu, it would be interval+1+gpu_period. I'm not seeing a simple definition here... =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAlvGYQEACgkQ2yIaaQAA ABEWVRAAl6Kg3pwcrQFqbF52SPu3ZC+6nAi+BlBMrsVcmkjpUz8XpXMMf1D8A1V6 vEFYZqkL+/k74ebsCvXIutXLFfMrp6iqTqkt6SRpc0jAQI15Bp3YxzN1XikFX5HR 0JCVr6buzFCIVCqRBXBcCbxG2vGCowyb3TdStWeyd+gSEB5mc4SjT+Lk5CMcFFrK RTijdVgbK1X4oaSnTf+UXAKQEQ/9X41jo5kwhSzV9shZh/0mz/5yjlb2DkMXtugX trpGawt6O0dYY6JPBq5ufMjOKU5Nf1iRo0WwQyhBR50Wbv9etI25Z8Pjo1FsqU4b gwf568LSoJ/brhqCtD+biZZ741lp75H1Ou6FNTicBN7v+F+jjJ76CDHVE2u9XADr EGr4HIvccx1rIb8284Zc5rlGyq/4jKjmZjOakD1FgUCSA67azI7NvRqaAFmy2GMN zXuTLO3E7vH4rwmJa0pCgHjNKpBuVK6+SmEdtrnAw6pSnkcTFPenjy8hlqJKRfoD iAyCRG5dTAMFkMU+SHll57F6Ozi4liEV24ve3KbwVgqg4iLXClGX2YKcwMWFfuQl na2KT9IZ5qRruXcAG7drgd3cR06J/YS8BTJkyqXXs4k/h1yk5xvJBnxDPXnvHlNy URd0nhGfRuz565srK+0DlTpYufCs2PN3idgApZbjEnI1VY4Vrm8= =3OjN -----END PGP SIGNATURE----- --=-=-=-- --===============0520523233== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0520523233==--