All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhu, Rex" <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
To: "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Cc: "StDenis, Tom" <Tom.StDenis-5C7GfCeVMHo@public.gmane.org>
Subject: RE: [PATCH] drm/amd/powerplay:  Fix psm_set_user_performance_state()
Date: Wed, 6 Sep 2017 01:08:17 +0000	[thread overview]
Message-ID: <CY4PR12MB1687CD19E0BD73F47E843765FB970@CY4PR12MB1687.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20170905120320.11261-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>

Thanks Tom.

Patch is Reviewed-By: Rex Zhu <Rex.Zhu@amd.com>


Best Regards
Rex
-----Original Message-----
From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf Of Tom St Denis
Sent: Tuesday, September 05, 2017 8:03 PM
To: amd-gfx@lists.freedesktop.org
Cc: StDenis, Tom
Subject: [PATCH] drm/amd/powerplay: Fix psm_set_user_performance_state()

We now pass a pointer to a pointer which seems to be what they meant in the first place.  The previous version was modifying a pointer passed by value.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c  | 4 ++--  drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c | 8 ++++----  drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.h | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
index 19b6f1148942..d1960c14dd4a 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
@@ -294,7 +294,7 @@ int hwmgr_handle_task(struct pp_instance *handle, enum amd_pp_task task_id,
 	{
 		enum amd_pm_state_type ps;
 		enum PP_StateUILabel requested_ui_label;
-		struct pp_power_state *requested_ps;
+		struct pp_power_state *requested_ps = NULL;
 
 		if (input == NULL) {
 			ret = -EINVAL;
@@ -303,7 +303,7 @@ int hwmgr_handle_task(struct pp_instance *handle, enum amd_pp_task task_id,
 		ps = *(unsigned long *)input;
 
 		requested_ui_label = power_state_convert(ps);
-		ret = psm_set_user_performance_state(hwmgr, requested_ui_label, requested_ps);
+		ret = psm_set_user_performance_state(hwmgr, requested_ui_label, 
+&requested_ps);
 		if (ret)
 			return ret;
 		ret = psm_adjust_power_state_dynamic(hwmgr, false, requested_ps); diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c
index 7656324957a8..167cdc321db2 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c
@@ -188,19 +188,19 @@ int psm_set_performance_states(struct pp_hwmgr *hwmgr)
 
 int psm_set_user_performance_state(struct pp_hwmgr *hwmgr,
 					enum PP_StateUILabel label_id,
-					struct pp_power_state *state)
+					struct pp_power_state **state)
 {
 	int table_entries;
 	int i;
 
 	table_entries = hwmgr->num_ps;
-	state = hwmgr->ps;
+	*state = hwmgr->ps;
 
 restart_search:
 	for (i = 0; i < table_entries; i++) {
-		if (state->classification.ui_label & label_id)
+		if ((*state)->classification.ui_label & label_id)
 			return 0;
-		state = (struct pp_power_state *)((unsigned long)state + hwmgr->ps_size);
+		*state = (struct pp_power_state *)((uintptr_t)*state + 
+hwmgr->ps_size);
 	}
 
 	switch (label_id) {
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.h b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.h
index aa44e60ec1b6..fa1b6825036a 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.h
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.h
@@ -32,7 +32,7 @@ int psm_set_boot_states(struct pp_hwmgr *hwmgr);  int psm_set_performance_states(struct pp_hwmgr *hwmgr);  int psm_set_user_performance_state(struct pp_hwmgr *hwmgr,
 					enum PP_StateUILabel label_id,
-					struct pp_power_state *state);
+					struct pp_power_state **state);
 int psm_adjust_power_state_dynamic(struct pp_hwmgr *hwmgr,
 				bool skip,
 				struct pp_power_state *new_ps);
--
2.12.0

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

      parent reply	other threads:[~2017-09-06  1:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 12:03 [PATCH] drm/amd/powerplay: Fix psm_set_user_performance_state() Tom St Denis
     [not found] ` <20170905120320.11261-1-tom.stdenis-5C7GfCeVMHo@public.gmane.org>
2017-09-06  1:08   ` Zhu, Rex [this message]

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=CY4PR12MB1687CD19E0BD73F47E843765FB970@CY4PR12MB1687.namprd12.prod.outlook.com \
    --to=rex.zhu-5c7gfcevmho@public.gmane.org \
    --cc=Tom.StDenis-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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.