From: Yuxian Dai Date: Wed, 15 Apr 2020 11:03:52 +0000 (+0800) Subject: drm/amdgpu/powerplay:avoid to show invalid DPM table info X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5f6a92e442834815736ee8815d99e2c9c658a51b;p=linux.git drm/amdgpu/powerplay:avoid to show invalid DPM table info 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 Signed-off-by: Yuxian Dai Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c index 16ed32f76954f..67476047c067d 100644 --- a/drivers/gpu/drm/amd/powerplay/renoir_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/renoir_ppt.c @@ -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)