2020-09-17 03:54:23

by Dawning

[permalink] [raw]
Subject: [PATCH v1] powerplay:hwmgr - modify the return value

modify the return value is -EINVAL

Fixes: f83a9991648bb("drm/amd/powerplay: add Vega10 powerplay support (v5)")
Fixes: 2cac05dee6e30("drm/amd/powerplay: add the hw manager for vega12 (v4)")
Cc: Eric Huang <[email protected]>
Cc: Evan Quan <[email protected]>
Signed-off-by: Xiaoliang Pang <[email protected]>
---
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 2 +-
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index c378a000c934..7eada3098ffc 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -4659,7 +4659,7 @@ static int vega10_display_configuration_changed_task(struct pp_hwmgr *hwmgr)
if ((data->water_marks_bitmap & WaterMarksExist) &&
!(data->water_marks_bitmap & WaterMarksLoaded)) {
result = smum_smc_table_manager(hwmgr, (uint8_t *)wm_table, WMTABLE, false);
- PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return EINVAL);
+ PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return -EINVAL);
data->water_marks_bitmap |= WaterMarksLoaded;
}

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
index a678a67f1c0d..04da52cea824 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
@@ -2390,7 +2390,7 @@ static int vega12_display_configuration_changed_task(struct pp_hwmgr *hwmgr)
!(data->water_marks_bitmap & WaterMarksLoaded)) {
result = smum_smc_table_manager(hwmgr,
(uint8_t *)wm_table, TABLE_WATERMARKS, false);
- PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return EINVAL);
+ PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return -EINVAL);
data->water_marks_bitmap |= WaterMarksLoaded;
}

--
2.17.1


2020-09-17 04:28:00

by Evan Quan

[permalink] [raw]
Subject: RE: [PATCH v1] powerplay:hwmgr - modify the return value

[AMD Official Use Only - Internal Distribution Only]

Thanks. Reviewed-by: Evan Quan <[email protected]>

-----Original Message-----
From: Xiaoliang Pang <[email protected]>
Sent: Thursday, September 17, 2020 11:46 AM
To: Quan, Evan <[email protected]>; Deucher, Alexander <[email protected]>; Koenig, Christian <[email protected]>; [email protected]; [email protected]; Feng, Kenneth <[email protected]>; [email protected]; [email protected]; [email protected]
Cc: Das, Nirmoy <[email protected]>; Huang, JinHuiEric <[email protected]>; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH v1] powerplay:hwmgr - modify the return value

modify the return value is -EINVAL

Fixes: f83a9991648bb("drm/amd/powerplay: add Vega10 powerplay support (v5)")
Fixes: 2cac05dee6e30("drm/amd/powerplay: add the hw manager for vega12 (v4)")
Cc: Eric Huang <[email protected]>
Cc: Evan Quan <[email protected]>
Signed-off-by: Xiaoliang Pang <[email protected]>
---
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 2 +-
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index c378a000c934..7eada3098ffc 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -4659,7 +4659,7 @@ static int vega10_display_configuration_changed_task(struct pp_hwmgr *hwmgr)
if ((data->water_marks_bitmap & WaterMarksExist) &&
!(data->water_marks_bitmap & WaterMarksLoaded)) {
result = smum_smc_table_manager(hwmgr, (uint8_t *)wm_table, WMTABLE, false);
-PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return EINVAL);
+PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return -EINVAL);
data->water_marks_bitmap |= WaterMarksLoaded;
}

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
index a678a67f1c0d..04da52cea824 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
@@ -2390,7 +2390,7 @@ static int vega12_display_configuration_changed_task(struct pp_hwmgr *hwmgr)
!(data->water_marks_bitmap & WaterMarksLoaded)) {
result = smum_smc_table_manager(hwmgr,
(uint8_t *)wm_table, TABLE_WATERMARKS, false);
-PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return EINVAL);
+PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return -EINVAL);
data->water_marks_bitmap |= WaterMarksLoaded;
}

--
2.17.1

2020-09-17 08:31:41

by Christian König

[permalink] [raw]
Subject: Re: [PATCH v1] powerplay:hwmgr - modify the return value

Am 17.09.20 um 05:46 schrieb Xiaoliang Pang:
> modify the return value is -EINVAL

Maybe better write something like "The correct return value should be
-EINVAL." With that done feel free to add my acked-by.

Christian.

>
> Fixes: f83a9991648bb("drm/amd/powerplay: add Vega10 powerplay support (v5)")
> Fixes: 2cac05dee6e30("drm/amd/powerplay: add the hw manager for vega12 (v4)")
> Cc: Eric Huang <[email protected]>
> Cc: Evan Quan <[email protected]>
> Signed-off-by: Xiaoliang Pang <[email protected]>
> ---
> drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 2 +-
> drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index c378a000c934..7eada3098ffc 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -4659,7 +4659,7 @@ static int vega10_display_configuration_changed_task(struct pp_hwmgr *hwmgr)
> if ((data->water_marks_bitmap & WaterMarksExist) &&
> !(data->water_marks_bitmap & WaterMarksLoaded)) {
> result = smum_smc_table_manager(hwmgr, (uint8_t *)wm_table, WMTABLE, false);
> - PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return EINVAL);
> + PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return -EINVAL);
> data->water_marks_bitmap |= WaterMarksLoaded;
> }
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> index a678a67f1c0d..04da52cea824 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> @@ -2390,7 +2390,7 @@ static int vega12_display_configuration_changed_task(struct pp_hwmgr *hwmgr)
> !(data->water_marks_bitmap & WaterMarksLoaded)) {
> result = smum_smc_table_manager(hwmgr,
> (uint8_t *)wm_table, TABLE_WATERMARKS, false);
> - PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return EINVAL);
> + PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return -EINVAL);
> data->water_marks_bitmap |= WaterMarksLoaded;
> }
>

2020-09-17 15:49:05

by Alex Deucher

[permalink] [raw]
Subject: Re: [PATCH v1] powerplay:hwmgr - modify the return value

On Thu, Sep 17, 2020 at 4:28 AM Christian König
<[email protected]> wrote:
>
> Am 17.09.20 um 05:46 schrieb Xiaoliang Pang:
> > modify the return value is -EINVAL
>
> Maybe better write something like "The correct return value should be
> -EINVAL." With that done feel free to add my acked-by.

Applied with updated commit message.

Thanks!

Alex


>
> Christian.
>
> >
> > Fixes: f83a9991648bb("drm/amd/powerplay: add Vega10 powerplay support (v5)")
> > Fixes: 2cac05dee6e30("drm/amd/powerplay: add the hw manager for vega12 (v4)")
> > Cc: Eric Huang <[email protected]>
> > Cc: Evan Quan <[email protected]>
> > Signed-off-by: Xiaoliang Pang <[email protected]>
> > ---
> > drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 2 +-
> > drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> > index c378a000c934..7eada3098ffc 100644
> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> > @@ -4659,7 +4659,7 @@ static int vega10_display_configuration_changed_task(struct pp_hwmgr *hwmgr)
> > if ((data->water_marks_bitmap & WaterMarksExist) &&
> > !(data->water_marks_bitmap & WaterMarksLoaded)) {
> > result = smum_smc_table_manager(hwmgr, (uint8_t *)wm_table, WMTABLE, false);
> > - PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return EINVAL);
> > + PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return -EINVAL);
> > data->water_marks_bitmap |= WaterMarksLoaded;
> > }
> >
> > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> > index a678a67f1c0d..04da52cea824 100644
> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c
> > @@ -2390,7 +2390,7 @@ static int vega12_display_configuration_changed_task(struct pp_hwmgr *hwmgr)
> > !(data->water_marks_bitmap & WaterMarksLoaded)) {
> > result = smum_smc_table_manager(hwmgr,
> > (uint8_t *)wm_table, TABLE_WATERMARKS, false);
> > - PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return EINVAL);
> > + PP_ASSERT_WITH_CODE(result, "Failed to update WMTABLE!", return -EINVAL);
> > data->water_marks_bitmap |= WaterMarksLoaded;
> > }
> >
>
> _______________________________________________
> dri-devel mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/dri-devel