]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/drm-amd-display-clear-stream-mode_changed-after-comm.patch
47acecee79fae80189a34b8756c5f0982d79a2ad
[thirdparty/kernel/stable-queue.git] / queue-4.19 / drm-amd-display-clear-stream-mode_changed-after-comm.patch
1 From 7b4400392eaadd91bcbe4c3aa48690f48072f50d Mon Sep 17 00:00:00 2001
2 From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
3 Date: Fri, 25 Jan 2019 15:23:09 -0500
4 Subject: drm/amd/display: Clear stream->mode_changed after commit
5
6 [ Upstream commit d8d2f174bcc2c26c3485c70e0c6fe22b27bce739 ]
7
8 [Why]
9 The stream->mode_changed flag can persist in the following sequence
10 of atomic commits:
11
12 Commit 1:
13 Enable CRTC0 (mode_changed = true), Enable CRTC1 (mode_changed = true)
14
15 Commit 2:
16 Disable CRTC1 (mode_changed = false)
17
18 In this sequence we want to keep the exiting CRTC0 but it's not in the
19 atomic state for the commit since it hasn't been modified. In this case
20 the stream->mode_changed flag persists as true and we don't re-program
21 the planes for the existing stream.
22
23 [How]
24 The flag needs to be cleared and it makes the most sense to do it within
25 DC after the state has been committed. Nothing following dc_commit_state
26 should think that the stream's mode has changed.
27
28 Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
29 Reviewed-by: Leo Li <sunpeng.li@amd.com>
30 Acked-by: Tony Cheng <Tony.Cheng@amd.com>
31 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
32 Signed-off-by: Sasha Levin <sashal@kernel.org>
33 ---
34 drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++
35 1 file changed, 3 insertions(+)
36
37 diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
38 index 9045e6fa0780..bb0cda727605 100644
39 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c
40 +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
41 @@ -958,6 +958,9 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c
42 /* pplib is notified if disp_num changed */
43 dc->hwss.set_bandwidth(dc, context, true);
44
45 + for (i = 0; i < context->stream_count; i++)
46 + context->streams[i]->mode_changed = false;
47 +
48 dc_release_state(dc->current_state);
49
50 dc->current_state = context;
51 --
52 2.19.1
53