aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0283-drm-amd-display-Fixed-bandwidth-calculation-error-wh.patch
blob: e7c41363cc84bd77aa9e7e069a872d5ed30e0763 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
From 34b6b9edb0dbe718c93463c7b397b6e12abb3d85 Mon Sep 17 00:00:00 2001
From: Logatharshan Thothiralingam <logatharshan.thothiralingam@amd.com>
Date: Thu, 9 Mar 2017 11:37:26 -0500
Subject: [PATCH 0283/4131] drm/amd/display: Fixed bandwidth calculation error
 when converting fractions

[Problem]
VSR greyed out

[Root cause]
When converting fractions, we were using the integer function, which let to
a large display clock and the view was not supported

[Solution]
Change the integer to fraction functions

Signed-off-by: Logatharshan Thothiralingam <logatharshan.thothiralingam@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
index c855e49..e477943 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
@@ -796,11 +796,11 @@ static void calculate_bandwidth(
 			}
 			else if (bw_leq(data->vsr[i], bw_int_to_fixed(1))) {
 				data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_int_to_fixed(1);
-			}
-			else if (bw_leq(data->vsr[i], bw_int_to_fixed(4 / 3))) {
+			} else if (bw_leq(data->vsr[i],
+					bw_frc_to_fixed(4, 3))) {
 				data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_div(bw_int_to_fixed(4), bw_int_to_fixed(3));
-			}
-			else if (bw_leq(data->vsr[i], bw_int_to_fixed(6 / 4))) {
+			} else if (bw_leq(data->vsr[i],
+					bw_frc_to_fixed(6, 4))) {
 				data->lb_lines_in_per_line_out_in_middle_of_frame[i] = bw_div(bw_int_to_fixed(6), bw_int_to_fixed(4));
 			}
 			else if (bw_leq(data->vsr[i], bw_int_to_fixed(2))) {
-- 
2.7.4