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
6 From: Tomi Valkeinen <tomi.valkeinen@ti.com>
8 commit b201e743f42d143f4bcdcb14587caf7cb1d99229 upstream.
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:
14 "[drm:drm_calc_timestamping_constants [drm]] *ERROR* crtc 32: Can't
15 calculate constants, dotclock = 0!"
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.
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.
25 drm_mode_set_crtcinfo() is removed from the legacy drm_mode_setcrtc() as
26 that is no longer needed.
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>
34 drivers/gpu/drm/drm_crtc.c | 2 --
35 drivers/gpu/drm/drm_modes.c | 2 ++
36 2 files changed, 2 insertions(+), 2 deletions(-)
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 *
44 - drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V);
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)
55 + drm_mode_set_crtcinfo(out, CRTC_INTERLACE_HALVE_V);