[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1405029279-6894-11-git-send-email-oded.gabbay@amd.com>
Date: Fri, 11 Jul 2014 00:53:55 +0300
From: Oded Gabbay <oded.gabbay@...il.com>
To: David Airlie <airlied@...ux.ie>,
Alex Deucher <alexander.deucher@....com>,
Jerome Glisse <j.glisse@...il.com>
Cc: linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org,
John Bridgman <John.Bridgman@....com>,
Andrew Lewycky <Andrew.Lewycky@....com>,
Joerg Roedel <joro@...tes.org>,
Evgeny Pinchuk <evgeny.pinchuk@....com>,
Oded Gabbay <oded.gabbay@....com>,
Christian König <christian.koenig@....com>
Subject: [PATCH 39/83] drm/radeon: Extending kfd interface
From: Evgeny Pinchuk <evgeny.pinchuk@....com>
Adding new function to the interface used by kfd.
The new function retrieves the max engine clock speed.
Signed-off-by: Evgeny Pinchuk <evgeny.pinchuk@....com>
Signed-off-by: Oded Gabbay <oded.gabbay@....com>
---
drivers/gpu/drm/radeon/radeon_kfd.c | 11 +++++++++++
include/linux/radeon_kfd.h | 2 ++
2 files changed, 13 insertions(+)
diff --git a/drivers/gpu/drm/radeon/radeon_kfd.c b/drivers/gpu/drm/radeon/radeon_kfd.c
index 6dba170..8b6d497 100644
--- a/drivers/gpu/drm/radeon/radeon_kfd.c
+++ b/drivers/gpu/drm/radeon/radeon_kfd.c
@@ -50,6 +50,8 @@ static void unlock_srbm_gfx_cntl(struct kgd_dev *kgd);
static void lock_grbm_gfx_idx(struct kgd_dev *kgd);
static void unlock_grbm_gfx_idx(struct kgd_dev *kgd);
+static uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd);
+
static const struct kfd2kgd_calls kfd2kgd = {
.allocate_mem = allocate_mem,
@@ -64,6 +66,7 @@ static const struct kfd2kgd_calls kfd2kgd = {
.unlock_srbm_gfx_cntl = unlock_srbm_gfx_cntl,
.lock_grbm_gfx_idx = lock_grbm_gfx_idx,
.unlock_grbm_gfx_idx = unlock_grbm_gfx_idx,
+ .get_max_engine_clock_in_mhz = get_max_engine_clock_in_mhz,
};
static const struct kgd2kfd_calls *kgd2kfd;
@@ -307,3 +310,11 @@ static uint64_t get_gpu_clock_counter(struct kgd_dev *kgd)
return rdev->asic->get_gpu_clock_counter(rdev);
}
+
+static uint32_t get_max_engine_clock_in_mhz(struct kgd_dev *kgd)
+{
+ struct radeon_device *rdev = (struct radeon_device *)kgd;
+
+ /* The sclk is in quantas of 10kHz */
+ return rdev->pm.power_state->clock_info->sclk / 100;
+}
diff --git a/include/linux/radeon_kfd.h b/include/linux/radeon_kfd.h
index 4c7e923..4114c8e 100644
--- a/include/linux/radeon_kfd.h
+++ b/include/linux/radeon_kfd.h
@@ -93,6 +93,8 @@ struct kfd2kgd_calls {
/* GRBM_GFX_INDEX mutex */
void (*lock_grbm_gfx_idx)(struct kgd_dev *kgd);
void (*unlock_grbm_gfx_idx)(struct kgd_dev *kgd);
+
+ uint32_t (*get_max_engine_clock_in_mhz)(struct kgd_dev *kgd);
};
bool kgd2kfd_init(unsigned interface_version,
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists