aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/1099-drm-amd-display-Skip-create-new-stream-if-crtc-state.patch
blob: 5e60acd0549b605b6cd25cff36ad2594ed897d25 (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
From 283fe4e710c80f650fcdf568109a51255f75f298 Mon Sep 17 00:00:00 2001
From: "Jerry (Fangzhi) Zuo" <Jerry.Zuo@amd.com>
Date: Fri, 11 Jan 2019 16:34:31 -0500
Subject: [PATCH 1099/2940] drm/amd/display: Skip create new stream if crtc
 state doesn't change

Need to check if crtc state is changed so that mode set is
required before trying to create new stream.

It deals with the MST hotplug use case when plug back to the
same connector where the failure to create new stream for the
inactive crtc on the old connector.

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 20cf05adecca..8dff7aee806a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -5539,6 +5539,9 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
                 dm_new_conn_state = to_dm_connector_state(drm_new_conn_state);
                 dm_old_conn_state = to_dm_connector_state(drm_old_conn_state);
 
+                if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
+                        goto skip_modeset;
+
                 new_stream = create_stream_for_sink(aconnector,
                                                      &new_crtc_state->mode,
                                                     dm_new_conn_state,
@@ -5565,6 +5568,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
 		}
 	}
 
+	/* mode_changed flag may get updated above, need to check again */
         if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
                 goto skip_modeset;
 
-- 
2.17.1