public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jacek Danecki <jacek.danecki@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATH] Correct GPU timestamp read
Date: Thu, 25 Sep 2014 15:00:53 +0200	[thread overview]
Message-ID: <54241205.1030704@intel.com> (raw)
In-Reply-To: <20140925122626.GA24221@nuc-i3427.alporthouse.com>

On 09/25/14 14:26, Chris Wilson wrote:
> The problem is that beignet already works around the broken hw read
> whereas mesa does not. 

There is workaround in mesa already:

static uint64_t
ilo_get_timestamp(struct pipe_screen *screen)
{
   struct ilo_screen *is = ilo_screen(screen);
   union {
      uint64_t val;
      uint32_t dw[2];
   } timestamp;

   intel_winsys_read_reg(is->winsys, GEN6_REG_TIMESTAMP, &timestamp.val);

   /*
    * From the Ivy Bridge PRM, volume 1 part 3, page 107:
    *
    *     "Note: This timestamp register reflects the value of the PCU TSC.
    *      The PCU TSC counts 10ns increments; this timestamp reflects bits
    *      38:3 of the TSC (i.e. 80ns granularity, rolling over every 1.5
    *      hours)."
    *
    * However, it seems dw[0] is garbage and dw[1] contains the lower 32 bits
    * of the timestamp.  We will have to live with a timestamp that rolls over
    * every ~343 seconds.
    *
    * See also brw_get_timestamp().
    */
   return (uint64_t) timestamp.dw[1] * 80;
}


> If we apply the fix in the kernel we break the
> one user of it in beignet but fix all the existing users of mesa.

Are you talking about fix in kernel which will provide 36 bits GPU timestamp,
or about applying patch I've proposed?
If we add new register to register_whitelist, we will probably not break anything,
but we'll allow UMD's to use whole TIMESTAMP.

-- 
jacek

  reply	other threads:[~2014-09-25 13:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 16:22 [PATH] Correct GPU timestamp read Jacek Danecki
2014-09-23  8:37 ` Daniel Vetter
2014-09-23 17:12   ` Jacek Danecki
2014-09-25 12:26 ` Chris Wilson
2014-09-25 13:00   ` Jacek Danecki [this message]
2014-09-25 13:09     ` Chris Wilson

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=54241205.1030704@intel.com \
    --to=jacek.danecki@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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