aboutsummaryrefslogtreecommitdiffstats
path: root/meta-v1000/recipes-kernel/linux/linux-yocto-4.14.71/0209-drm-amd-display-Set-ignore_msa_timing-flag-for-frees.patch
blob: ece16fbbe8ebb8829246ab7d1422d67bcea47783 (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
From 271192494fb224766a82a6d1801e3fdb453b6ca0 Mon Sep 17 00:00:00 2001
From: Sylvia Tsai <sylvia.tsai@amd.com>
Date: Thu, 9 Feb 2017 16:35:39 -0500
Subject: [PATCH 0209/4131] drm/amd/display: Set ignore_msa_timing flag for
 freesync modes

- Set ignore_msa_timing_param to 1 only for modes that can support freesync

Signed-off-by: Sylvia Tsai <sylvia.tsai@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index 1ee7327..b00b1df 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -262,7 +262,11 @@ bool mod_freesync_add_stream(struct mod_freesync *mod_freesync,
 					enable_for_video = false;
 		}
 
-		if (caps->supported)
+		unsigned int nom_refresh_rate_micro_hz = (unsigned int)
+				(((unsigned long long) core_stream->public.timing.pix_clk_khz) * 1000ULL * 1000ULL * 1000ULL
+				/ core_stream->public.timing.h_total / core_stream->public.timing.v_total);
+
+		if (caps->supported && nom_refresh_rate_micro_hz >= caps->min_refresh_in_micro_hz && nom_refresh_rate_micro_hz <= caps->max_refresh_in_micro_hz)
 			core_stream->public.ignore_msa_timing_param = 1;
 
 		core_freesync->num_entities++;
-- 
2.7.4