All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pp: Cleaning up vega10_enable_dpm_tasks function
@ 2018-02-23  5:22 Rex Zhu
       [not found] ` <1519363344-30863-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Rex Zhu @ 2018-02-23  5:22 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Rex Zhu

1. move display num initialize out of dpm enable tasks.
2. do not set/restore smc telemetry if dpm is runing.

Change-Id: I63431b169bb077fa60cca02f0db7038af1ba1601
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index b13f55d..9b0fcb6 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -928,6 +928,8 @@ static int vega10_setup_asic_task(struct pp_hwmgr *hwmgr)
 			"Failed to set up led dpm config!",
 			return -EINVAL);
 
+	smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_NumOfDisplays, 0);
+
 	return 0;
 }
 
@@ -2857,12 +2859,6 @@ static int vega10_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
 			(struct vega10_hwmgr *)(hwmgr->backend);
 	int tmp_result, result = 0;
 
-	smum_send_msg_to_smc_with_parameter(hwmgr,
-		PPSMC_MSG_ConfigureTelemetry, data->config_telemetry);
-
-	smum_send_msg_to_smc_with_parameter(hwmgr,
-			PPSMC_MSG_NumOfDisplays, 0);
-
 	tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
 	PP_ASSERT_WITH_CODE(!tmp_result,
 			"DPM is already running right , skipping re-enablement!",
@@ -2873,6 +2869,9 @@ static int vega10_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
 		smum_send_msg_to_smc_with_parameter(hwmgr,
 				PPSMC_MSG_UpdatePkgPwrPidAlpha, 1);
 
+	smum_send_msg_to_smc_with_parameter(hwmgr,
+		PPSMC_MSG_ConfigureTelemetry, data->config_telemetry);
+
 	tmp_result = vega10_construct_voltage_tables(hwmgr);
 	PP_ASSERT_WITH_CODE(!tmp_result,
 			"Failed to contruct voltage tables!",
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amd/pp: Cleaning up vega10_enable_dpm_tasks function
       [not found] ` <1519363344-30863-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
@ 2018-02-23  5:47   ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2018-02-23  5:47 UTC (permalink / raw)
  To: Rex Zhu; +Cc: amd-gfx list

On Fri, Feb 23, 2018 at 12:22 AM, Rex Zhu <Rex.Zhu@amd.com> wrote:
> 1. move display num initialize out of dpm enable tasks.
> 2. do not set/restore smc telemetry if dpm is runing.
>
> Change-Id: I63431b169bb077fa60cca02f0db7038af1ba1601
> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index b13f55d..9b0fcb6 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -928,6 +928,8 @@ static int vega10_setup_asic_task(struct pp_hwmgr *hwmgr)
>                         "Failed to set up led dpm config!",
>                         return -EINVAL);
>
> +       smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_NumOfDisplays, 0);
> +
>         return 0;
>  }
>
> @@ -2857,12 +2859,6 @@ static int vega10_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
>                         (struct vega10_hwmgr *)(hwmgr->backend);
>         int tmp_result, result = 0;
>
> -       smum_send_msg_to_smc_with_parameter(hwmgr,
> -               PPSMC_MSG_ConfigureTelemetry, data->config_telemetry);
> -
> -       smum_send_msg_to_smc_with_parameter(hwmgr,
> -                       PPSMC_MSG_NumOfDisplays, 0);
> -
>         tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
>         PP_ASSERT_WITH_CODE(!tmp_result,
>                         "DPM is already running right , skipping re-enablement!",
> @@ -2873,6 +2869,9 @@ static int vega10_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
>                 smum_send_msg_to_smc_with_parameter(hwmgr,
>                                 PPSMC_MSG_UpdatePkgPwrPidAlpha, 1);
>
> +       smum_send_msg_to_smc_with_parameter(hwmgr,
> +               PPSMC_MSG_ConfigureTelemetry, data->config_telemetry);
> +
>         tmp_result = vega10_construct_voltage_tables(hwmgr);
>         PP_ASSERT_WITH_CODE(!tmp_result,
>                         "Failed to contruct voltage tables!",
> --
> 1.9.1
>
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amd/pp: Cleaning up vega10_enable_dpm_tasks function
       [not found]     ` <CADnq5_PHqqQcjf+2qEiLUDVDU8s8GHW09q4YtP-Q3kpwM4mbgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-02-23  5:43       ` Zhu, Rex
  0 siblings, 0 replies; 5+ messages in thread
From: Zhu, Rex @ 2018-02-23  5:43 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx list


[-- Attachment #1.1: Type: text/plain, Size: 4147 bytes --]

>I don't think backend_init actually touches the hw anywhere else.
>Seems like it might be better to move this to setup_asic_task for
>consistency.


Thanks Alex, you are right. the change for telemetry will cause telemetry setting not restore after s3/s4 resume back.


Best Regards

Rex

________________________________
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Sent: Friday, February 23, 2018 1:01 PM
To: Zhu, Rex
Cc: amd-gfx list
Subject: Re: [PATCH] drm/amd/pp: Cleaning up vega10_enable_dpm_tasks function

On Thu, Feb 22, 2018 at 11:21 PM, Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org> wrote:
> move out functions that unrelated to enable dpm task.
>
> Change-Id: I93416e0eea82325040557a64af2b82a38d8c32ce
> Signed-off-by: Rex Zhu <Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 14 +++++---------
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h |  1 -
>  2 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index b13f55d..c6cc6b2 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -811,7 +811,8 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
>                         data->vddci_control = VEGA10_VOLTAGE_CONTROL_BY_GPIO;
>         }
>
> -       data->config_telemetry = config_telemetry;
> +       smum_send_msg_to_smc_with_parameter(hwmgr,
> +               PPSMC_MSG_ConfigureTelemetry, config_telemetry);

I don't think backend_init actually touches the hw anywhere else.
Seems like it might be better to move this to setup_asic_task for
consistency.

Alex

>
>         vega10_set_features_platform_caps(hwmgr);
>
> @@ -928,6 +929,9 @@ static int vega10_setup_asic_task(struct pp_hwmgr *hwmgr)
>                         "Failed to set up led dpm config!",
>                         return -EINVAL);
>
> +       smum_send_msg_to_smc_with_parameter(hwmgr,
> +                       PPSMC_MSG_NumOfDisplays, 0);
> +
>         return 0;
>  }
>
> @@ -2853,16 +2857,8 @@ static int vega10_start_dpm(struct pp_hwmgr *hwmgr, uint32_t bitmap)
>
>  static int vega10_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
>  {
> -       struct vega10_hwmgr *data =
> -                       (struct vega10_hwmgr *)(hwmgr->backend);
>         int tmp_result, result = 0;
>
> -       smum_send_msg_to_smc_with_parameter(hwmgr,
> -               PPSMC_MSG_ConfigureTelemetry, data->config_telemetry);
> -
> -       smum_send_msg_to_smc_with_parameter(hwmgr,
> -                       PPSMC_MSG_NumOfDisplays, 0);
> -
>         tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
>         PP_ASSERT_WITH_CODE(!tmp_result,
>                         "DPM is already running right , skipping re-enablement!",
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h
> index ab3e879..df7999d 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h
> @@ -380,7 +380,6 @@ struct vega10_hwmgr {
>         struct smu_features            smu_features[GNLD_FEATURES_MAX];
>         struct vega10_smc_state_table  smc_state_table;
>
> -       uint32_t                       config_telemetry;
>         uint32_t                       acg_loop_state;
>         uint32_t                       mem_channels;
>         uint8_t                       custom_profile_mode[4];
> --
> 1.9.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
Subscribing to amd-gfx: Subscribe to amd-gfx by filling out the following form. Use of all freedesktop.org lists is subject to our Code of ...



[-- Attachment #1.2: Type: text/html, Size: 10220 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amd/pp: Cleaning up vega10_enable_dpm_tasks function
       [not found] ` <1519359682-28335-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
@ 2018-02-23  5:01   ` Alex Deucher
       [not found]     ` <CADnq5_PHqqQcjf+2qEiLUDVDU8s8GHW09q4YtP-Q3kpwM4mbgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2018-02-23  5:01 UTC (permalink / raw)
  To: Rex Zhu; +Cc: amd-gfx list

On Thu, Feb 22, 2018 at 11:21 PM, Rex Zhu <Rex.Zhu@amd.com> wrote:
> move out functions that unrelated to enable dpm task.
>
> Change-Id: I93416e0eea82325040557a64af2b82a38d8c32ce
> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 14 +++++---------
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h |  1 -
>  2 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index b13f55d..c6cc6b2 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -811,7 +811,8 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
>                         data->vddci_control = VEGA10_VOLTAGE_CONTROL_BY_GPIO;
>         }
>
> -       data->config_telemetry = config_telemetry;
> +       smum_send_msg_to_smc_with_parameter(hwmgr,
> +               PPSMC_MSG_ConfigureTelemetry, config_telemetry);

I don't think backend_init actually touches the hw anywhere else.
Seems like it might be better to move this to setup_asic_task for
consistency.

Alex

>
>         vega10_set_features_platform_caps(hwmgr);
>
> @@ -928,6 +929,9 @@ static int vega10_setup_asic_task(struct pp_hwmgr *hwmgr)
>                         "Failed to set up led dpm config!",
>                         return -EINVAL);
>
> +       smum_send_msg_to_smc_with_parameter(hwmgr,
> +                       PPSMC_MSG_NumOfDisplays, 0);
> +
>         return 0;
>  }
>
> @@ -2853,16 +2857,8 @@ static int vega10_start_dpm(struct pp_hwmgr *hwmgr, uint32_t bitmap)
>
>  static int vega10_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
>  {
> -       struct vega10_hwmgr *data =
> -                       (struct vega10_hwmgr *)(hwmgr->backend);
>         int tmp_result, result = 0;
>
> -       smum_send_msg_to_smc_with_parameter(hwmgr,
> -               PPSMC_MSG_ConfigureTelemetry, data->config_telemetry);
> -
> -       smum_send_msg_to_smc_with_parameter(hwmgr,
> -                       PPSMC_MSG_NumOfDisplays, 0);
> -
>         tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
>         PP_ASSERT_WITH_CODE(!tmp_result,
>                         "DPM is already running right , skipping re-enablement!",
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h
> index ab3e879..df7999d 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h
> @@ -380,7 +380,6 @@ struct vega10_hwmgr {
>         struct smu_features            smu_features[GNLD_FEATURES_MAX];
>         struct vega10_smc_state_table  smc_state_table;
>
> -       uint32_t                       config_telemetry;
>         uint32_t                       acg_loop_state;
>         uint32_t                       mem_channels;
>         uint8_t                       custom_profile_mode[4];
> --
> 1.9.1
>
> _______________________________________________
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] drm/amd/pp: Cleaning up vega10_enable_dpm_tasks function
@ 2018-02-23  4:21 Rex Zhu
       [not found] ` <1519359682-28335-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Rex Zhu @ 2018-02-23  4:21 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Rex Zhu

move out functions that unrelated to enable dpm task.

Change-Id: I93416e0eea82325040557a64af2b82a38d8c32ce
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 14 +++++---------
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h |  1 -
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index b13f55d..c6cc6b2 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -811,7 +811,8 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
 			data->vddci_control = VEGA10_VOLTAGE_CONTROL_BY_GPIO;
 	}
 
-	data->config_telemetry = config_telemetry;
+	smum_send_msg_to_smc_with_parameter(hwmgr,
+		PPSMC_MSG_ConfigureTelemetry, config_telemetry);
 
 	vega10_set_features_platform_caps(hwmgr);
 
@@ -928,6 +929,9 @@ static int vega10_setup_asic_task(struct pp_hwmgr *hwmgr)
 			"Failed to set up led dpm config!",
 			return -EINVAL);
 
+	smum_send_msg_to_smc_with_parameter(hwmgr,
+			PPSMC_MSG_NumOfDisplays, 0);
+
 	return 0;
 }
 
@@ -2853,16 +2857,8 @@ static int vega10_start_dpm(struct pp_hwmgr *hwmgr, uint32_t bitmap)
 
 static int vega10_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
 {
-	struct vega10_hwmgr *data =
-			(struct vega10_hwmgr *)(hwmgr->backend);
 	int tmp_result, result = 0;
 
-	smum_send_msg_to_smc_with_parameter(hwmgr,
-		PPSMC_MSG_ConfigureTelemetry, data->config_telemetry);
-
-	smum_send_msg_to_smc_with_parameter(hwmgr,
-			PPSMC_MSG_NumOfDisplays, 0);
-
 	tmp_result = (!smum_is_dpm_running(hwmgr)) ? 0 : -1;
 	PP_ASSERT_WITH_CODE(!tmp_result,
 			"DPM is already running right , skipping re-enablement!",
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h
index ab3e879..df7999d 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.h
@@ -380,7 +380,6 @@ struct vega10_hwmgr {
 	struct smu_features            smu_features[GNLD_FEATURES_MAX];
 	struct vega10_smc_state_table  smc_state_table;
 
-	uint32_t                       config_telemetry;
 	uint32_t                       acg_loop_state;
 	uint32_t                       mem_channels;
 	uint8_t                       custom_profile_mode[4];
-- 
1.9.1

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-23  5:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-23  5:22 [PATCH] drm/amd/pp: Cleaning up vega10_enable_dpm_tasks function Rex Zhu
     [not found] ` <1519363344-30863-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-02-23  5:47   ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2018-02-23  4:21 Rex Zhu
     [not found] ` <1519359682-28335-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2018-02-23  5:01   ` Alex Deucher
     [not found]     ` <CADnq5_PHqqQcjf+2qEiLUDVDU8s8GHW09q4YtP-Q3kpwM4mbgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-02-23  5:43       ` Zhu, Rex

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.