]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.19/drm-amd-display-don-t-re-program-planes-for-dpms-cha.patch
Linux 4.14.111
[thirdparty/kernel/stable-queue.git] / queue-4.19 / drm-amd-display-don-t-re-program-planes-for-dpms-cha.patch
1 From 707f01a9c6e68ee77855a702614d205ffc530791 Mon Sep 17 00:00:00 2001
2 From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
3 Date: Wed, 23 Jan 2019 14:55:58 -0500
4 Subject: drm/amd/display: Don't re-program planes for DPMS changes
5
6 [ Upstream commit 5062b797db4103218fa00ee254417b8ecaab7401 ]
7
8 [Why]
9 There are opt1c lock warnings and CRTC read timeouts when running the
10 "igt@kms_plane@plane-position-hole-dpms-pipe-*" tests. These are
11 caused by trying to reprogram planes that are not in the current
12 context.
13
14 DPMS off removes the stream from the context. In this case:
15
16 new_crtc_state->active_changed = true
17 new_crtc_state->mode_changed = false
18
19 The planes are reprogrammed before the stream is removed from the
20 context because stream_state->mode_changed = false.
21
22 For DPMS adds the stream and planes back to the context:
23
24 new_crtc_state->active_changed = true
25 new_crtc_state->mode_changed = false
26
27 The planes are also reprogrammed here before the stream is added to the
28 context because stream_state->mode_changed = true. They were not
29 previously in the current context so warnings occur here.
30
31 [How]
32 Set stream_state->mode_changed = true when
33 new_crtc_state->active_changed = true too.
34
35 This prevents reprogramming before the context is applied in DC. The
36 programming will be done after the context is applied.
37
38 Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
39 Reviewed-by: Sun peng Li <Sunpeng.Li@amd.com>
40 Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
41 Acked-by: Tony Cheng <Tony.Cheng@amd.com>
42 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
43 Signed-off-by: Sasha Levin <sashal@kernel.org>
44 ---
45 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
46 1 file changed, 2 insertions(+), 1 deletion(-)
47
48 diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
49 index c5ba9128b736..c57e85f08e23 100644
50 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
51 +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
52 @@ -4368,7 +4368,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
53 static void amdgpu_dm_crtc_copy_transient_flags(struct drm_crtc_state *crtc_state,
54 struct dc_stream_state *stream_state)
55 {
56 - stream_state->mode_changed = crtc_state->mode_changed;
57 + stream_state->mode_changed =
58 + crtc_state->mode_changed || crtc_state->active_changed;
59 }
60
61 static int amdgpu_dm_atomic_commit(struct drm_device *dev,
62 --
63 2.19.1
64