<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Reviewed-by: Kevin Wang <kevin1.wang@amd.com></span><br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Liang, Prike <Prike.Liang@amd.com><br>
<b>Sent:</b> Monday, September 23, 2019 4:43 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> arron.liu@amd.com <arron.liu@amd.com>; Huang, Ray <Ray.Huang@amd.com>; Liang, Prike <Prike.Liang@amd.com>; Quan, Evan <Evan.Quan@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com><br>
<b>Subject:</b> [PATCH 3/5] drm/amd/powerplay: add interface for getting workload type</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">The workload type was got from the input of power profile mode.<br>
<br>
Signed-off-by: Prike Liang <Prike.Liang@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/renoir_ppt.c | 29 +++++++++++++++++++++++++++++<br>
1 file changed, 29 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c<br>
index 4bb7e1c..f87aa56 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c<br>
@@ -364,6 +364,34 @@ static int renoir_unforce_dpm_levels(struct smu_context *smu) {<br>
return ret;<br>
}<br>
<br>
+static int renoir_get_workload_type(struct smu_context *smu, uint32_t profile)<br>
+{<br>
+<br>
+ uint32_t pplib_workload = 0;<br>
+<br>
+ switch (profile) {<br>
+ case PP_SMC_POWER_PROFILE_FULLSCREEN3D:<br>
+ pplib_workload = WORKLOAD_PPLIB_FULL_SCREEN_3D_BIT;<br>
+ break;<br>
+ case PP_SMC_POWER_PROFILE_CUSTOM:<br>
+ pplib_workload = WORKLOAD_PPLIB_COUNT;<br>
+ break;<br>
+ case PP_SMC_POWER_PROFILE_VIDEO:<br>
+ pplib_workload = WORKLOAD_PPLIB_VIDEO_BIT;<br>
+ break;<br>
+ case PP_SMC_POWER_PROFILE_VR:<br>
+ pplib_workload = WORKLOAD_PPLIB_VR_BIT;<br>
+ break;<br>
+ case PP_SMC_POWER_PROFILE_COMPUTE:<br>
+ pplib_workload = WORKLOAD_PPLIB_COMPUTE_BIT;<br>
+ break;<br>
+ default:<br>
+ return -EINVAL;<br>
+ }<br>
+<br>
+ return pplib_workload;<br>
+}<br>
+<br>
static const struct pptable_funcs renoir_ppt_funcs = {<br>
.get_smu_msg_index = renoir_get_smu_msg_index,<br>
.get_smu_table_index = renoir_get_smu_table_index,<br>
@@ -375,6 +403,7 @@ static const struct pptable_funcs renoir_ppt_funcs = {<br>
.dpm_set_uvd_enable = renoir_dpm_set_uvd_enable,<br>
.force_dpm_limit_value = renoir_force_dpm_limit_value,<br>
.unforce_dpm_levels = renoir_unforce_dpm_levels,<br>
+ .get_workload_type = renoir_get_workload_type,<br>
};<br>
<br>
void renoir_set_ppt_funcs(struct smu_context *smu)<br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></div>
</span></font></div>
</body>
</html>