AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Evan Quan <evan.quan@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alexander.Deucher@amd.com, Evan Quan <evan.quan@amd.com>
Subject: [PATCH 08/10] drm/amdgpu: expose the minimum shader/memory clock frequency
Date: Fri, 9 Dec 2022 11:48:11 +0800	[thread overview]
Message-ID: <20221209034813.2373727-8-evan.quan@amd.com> (raw)
In-Reply-To: <20221209034813.2373727-1-evan.quan@amd.com>

Otherwise, some UMD tools will treate them as 0 at default while
actually they are not.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Change-Id: I524a512eb538dba626edd6d2c73a370dd6a1b4a5
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 10 ++++++++--
 include/uapi/drm/amdgpu_drm.h           |  2 ++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index ccb80f0a7fe2..dd1ebaa40e2e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -808,9 +808,15 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
 		if (adev->pm.dpm_enabled) {
 			dev_info->max_engine_clock = amdgpu_dpm_get_sclk(adev, false) * 10;
 			dev_info->max_memory_clock = amdgpu_dpm_get_mclk(adev, false) * 10;
+			dev_info->min_engine_clock = amdgpu_dpm_get_sclk(adev, true) * 10;
+			dev_info->min_memory_clock = amdgpu_dpm_get_mclk(adev, true) * 10;
 		} else {
-			dev_info->max_engine_clock = adev->clock.default_sclk * 10;
-			dev_info->max_memory_clock = adev->clock.default_mclk * 10;
+			dev_info->max_engine_clock =
+				dev_info->min_engine_clock =
+					adev->clock.default_sclk * 10;
+			dev_info->max_memory_clock =
+				dev_info->min_memory_clock =
+					adev->clock.default_mclk * 10;
 		}
 		dev_info->enabled_rb_pipes_mask = adev->gfx.config.backend_enable_mask;
 		dev_info->num_rb_pipes = adev->gfx.config.max_backends_per_se *
diff --git a/include/uapi/drm/amdgpu_drm.h b/include/uapi/drm/amdgpu_drm.h
index 038153f2f4cd..ab7895347979 100644
--- a/include/uapi/drm/amdgpu_drm.h
+++ b/include/uapi/drm/amdgpu_drm.h
@@ -1189,6 +1189,8 @@ struct drm_amdgpu_info_device {
 	__u32 pa_sc_tile_steering_override;
 	/* disabled TCCs */
 	__u64 tcc_disabled_mask;
+	__u64 min_engine_clock;
+	__u64 min_memory_clock;
 };
 
 struct drm_amdgpu_info_hw_ip {
-- 
2.34.1


  parent reply	other threads:[~2022-12-09  3:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09  3:48 [PATCH 01/10] drm/amd/pm: enable GPO dynamic control support for SMU13.0.0 Evan Quan
2022-12-09  3:48 ` [PATCH 02/10] drm/amd/pm: enable GPO dynamic control support for SMU13.0.7 Evan Quan
2022-12-09  3:48 ` [PATCH 03/10] drm/amd/pm: correct SMU13.0.0 pstate profiling clock settings Evan Quan
2022-12-09  3:48 ` [PATCH 04/10] drm/amd/pm: drop unused SMU v13 API Evan Quan
2022-12-09  3:48 ` [PATCH 05/10] drm/amd/pm: fulfill swsmu peak profiling mode shader/memory clock settings Evan Quan
2022-12-09  3:48 ` [PATCH 06/10] drm/amd/pm: fulfill powerplay " Evan Quan
2022-12-09  3:48 ` [PATCH 07/10] drm/amdgpu: expose peak profiling mode shader/memory clocks Evan Quan
2022-12-09  3:48 ` Evan Quan [this message]
2022-12-09  3:48 ` [PATCH 09/10] drm/amdgpu: bump minor version number for DEV_INFO and SENSOR IOCTLs update Evan Quan
2022-12-09 21:58   ` Alex Deucher
2022-12-09  3:48 ` [PATCH 10/10] drm/amd/pm: update SMU13.0.0 reported maximum shader clock Evan Quan

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=20221209034813.2373727-8-evan.quan@amd.com \
    --to=evan.quan@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=amd-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