diff options
| author | Rex Zhu <Rex.Zhu@amd.com> | 2017-10-20 03:07:41 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2017-10-21 17:26:10 -0400 |
| commit | 8b95f4f730cba02ef6febbdc4ca7e55ca045b00e (patch) | |
| tree | 5628fb8b21c6292b994f3e534b486432979cd103 | |
| parent | 2cb3a34abd035756f9ba3cde12f44f4b3e4c234b (diff) | |
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
| -rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c index c2743233ba10..b526f49be65d 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | |||
| @@ -830,7 +830,7 @@ uint32_t smu7_get_xclk(struct pp_hwmgr *hwmgr) | |||
| 830 | { | 830 | { |
| 831 | uint32_t reference_clock, tmp; | 831 | uint32_t reference_clock, tmp; |
| 832 | struct cgs_display_info info = {0}; | 832 | struct cgs_display_info info = {0}; |
| 833 | struct cgs_mode_info mode_info; | 833 | struct cgs_mode_info mode_info = {0}; |
| 834 | 834 | ||
| 835 | info.mode_info = &mode_info; | 835 | info.mode_info = &mode_info; |
| 836 | 836 | ||
| @@ -3948,10 +3948,9 @@ static int smu7_program_display_gap(struct pp_hwmgr *hwmgr) | |||
| 3948 | uint32_t ref_clock; | 3948 | uint32_t ref_clock; |
| 3949 | uint32_t refresh_rate = 0; | 3949 | uint32_t refresh_rate = 0; |
| 3950 | struct cgs_display_info info = {0}; | 3950 | struct cgs_display_info info = {0}; |
| 3951 | struct cgs_mode_info mode_info; | 3951 | struct cgs_mode_info mode_info = {0}; |
| 3952 | 3952 | ||
| 3953 | info.mode_info = &mode_info; | 3953 | info.mode_info = &mode_info; |
| 3954 | |||
| 3955 | cgs_get_active_displays_info(hwmgr->device, &info); | 3954 | cgs_get_active_displays_info(hwmgr->device, &info); |
| 3956 | num_active_displays = info.display_count; | 3955 | num_active_displays = info.display_count; |
| 3957 | 3956 | ||
| @@ -3967,6 +3966,7 @@ static int smu7_program_display_gap(struct pp_hwmgr *hwmgr) | |||
| 3967 | frame_time_in_us = 1000000 / refresh_rate; | 3966 | frame_time_in_us = 1000000 / refresh_rate; |
| 3968 | 3967 | ||
| 3969 | pre_vbi_time_in_us = frame_time_in_us - 200 - mode_info.vblank_time_us; | 3968 | pre_vbi_time_in_us = frame_time_in_us - 200 - mode_info.vblank_time_us; |
| 3969 | |||
| 3970 | data->frame_time_x2 = frame_time_in_us * 2 / 100; | 3970 | data->frame_time_x2 = frame_time_in_us * 2 / 100; |
| 3971 | 3971 | ||
| 3972 | display_gap2 = pre_vbi_time_in_us * (ref_clock / 100); | 3972 | display_gap2 = pre_vbi_time_in_us * (ref_clock / 100); |
