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 -- Chris Wilson, Intel Open Source Technology Centre