aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0195-drm-amd-display-Fix-64-bit-division.patch
blob: aff1994d598bee77f8aac9bd32a52f019d916004 (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
From 2f3efa7c7c3f73292fb4a7d46f7b39136fda57cc Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland@amd.com>
Date: Mon, 6 Feb 2017 11:23:20 -0500
Subject: [PATCH 0195/4131] drm/amd/display: Fix 64-bit division

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c
index f4696bf..7005ebb 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_abm.c
@@ -94,7 +94,7 @@ static unsigned int get_current_backlight(struct dce_abm *abm_dce)
 	if (bl_period == 0)
 		bl_period = 0xFFFF;
 
-	current_backlight /= bl_period;
+	current_backlight = div_u64(current_backlight, bl_period);
 	current_backlight = (current_backlight + 1) >> 1;
 
 	current_backlight = (uint64_t)(current_backlight) * bl_period;
-- 
2.7.4