public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jacek Danecki <jacek.danecki@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATH] Correct GPU timestamp read
Date: Mon, 22 Sep 2014 18:22:53 +0200	[thread overview]
Message-ID: <54204CDD.9000706@intel.com> (raw)

Current implementation of reading GPU timestamp is broken.
It returns lower 32 bits shifted by 32 bits (XXXXXXXX00000000 instead of YYYYYYYYXXXXXXXX).
Below change is adding possibility to read hi part of that register separately.

Signed-off-by: Jacek Danecki jacek.danecki@intel.com
---

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 20673cc..5c87d92 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -1089,6 +1089,7 @@ enum punit_power_well {
 #define RING_IMR(base)		((base)+0xa8)
 #define RING_HWSTAM(base)	((base)+0x98)
 #define RING_TIMESTAMP(base)	((base)+0x358)
+#define RING_TIMESTAMP_HI(base)	((base)+0x35C)
 #define   TAIL_ADDR		0x001FFFF8
 #define   HEAD_WRAP_COUNT	0xFFE00000
 #define   HEAD_WRAP_ONE		0x00200000
diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
index e81bc3b..6fa4c86 100644
--- a/drivers/gpu/drm/i915/intel_uncore.c
+++ b/drivers/gpu/drm/i915/intel_uncore.c
@@ -969,6 +969,7 @@ static const struct register_whitelist {
 	uint32_t gen_bitmask;
 } whitelist[] = {
 	{ RING_TIMESTAMP(RENDER_RING_BASE), 8, GEN_RANGE(4, 8) },
+	{ RING_TIMESTAMP_HI(RENDER_RING_BASE), 4, GEN_RANGE(4, 8) },
 };

 int i915_reg_read_ioctl(struct drm_device *dev,
-- 1.8.3.1

-- 
jacek

             reply	other threads:[~2014-09-22 16:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-22 16:22 Jacek Danecki [this message]
2014-09-23  8:37 ` [PATH] Correct GPU timestamp read Daniel Vetter
2014-09-23 17:12   ` Jacek Danecki
2014-09-25 12:26 ` Chris Wilson
2014-09-25 13:00   ` Jacek Danecki
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=54204CDD.9000706@intel.com \
    --to=jacek.danecki@intel.com \
    --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