]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.6.5/drm-add-missing-drm_mode_set_crtcinfo-call.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.6.5 / drm-add-missing-drm_mode_set_crtcinfo-call.patch
1 From b201e743f42d143f4bcdcb14587caf7cb1d99229 Mon Sep 17 00:00:00 2001
2 From: Tomi Valkeinen <tomi.valkeinen@ti.com>
3 Date: Tue, 31 May 2016 15:03:15 +0300
4 Subject: drm: add missing drm_mode_set_crtcinfo call
5
6 From: Tomi Valkeinen <tomi.valkeinen@ti.com>
7
8 commit b201e743f42d143f4bcdcb14587caf7cb1d99229 upstream.
9
10 When setting mode via MODE_ID property,
11 drm_atomic_set_mode_prop_for_crtc() does not call
12 drm_mode_set_crtcinfo() which possibly causes:
13
14 "[drm:drm_calc_timestamping_constants [drm]] *ERROR* crtc 32: Can't
15 calculate constants, dotclock = 0!"
16
17 Whether the error is seen depends on the previous data in state->mode,
18 as state->mode is not cleared when setting new mode.
19
20 This patch adds drm_mode_set_crtcinfo() call to
21 drm_mode_convert_umode(), which is called in both legacy and atomic
22 paths. This should be fine as there's no reason to call
23 drm_mode_convert_umode() without also setting the crtc related fields.
24
25 drm_mode_set_crtcinfo() is removed from the legacy drm_mode_setcrtc() as
26 that is no longer needed.
27
28 Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
29 Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
30 Signed-off-by: Dave Airlie <airlied@redhat.com>
31 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
32
33 ---
34 drivers/gpu/drm/drm_crtc.c | 2 --
35 drivers/gpu/drm/drm_modes.c | 2 ++
36 2 files changed, 2 insertions(+), 2 deletions(-)
37
38 --- a/drivers/gpu/drm/drm_crtc.c
39 +++ b/drivers/gpu/drm/drm_crtc.c
40 @@ -2800,8 +2800,6 @@ int drm_mode_setcrtc(struct drm_device *
41 goto out;
42 }
43
44 - drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
45 -
46 /*
47 * Check whether the primary plane supports the fb pixel format.
48 * Drivers not implementing the universal planes API use a
49 --- a/drivers/gpu/drm/drm_modes.c
50 +++ b/drivers/gpu/drm/drm_modes.c
51 @@ -1518,6 +1518,8 @@ int drm_mode_convert_umode(struct drm_di
52 if (out->status != MODE_OK)
53 goto out;
54
55 + drm_mode_set_crtcinfo(out, CRTC_INTERLACE_HALVE_V);
56 +
57 ret = 0;
58
59 out: