|
@@ -1021,6 +1021,29 @@ void drm_connector_cleanup(struct drm_connector *connector)
|
|
|
}
|
|
|
EXPORT_SYMBOL(drm_connector_cleanup);
|
|
|
|
|
|
+/**
|
|
|
+ * drm_connector_index - find the index of a registered connector
|
|
|
+ * @connector: connector to find index for
|
|
|
+ *
|
|
|
+ * Given a registered connector, return the index of that connector within a DRM
|
|
|
+ * device's list of connectors.
|
|
|
+ */
|
|
|
+unsigned int drm_connector_index(struct drm_connector *connector)
|
|
|
+{
|
|
|
+ unsigned int index = 0;
|
|
|
+ struct drm_connector *tmp;
|
|
|
+
|
|
|
+ list_for_each_entry(tmp, &connector->dev->mode_config.connector_list, head) {
|
|
|
+ if (tmp == connector)
|
|
|
+ return index;
|
|
|
+
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+
|
|
|
+ BUG();
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(drm_connector_index);
|
|
|
+
|
|
|
/**
|
|
|
* drm_connector_register - register a connector
|
|
|
* @connector: the connector to register
|
|
@@ -1325,6 +1348,29 @@ void drm_plane_cleanup(struct drm_plane *plane)
|
|
|
}
|
|
|
EXPORT_SYMBOL(drm_plane_cleanup);
|
|
|
|
|
|
+/**
|
|
|
+ * drm_plane_index - find the index of a registered plane
|
|
|
+ * @plane: plane to find index for
|
|
|
+ *
|
|
|
+ * Given a registered plane, return the index of that CRTC within a DRM
|
|
|
+ * device's list of planes.
|
|
|
+ */
|
|
|
+unsigned int drm_plane_index(struct drm_plane *plane)
|
|
|
+{
|
|
|
+ unsigned int index = 0;
|
|
|
+ struct drm_plane *tmp;
|
|
|
+
|
|
|
+ list_for_each_entry(tmp, &plane->dev->mode_config.plane_list, head) {
|
|
|
+ if (tmp == plane)
|
|
|
+ return index;
|
|
|
+
|
|
|
+ index++;
|
|
|
+ }
|
|
|
+
|
|
|
+ BUG();
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(drm_plane_index);
|
|
|
+
|
|
|
/**
|
|
|
* drm_plane_force_disable - Forcibly disable a plane
|
|
|
* @plane: plane to disable
|