|
@@ -2605,6 +2605,28 @@ void drm_atomic_helper_plane_destroy_state(struct drm_plane *plane,
|
|
|
}
|
|
|
EXPORT_SYMBOL(drm_atomic_helper_plane_destroy_state);
|
|
|
|
|
|
+/**
|
|
|
+ * __drm_atomic_helper_connector_reset - reset state on connector
|
|
|
+ * @connector: drm connector
|
|
|
+ * @conn_state: connector state to assign
|
|
|
+ *
|
|
|
+ * Initializes the newly allocated @conn_state and assigns it to
|
|
|
+ * #connector ->state, usually required when initializing the drivers
|
|
|
+ * or when called from the ->reset hook.
|
|
|
+ *
|
|
|
+ * This is useful for drivers that subclass the connector state.
|
|
|
+ */
|
|
|
+void
|
|
|
+__drm_atomic_helper_connector_reset(struct drm_connector *connector,
|
|
|
+ struct drm_connector_state *conn_state)
|
|
|
+{
|
|
|
+ if (conn_state)
|
|
|
+ conn_state->connector = connector;
|
|
|
+
|
|
|
+ connector->state = conn_state;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(__drm_atomic_helper_connector_reset);
|
|
|
+
|
|
|
/**
|
|
|
* drm_atomic_helper_connector_reset - default ->reset hook for connectors
|
|
|
* @connector: drm connector
|
|
@@ -2615,11 +2637,11 @@ EXPORT_SYMBOL(drm_atomic_helper_plane_destroy_state);
|
|
|
*/
|
|
|
void drm_atomic_helper_connector_reset(struct drm_connector *connector)
|
|
|
{
|
|
|
- kfree(connector->state);
|
|
|
- connector->state = kzalloc(sizeof(*connector->state), GFP_KERNEL);
|
|
|
+ struct drm_connector_state *conn_state =
|
|
|
+ kzalloc(sizeof(*conn_state), GFP_KERNEL);
|
|
|
|
|
|
- if (connector->state)
|
|
|
- connector->state->connector = connector;
|
|
|
+ kfree(connector->state);
|
|
|
+ __drm_atomic_helper_connector_reset(connector, conn_state);
|
|
|
}
|
|
|
EXPORT_SYMBOL(drm_atomic_helper_connector_reset);
|
|
|
|