All of lore.kernel.org
 help / color / mirror / Atom feed
From: Darren Powell <darren.powell@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Darren Powell <darren.powell@amd.com>
Subject: [PATCH 6/6] amdgpu/pm: add kernel documentation for smu_get_power_limit
Date: Sun, 6 Jun 2021 01:00:23 -0400	[thread overview]
Message-ID: <20210606050023.4124-7-darren.powell@amd.com> (raw)
In-Reply-To: <20210606050023.4124-1-darren.powell@amd.com>

 added doc tag "amdgpu_pp_power" with description
 added tags for enums  pp_power_limit_level, pp_power_type
 added tag for function smu_get_power_limit

Test:
* Temporary insertion into Documentation/gpu/amdgpu.rst
------------START------------
Power Limit
-----------
.. kernel-doc:: drivers/gpu/drm/amd/include/kgd_pp_interface.h
   :doc: amdgpu_pp_power

.. kernel-doc:: drivers/gpu/drm/amd/include/kgd_pp_interface.h
   :identifiers: pp_power_limit_level

.. kernel-doc:: drivers/gpu/drm/amd/include/kgd_pp_interface.h
   :identifiers: pp_power_type

.. kernel-doc:: drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
   :identifiers: smu_get_power_limit
-------------END-------------

Signed-off-by: Darren Powell <darren.powell@amd.com>
---
 .../gpu/drm/amd/include/kgd_pp_interface.h    | 28 +++++++++++++++++++
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c     | 10 +++++++
 2 files changed, 38 insertions(+)

diff --git a/drivers/gpu/drm/amd/include/kgd_pp_interface.h b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
index 62559723bcb9..9f73a2f586d8 100644
--- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
@@ -194,6 +194,26 @@ enum pp_df_cstate {
 	DF_CSTATE_ALLOW,
 };
 
+/**
+ * DOC: amdgpu_pp_power
+ *
+ * APU power is managed to system-level requirements through the PPT
+ * (package power tracking) feature. PPT is intended to limit power to the
+ * requirements of the power source and could be dynamically updated to
+ * maximize APU performance within the system power budget.
+ *
+ * Two types of power measurement can be requested, where supported, with
+ * :c:type:`enum pp_power_type <pp_power_type>`.
+ */
+
+/**
+ * enum pp_power_limit_level - Used to query the power limits
+ *
+ * @PP_PWR_LIMIT_MIN: Minimum Power Limit
+ * @PP_PWR_LIMIT_CURRENT: Current Power Limit
+ * @PP_PWR_LIMIT_DEFAULT: Default Power Limit
+ * @PP_PWR_LIMIT_MAX: Maximum Power Limit
+ */
 enum pp_power_limit_level
 {
 	PP_PWR_LIMIT_MIN = -1,
@@ -202,6 +222,14 @@ enum pp_power_limit_level
 	PP_PWR_LIMIT_MAX,
 };
 
+/**
+ * enum pp_power_type - Used to specify the type of the requested power
+ *
+ * @PP_PWR_TYPE_SUSTAINED: manages the configurable, thermally significant
+ * moving average of APU power (default ~5000 ms).
+ * @PP_PWR_TYPE_FAST: manages the ~10 ms moving average of APU power,
+ * where supported.
+ */
 enum pp_power_type
 {
 	PP_PWR_TYPE_SUSTAINED,
diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
index c9b921cd48cd..b4ea8b233240 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
@@ -2173,6 +2173,16 @@ static int smu_set_fan_speed_rpm(void *handle, uint32_t speed)
 	return ret;
 }
 
+/**
+ * smu_get_power_limit - Request one of the SMU Power Limits
+ *
+ * @handle: pointer to smu context
+ * @limit: requested limit is written back to this variable
+ * @pp_limit_level: &pp_power_limit_level which limit of the power to return
+ * @pp_power_type: &pp_power_type type of power
+ * Return:  0 on success, <0 on error
+ *
+ */
 int smu_get_power_limit(void *handle,
 			uint32_t *limit,
 			enum pp_power_limit_level pp_limit_level,
-- 
2.31.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2021-06-06  5:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-06  5:00 [PATCH v3 0/6] Modify smu_get_power_limit to implement Powerplay API Darren Powell
2021-06-06  5:00 ` [PATCH 1/6] amdgpu/pm: reorder definition of swsmu_pm_funcs for readability Darren Powell
2021-06-06  5:00 ` [PATCH 2/6] amdgpu/pm: clean up smu_get_power_limit function signature Darren Powell
2021-06-06  5:00 ` [PATCH 3/6] amdgpu/pm: modify Powerplay API get_power_limit to use new pp_power enums Darren Powell
2021-06-06  5:00 ` [PATCH 4/6] amdgpu/pm: modify and add smu_get_power_limit to Powerplay API Darren Powell
2021-06-06  5:00 ` [PATCH 5/6] amdgpu/pm: handle return value for get_power_limit Darren Powell
2021-06-06  5:00 ` Darren Powell [this message]
2021-06-07  9:34 ` [PATCH v3 0/6] Modify smu_get_power_limit to implement Powerplay API Lazar, Lijo
  -- strict thread matches above, loose matches on Subject: below --
2021-05-28 23:06 [PATCH v2 1/6] " Darren Powell
2021-05-28 23:06 ` [PATCH 6/6] amdgpu/pm: add kernel documentation for smu_get_power_limit Darren Powell
2021-06-01  8:12   ` Quan, Evan

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=20210606050023.4124-7-darren.powell@amd.com \
    --to=darren.powell@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.