Re: TIMESTAMP register

Lawrynowicz, Jacek
2012-04-18T07:54:28Z

[-- Attachment #1.1: Type: text/plain, Size: 1588 bytes --]

But how would I synchronize GPU and CPU clocks without access to the TIMESTAMP
register?
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
kernel?

Regards,
Jacek

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

On Wed, 18 Apr 2012 06:32:04 +0000, "Lawrynowicz, Jacek"
<jacek.lawrynowicz@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

--
Chris Wilson, Intel Open Source Technology Centre

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 8658 bytes --]

[-- Attachment #2: Type: text/plain, Size: 599 bytes --]

---------------------------------------------------------------------
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.

[-- Attachment #3: Type: text/plain, Size: 159 bytes --]