[PATCH] drm/amd/pp: Fix logic error in smu7_check_dpm_table_updated
Alex Deucher
alexdeucher at gmail.com
Wed Apr 11 17:29:38 UTC 2018
On Wed, Apr 11, 2018 at 8:00 AM, Rex Zhu <Rex.Zhu at amd.com> wrote:
> Signed-off-by: Rex Zhu <Rex.Zhu at amd.com>
Is this really worth it? It just saves a few cycles, but I'm worried
if we ever extend or rewrite the function we may miss later updates.
At the very least, I'd add a comment saying something like "return as
soon as we know the VDDC has changed, no need to check for additional
VDDC changes"
Alex
> ---
> drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> index 68b9e0b..31d271f 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> @@ -4684,7 +4684,7 @@ static void smu7_check_dpm_table_updated(struct pp_hwmgr *hwmgr)
> for (i=0; i < dep_table->count; i++) {
> if (dep_table->entries[i].vddc != odn_dep_table->entries[i].vddc) {
> data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_VDDC;
> - break;
> + return;
> }
> }
> if (i == dep_table->count)
> @@ -4695,7 +4695,7 @@ static void smu7_check_dpm_table_updated(struct pp_hwmgr *hwmgr)
> for (i=0; i < dep_table->count; i++) {
> if (dep_table->entries[i].vddc != odn_dep_table->entries[i].vddc) {
> data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_VDDC;
> - break;
> + return;
> }
> }
> if (i == dep_table->count)
> --
> 1.9.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
More information about the amd-gfx
mailing list