7d1d291534585b7d1825a96bc2dfe1e7c7e08f31
[openwrt/staging/dedeckeh.git] /
1 From 0f2ca6fedf86f7bb23fd65fe069304811439b318 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime.ripard@bootlin.com>
3 Date: Wed, 19 Jun 2019 12:17:52 +0200
4 Subject: [PATCH 738/782] drm/atomic: Add a function to reset connector TV
5 properties
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Commit 731514b446fe6748d5a55a3dff202efb45c7d8df upstream.
11 Reworked as functions have been moved from drm_atomic_helper.[c|h]
12 to drm_atomic_state_helper.[c|h].
13
14 During the connector reset, if that connector has a TV property, it needs
15 to be reset to the value provided on the command line.
16
17 Provide a helper to do that.
18
19 Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
20 Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
21 Link: https://patchwork.freedesktop.org/patch/msgid/84a7b657f09303a2850e1cc79e68f623547f3fdd.1560783090.git-series.maxime.ripard@bootlin.com
22 ---
23 drivers/gpu/drm/drm_atomic_helper.c | 18 ++++++++++++++++++
24 include/drm/drm_atomic_helper.h | 1 +
25 2 files changed, 19 insertions(+)
26
27 --- a/drivers/gpu/drm/drm_atomic_helper.c
28 +++ b/drivers/gpu/drm/drm_atomic_helper.c
29 @@ -3737,6 +3737,24 @@ void drm_atomic_helper_connector_reset(s
30 EXPORT_SYMBOL(drm_atomic_helper_connector_reset);
31
32 /**
33 + * drm_atomic_helper_connector_tv_reset - Resets TV connector properties
34 + * @connector: DRM connector
35 + *
36 + * Resets the TV-related properties attached to a connector.
37 + */
38 +void drm_atomic_helper_connector_tv_reset(struct drm_connector *connector)
39 +{
40 + struct drm_cmdline_mode *cmdline = &connector->cmdline_mode;
41 + struct drm_connector_state *state = connector->state;
42 +
43 + state->tv.margins.left = cmdline->tv_margins.left;
44 + state->tv.margins.right = cmdline->tv_margins.right;
45 + state->tv.margins.top = cmdline->tv_margins.top;
46 + state->tv.margins.bottom = cmdline->tv_margins.bottom;
47 +}
48 +EXPORT_SYMBOL(drm_atomic_helper_connector_tv_reset);
49 +
50 +/**
51 * __drm_atomic_helper_connector_duplicate_state - copy atomic connector state
52 * @connector: connector object
53 * @state: atomic connector state
54 --- a/include/drm/drm_atomic_helper.h
55 +++ b/include/drm/drm_atomic_helper.h
56 @@ -168,6 +168,7 @@ void drm_atomic_helper_plane_destroy_sta
57 void __drm_atomic_helper_connector_reset(struct drm_connector *connector,
58 struct drm_connector_state *conn_state);
59 void drm_atomic_helper_connector_reset(struct drm_connector *connector);
60 +void drm_atomic_helper_connector_tv_reset(struct drm_connector *connector);
61 void
62 __drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector,
63 struct drm_connector_state *state);