drm/amdgpu/smu10: fix smu10_get_clock_by_type_with_voltage
authorAlex Deucher <alexander.deucher@amd.com>
Wed, 29 Jan 2020 17:42:57 +0000 (12:42 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 4 Feb 2020 15:37:52 +0000 (10:37 -0500)
Cull out 0 clocks to avoid a warning in DC.

Bug: https://gitlab.freedesktop.org/drm/amd/issues/963
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c

index 273126cfc37dee475514772e72c00853ba3c7dd0..689072a312a7fb52a015eedf4bd9d53d9720d029 100644 (file)
@@ -1080,9 +1080,11 @@ static int smu10_get_clock_by_type_with_voltage(struct pp_hwmgr *hwmgr,
 
        clocks->num_levels = 0;
        for (i = 0; i < pclk_vol_table->count; i++) {
-               clocks->data[i].clocks_in_khz = pclk_vol_table->entries[i].clk  * 10;
-               clocks->data[i].voltage_in_mv = pclk_vol_table->entries[i].vol;
-               clocks->num_levels++;
+               if (pclk_vol_table->entries[i].clk) {
+                       clocks->data[clocks->num_levels].clocks_in_khz = pclk_vol_table->entries[i].clk  * 10;
+                       clocks->data[clocks->num_levels].voltage_in_mv = pclk_vol_table->entries[i].vol;
+                       clocks->num_levels++;
+               }
        }
 
        return 0;