Skip to content

Commit 8b95f4f

Browse files
Rex Zhualexdeucher
authored andcommitted
drm/amd/powerplay: fix uninitialized variable
refresh_rate was not initialized when program display gap. this patch can fix vce ring test failed when do S3 on Polaris10. bug: https://bugs.freedesktop.org/show_bug.cgi?id=103102 bug: https://bugzilla.kernel.org/show_bug.cgi?id=196615 Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent 2cb3a34 commit 8b95f4f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ uint32_t smu7_get_xclk(struct pp_hwmgr *hwmgr)
830830
{
831831
uint32_t reference_clock, tmp;
832832
struct cgs_display_info info = {0};
833-
struct cgs_mode_info mode_info;
833+
struct cgs_mode_info mode_info = {0};
834834

835835
info.mode_info = &mode_info;
836836

@@ -3948,10 +3948,9 @@ static int smu7_program_display_gap(struct pp_hwmgr *hwmgr)
39483948
uint32_t ref_clock;
39493949
uint32_t refresh_rate = 0;
39503950
struct cgs_display_info info = {0};
3951-
struct cgs_mode_info mode_info;
3951+
struct cgs_mode_info mode_info = {0};
39523952

39533953
info.mode_info = &mode_info;
3954-
39553954
cgs_get_active_displays_info(hwmgr->device, &info);
39563955
num_active_displays = info.display_count;
39573956

@@ -3967,6 +3966,7 @@ static int smu7_program_display_gap(struct pp_hwmgr *hwmgr)
39673966
frame_time_in_us = 1000000 / refresh_rate;
39683967

39693968
pre_vbi_time_in_us = frame_time_in_us - 200 - mode_info.vblank_time_us;
3969+
39703970
data->frame_time_x2 = frame_time_in_us * 2 / 100;
39713971

39723972
display_gap2 = pre_vbi_time_in_us * (ref_clock / 100);

0 commit comments

Comments
 (0)