Commit 731514b4 authored by Maxime Ripard's avatar Maxime Ripard

drm/atomic: Add a function to reset connector TV properties

During the connector reset, if that connector has a TV property, it needs
to be reset to the value provided on the command line.

Provide a helper to do that.
Reviewed-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/84a7b657f09303a2850e1cc79e68f623547f3fdd.1560783090.git-series.maxime.ripard@bootlin.com
parent 3d46a300
...@@ -379,6 +379,24 @@ void drm_atomic_helper_connector_reset(struct drm_connector *connector) ...@@ -379,6 +379,24 @@ void drm_atomic_helper_connector_reset(struct drm_connector *connector)
} }
EXPORT_SYMBOL(drm_atomic_helper_connector_reset); EXPORT_SYMBOL(drm_atomic_helper_connector_reset);
/**
* drm_atomic_helper_connector_tv_reset - Resets TV connector properties
* @connector: DRM connector
*
* Resets the TV-related properties attached to a connector.
*/
void drm_atomic_helper_connector_tv_reset(struct drm_connector *connector)
{
struct drm_cmdline_mode *cmdline = &connector->cmdline_mode;
struct drm_connector_state *state = connector->state;
state->tv.margins.left = cmdline->tv_margins.left;
state->tv.margins.right = cmdline->tv_margins.right;
state->tv.margins.top = cmdline->tv_margins.top;
state->tv.margins.bottom = cmdline->tv_margins.bottom;
}
EXPORT_SYMBOL(drm_atomic_helper_connector_tv_reset);
/** /**
* __drm_atomic_helper_connector_duplicate_state - copy atomic connector state * __drm_atomic_helper_connector_duplicate_state - copy atomic connector state
* @connector: connector object * @connector: connector object
......
...@@ -62,6 +62,7 @@ void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane, ...@@ -62,6 +62,7 @@ void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
void __drm_atomic_helper_connector_reset(struct drm_connector *connector, void __drm_atomic_helper_connector_reset(struct drm_connector *connector,
struct drm_connector_state *conn_state); struct drm_connector_state *conn_state);
void drm_atomic_helper_connector_reset(struct drm_connector *connector); void drm_atomic_helper_connector_reset(struct drm_connector *connector);
void drm_atomic_helper_connector_tv_reset(struct drm_connector *connector);
void void
__drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector, __drm_atomic_helper_connector_duplicate_state(struct drm_connector *connector,
struct drm_connector_state *state); struct drm_connector_state *state);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment