OSDN Git Service

drm/amdgpu/powerplay:avoid to show invalid DPM table info
authorYuxian Dai <Yuxian.Dai@amd.com>
Wed, 15 Apr 2020 11:03:52 +0000 (19:03 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 22 Apr 2020 22:11:49 +0000 (18:11 -0400)
for different ASIC support different the number of DPM levels,
we should avoid to show the invalid level value.
v1 -> v2:
follow the suggestion,clarifiy the description for this
change

Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Yuxian Dai <Yuxian.Dai@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/renoir_ppt.c

index 16ed32f..6747604 100644 (file)
@@ -296,6 +296,8 @@ static int renoir_print_clk_levels(struct smu_context *smu,
 
        for (i = 0; i < count; i++) {
                GET_DPM_CUR_FREQ(clk_table, clk_type, i, value);
+               if (!value)
+                       continue;
                size += sprintf(buf + size, "%d: %uMhz %s\n", i, value,
                                cur_value == value ? "*" : "");
                if (cur_value == value)