Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753974AbaGJVz3 (ORCPT ); Thu, 10 Jul 2014 17:55:29 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:56491 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753939AbaGJVzW (ORCPT ); Thu, 10 Jul 2014 17:55:22 -0400 From: Oded Gabbay X-Google-Original-From: Oded Gabbay To: David Airlie , Alex Deucher , Jerome Glisse Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, John Bridgman , Andrew Lewycky , Joerg Roedel , Evgeny Pinchuk , Oded Gabbay , =?UTF-8?q?Christian=20K=C3=B6nig?= Subject: [PATCH 39/83] drm/radeon: Extending kfd interface Date: Fri, 11 Jul 2014 00:53:55 +0300 Message-Id: <1405029279-6894-11-git-send-email-oded.gabbay@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> References: <1405029279-6894-1-git-send-email-oded.gabbay@amd.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Evgeny Pinchuk Adding new function to the interface used by kfd. The new function retrieves the max engine clock speed. Signed-off-by: Evgeny Pinchuk Signed-off-by: Oded Gabbay --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/