From: Chris Wilson <chris@chris-wilson.co.uk>
To: Ben Widawsky <ben@bwidawsk.net>, Daniel Vetter <daniel@ffwll.ch>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: TIMESTAMP register
Date: Wed, 18 Apr 2012 00:51:42 +0100 [thread overview]
Message-ID: <1334706720_15611@CP5-2952> (raw)
In-Reply-To: <20120417162745.229b7608@bwidawsk.net>
On Tue, 17 Apr 2012 16:27:45 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> On Tue, 17 Apr 2012 23:04:18 +0200
> Daniel Vetter <daniel@ffwll.ch> wrote:
>
> > On Tue, Apr 17, 2012 at 08:34:11PM +0000, Lawrynowicz, Jacek wrote:
> > > ARB_timer_query allows client read TIMESTAMP both asynchronously and synchronously.
> > > The former can be implemented as you said but the latter requires support from the KMD.
> > > This must be a simple MMIO read as this is the only way to report "current" GPU time.
> > > Implementing synchronous TIMESTAMP query using pipe control would render the third example from ARB_timer_query spec useless.
> >
> > Ok, I've looked like a dofus again, but now I've read the spec and we
> > indeed seem to need a synchronous readout of the TIMESTAMP register. I
> > guess a new register will do, together with some fixed-point integer that
> > tells userspace how to convert it to nanoseconds.
> > -Daniel
>
> I've not read the spec, but synchronous and "current" doesn't mean the
> exact same thing to me. I assume the spec doesn't allow getting the
> value in a batch and then just waiting for rendering to complete?
The spec stipulates that the client is able to query the timestamp
counter synchronously from within the render stream (ala PIPE_CONTROL)
and query the current timestamp asynchronously. The spec also explicitly
allows for those two clocks to be different (though close enough for the
user to not care). Therefore you need only use the nanosecond monotonic
clock for the asynchronous query and apply an offset to the GPU timestamp
when converting that from ticks to nanoseconds. My bet is that
clock_gettime() is going to beat even ioctl(QUERY_COUNTER), not least
because TIMESTAMP (being a per-ring register) is going to require
the forcewake dance.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
next prev parent reply other threads:[~2012-04-17 23:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-17 19:12 TIMESTAMP register Lawrynowicz, Jacek
2012-04-17 19:39 ` Daniel Vetter
2012-04-17 20:34 ` Lawrynowicz, Jacek
2012-04-17 21:04 ` Daniel Vetter
2012-04-17 23:27 ` Ben Widawsky
2012-04-17 23:51 ` Chris Wilson [this message]
2012-04-18 6:32 ` Lawrynowicz, Jacek
2012-04-18 7:35 ` Chris Wilson
2012-04-18 7:53 ` Lawrynowicz, Jacek
2012-04-18 8:05 ` Chris Wilson
2012-04-30 21:11 ` Eric Anholt
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=1334706720_15611@CP5-2952 \
--to=chris@chris-wilson.co.uk \
--cc=ben@bwidawsk.net \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.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