]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.14.60/drm-atomic-handling-the-case-when-setting-old-crtc-for-plane.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / releases / 4.14.60 / drm-atomic-handling-the-case-when-setting-old-crtc-for-plane.patch
CommitLineData
a65d4bac
GKH
1From foo@baz Sat Jul 28 10:25:26 CEST 2018
2From: Satendra Singh Thakur <satendra.t@samsung.com>
3Date: Thu, 3 May 2018 11:19:32 +0530
4Subject: drm/atomic: Handling the case when setting old crtc for plane
5
6From: Satendra Singh Thakur <satendra.t@samsung.com>
7
8[ Upstream commit fc2a69f3903dfd97cd47f593e642b47918c949df ]
9
10In the func drm_atomic_set_crtc_for_plane, with the current code,
11if crtc of the plane_state and crtc passed as argument to the func
12are same, entire func will executed in vein.
13It will get state of crtc and clear and set the bits in plane_mask.
14All these steps are not required for same old crtc.
15Ideally, we should do nothing in this case, this patch handles the same,
16and causes the program to return without doing anything in such scenario.
17
18Signed-off-by: Satendra Singh Thakur <satendra.t@samsung.com>
19Cc: Madhur Verma <madhur.verma@samsung.com>
20Cc: Hemanshu Srivastava <hemanshu.s@samsung.com>
21Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
22Link: https://patchwork.freedesktop.org/patch/msgid/1525326572-25854-1-git-send-email-satendra.t@samsung.com
23Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25---
26 drivers/gpu/drm/drm_atomic.c | 4 +++-
27 1 file changed, 3 insertions(+), 1 deletion(-)
28
29--- a/drivers/gpu/drm/drm_atomic.c
30+++ b/drivers/gpu/drm/drm_atomic.c
31@@ -1355,7 +1355,9 @@ drm_atomic_set_crtc_for_plane(struct drm
32 {
33 struct drm_plane *plane = plane_state->plane;
34 struct drm_crtc_state *crtc_state;
35-
36+ /* Nothing to do for same crtc*/
37+ if (plane_state->crtc == crtc)
38+ return 0;
39 if (plane_state->crtc) {
40 crtc_state = drm_atomic_get_crtc_state(plane_state->state,
41 plane_state->crtc);