The .syspll_id and .dfsdid are not initialzed correctly. And
le32_to_cpu transfer is needed on the output.

Signed-off-by: Evan Quan <[email protected]>

Change-Id: I491e70b276554f38e1a296970892347474814e75
---
 drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c 
b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c
index 60d591e..f9b5815c 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/ppatomfwctrl.c
@@ -496,7 +496,9 @@ int pp_atomfwctrl__get_clk_information_by_clkid(struct 
pp_hwmgr *hwmgr, BIOS_CLK
        uint32_t ix;
 
        parameters.clk_id = id;
+       parameters.syspll_id = 0;
        parameters.command = GET_SMU_CLOCK_INFO_V3_1_GET_CLOCK_FREQ;
+       parameters.dfsdid = 0;
 
        ix = GetIndexIntoMasterCmdTable(getsmuclockinfo);
 
@@ -505,7 +507,7 @@ int pp_atomfwctrl__get_clk_information_by_clkid(struct 
pp_hwmgr *hwmgr, BIOS_CLK
                return -EINVAL;
 
        output = (struct atom_get_smu_clock_info_output_parameters_v3_1 
*)&parameters;
-       *frequency = output->atom_smu_outputclkfreq.smu_clock_freq_hz / 10000;
+       *frequency = 
le32_to_cpu(output->atom_smu_outputclkfreq.smu_clock_freq_hz) / 10000;
 
        return 0;
 }
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to