Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0562d37d authored by Alex Deucher's avatar Alex Deucher Committed by Greg Kroah-Hartman
Browse files

drm/amdgpu/smu10: fix smu10_get_clock_by_type_with_voltage

[ Upstream commit 1064ad4aeef94f51ca230ac639a9e996fb7867a0 ]

Cull out 0 clocks to avoid a warning in DC.

Bug: https://gitlab.freedesktop.org/drm/amd/issues/963


Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent c3e3d17d
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -1080,10 +1080,12 @@ 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;
		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;
}