summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/radeon/r600.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-09-17 05:50:30 +0400
committerOlof Johansson <olof@lixom.net>2012-09-17 05:50:30 +0400
commitd192f93cfca6a0aedbf10fa548d8bc17b86275d6 (patch)
tree357a4106ec49747bd78550a79d68f7b6d1f642a3 /drivers/gpu/drm/radeon/r600.c
parentadcb079f28ec08165897e2450a4a60b219274008 (diff)
parentd5703bd35a4c76b0717ea51e2e8aabce341828a1 (diff)
downloadlinux-d192f93cfca6a0aedbf10fa548d8bc17b86275d6.tar.xz
Merge tag 'tegra-for-3.7-maintainers' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra into next/maintainers
* tag 'tegra-for-3.7-maintainers' of git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra: MAINTAINERS: tegra: remove Olof/Colin, add device tree files MAINTAINERS: add defconfig file to TEGRA section + sync with 3.6-rc4
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r--drivers/gpu/drm/radeon/r600.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 637280f541a3..d79c639ae739 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -3789,3 +3789,23 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev)
WREG32_PCIE_P(PCIE_LC_LINK_WIDTH_CNTL, link_width_cntl);
}
}
+
+/**
+ * r600_get_gpu_clock - return GPU clock counter snapshot
+ *
+ * @rdev: radeon_device pointer
+ *
+ * Fetches a GPU clock counter snapshot (R6xx-cayman).
+ * Returns the 64 bit clock counter snapshot.
+ */
+uint64_t r600_get_gpu_clock(struct radeon_device *rdev)
+{
+ uint64_t clock;
+
+ mutex_lock(&rdev->gpu_clock_mutex);
+ WREG32(RLC_CAPTURE_GPU_CLOCK_COUNT, 1);
+ clock = (uint64_t)RREG32(RLC_GPU_CLOCK_COUNT_LSB) |
+ ((uint64_t)RREG32(RLC_GPU_CLOCK_COUNT_MSB) << 32ULL);
+ mutex_unlock(&rdev->gpu_clock_mutex);
+ return clock;
+}