All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/pp: Fix overflow when setup decf/pix/disp dpm table.
@ 2017-10-18  9:45 Rex Zhu
       [not found] ` <1508319930-2003-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Rex Zhu @ 2017-10-18  9:45 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Rex Zhu

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

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index 500f177..0519338 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -1161,6 +1161,8 @@ static void vega10_setup_default_single_dpm_table(struct pp_hwmgr *hwmgr,
 {
 	int i;
 
+	dpm_table->count = 0;
+
 	for (i = 0; i < dep_table->count; i++) {
 		if (i == 0 || dpm_table->dpm_levels[dpm_table->count - 1].value <=
 				dep_table->entries[i].clk) {
@@ -1269,10 +1271,6 @@ static int vega10_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
 			return -EINVAL);
 
 	/* Initialize Sclk DPM table based on allow Sclk values */
-	data->dpm_table.soc_table.count = 0;
-	data->dpm_table.gfx_table.count = 0;
-	data->dpm_table.dcef_table.count = 0;
-
 	dpm_table = &(data->dpm_table.soc_table);
 	vega10_setup_default_single_dpm_table(hwmgr,
 			dpm_table,
-- 
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] 2+ messages in thread

* Re: [PATCH] drm/amd/pp: Fix overflow when setup decf/pix/disp dpm table.
       [not found] ` <1508319930-2003-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
@ 2017-10-18 21:43   ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2017-10-18 21:43 UTC (permalink / raw)
  To: Rex Zhu; +Cc: amd-gfx list

On Wed, Oct 18, 2017 at 5:45 AM, Rex Zhu <Rex.Zhu@amd.com> wrote:
> Change-Id: I9e72043ea619a86b2bcf14ce9d6386fee107bd19
> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>

Please include a better patch description.  E.g., Clear the count in
the single table setup function to avoid missing any tables.
or something like that.  With that fixed:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index 500f177..0519338 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -1161,6 +1161,8 @@ static void vega10_setup_default_single_dpm_table(struct pp_hwmgr *hwmgr,
>  {
>         int i;
>
> +       dpm_table->count = 0;
> +
>         for (i = 0; i < dep_table->count; i++) {
>                 if (i == 0 || dpm_table->dpm_levels[dpm_table->count - 1].value <=
>                                 dep_table->entries[i].clk) {
> @@ -1269,10 +1271,6 @@ static int vega10_setup_default_dpm_tables(struct pp_hwmgr *hwmgr)
>                         return -EINVAL);
>
>         /* Initialize Sclk DPM table based on allow Sclk values */
> -       data->dpm_table.soc_table.count = 0;
> -       data->dpm_table.gfx_table.count = 0;
> -       data->dpm_table.dcef_table.count = 0;
> -
>         dpm_table = &(data->dpm_table.soc_table);
>         vega10_setup_default_single_dpm_table(hwmgr,
>                         dpm_table,
> --
> 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] 2+ messages in thread

end of thread, other threads:[~2017-10-18 21:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-18  9:45 [PATCH] drm/amd/pp: Fix overflow when setup decf/pix/disp dpm table Rex Zhu
     [not found] ` <1508319930-2003-1-git-send-email-Rex.Zhu-5C7GfCeVMHo@public.gmane.org>
2017-10-18 21:43   ` Alex Deucher

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.