[Intel-gfx] TIMESTAMP register

Lawrynowicz, Jacek jacek.lawrynowicz at intel.com
Wed Apr 18 09:53:36 CEST 2012

But how would I synchronize GPU and CPU clocks without access to the TIMESTAMP 
And are you sure that over time both clocks won't desynchronize?

Do you all agree that this functionality should not be implemented in the 


-----Original Message-----
From: Chris Wilson [mailto:chris at chris-wilson.co.uk]
Sent: Wednesday, April 18, 2012 9:36 AM
To: Lawrynowicz, Jacek; Ben Widawsky; Daniel Vetter
Cc: intel-gfx at lists.freedesktop.org
Subject: RE: [Intel-gfx] TIMESTAMP register

On Wed, 18 Apr 2012 06:32:04 +0000, "Lawrynowicz, Jacek" 
<jacek.lawrynowicz at intel.com> wrote:
> I think that ioctl to get GPU timestamp and its resolution would be
> the best approach.
> This ioctl won't be called very often so there's no need to sacrifice
> simplicity for performance in this case.
> Using clock_gettime() sounds like trouble to me.
> How would you keep GPU and CPU time synchronized?
The bspec explicitly says that the GPU timestamp is adjusted for changes in 
render frequency so that it is consistent. Similarly CLOCK_MONOTONIC.

> Is forcewakeup necessary in case of a register which is not affected
> by gfx reset?

They are in the GT powerwell, so yes forcewake will be necessary for the read 
not to return garbage.

The rule of thumb is to keep interfaces out of the kernel unless there is a 
compelling reason otherwise. I think there is a good reason for a 
ioctl(QUERY_COUNTER), but I can also see that you can implement 
proof-of-principle code for this ARB timer entirely in userspace.

Chris Wilson, Intel Open Source Technology Centre
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 8658 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20120418/1f0d3413/attachment.bin>
-------------- next part --------------
Intel Technology Poland sp. z o.o.
z siedziba w Gdansku
ul. Slowackiego 173
80-298 Gdansk

Sad Rejonowy Gdansk Polnoc w Gdansku, 
VII Wydzial Gospodarczy Krajowego Rejestru Sadowego, 
numer KRS 101882

NIP 957-07-52-316
Kapital zakladowy 200.000 zl

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

More information about the Intel-gfx mailing list