]>
Commit | Line | Data |
---|---|---|
a65d4bac GKH |
1 | From foo@baz Sat Jul 28 10:25:26 CEST 2018 |
2 | From: Satendra Singh Thakur <satendra.t@samsung.com> | |
3 | Date: Thu, 3 May 2018 11:19:32 +0530 | |
4 | Subject: drm/atomic: Handling the case when setting old crtc for plane | |
5 | ||
6 | From: Satendra Singh Thakur <satendra.t@samsung.com> | |
7 | ||
8 | [ Upstream commit fc2a69f3903dfd97cd47f593e642b47918c949df ] | |
9 | ||
10 | In the func drm_atomic_set_crtc_for_plane, with the current code, | |
11 | if crtc of the plane_state and crtc passed as argument to the func | |
12 | are same, entire func will executed in vein. | |
13 | It will get state of crtc and clear and set the bits in plane_mask. | |
14 | All these steps are not required for same old crtc. | |
15 | Ideally, we should do nothing in this case, this patch handles the same, | |
16 | and causes the program to return without doing anything in such scenario. | |
17 | ||
18 | Signed-off-by: Satendra Singh Thakur <satendra.t@samsung.com> | |
19 | Cc: Madhur Verma <madhur.verma@samsung.com> | |
20 | Cc: Hemanshu Srivastava <hemanshu.s@samsung.com> | |
21 | Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> | |
22 | Link: https://patchwork.freedesktop.org/patch/msgid/1525326572-25854-1-git-send-email-satendra.t@samsung.com | |
23 | Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> | |
24 | Signed-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); |