summaryrefslogtreecommitdiffstats
path: root/include/drm/drm_connector.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-08-31 18:09:04 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-09-19 15:03:46 +0200
commitafb21ea63d815d05f6081ee3efef6772a16317eb (patch)
treed0dbbad659da899e64778ae531efc11857fd6237 /include/drm/drm_connector.h
parent2cc107dc5b2f247dda9495fa488229cc187057d6 (diff)
downloadlinux-afb21ea63d815d05f6081ee3efef6772a16317eb.tar.bz2
drm: Move a few macros away from drm_crtc.h
Now that there's less stuff in there I noticed that I overlooked them. Sprinkle some docs over them while at it. Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20160831160913.12991-2-daniel.vetter@ffwll.ch
Diffstat (limited to 'include/drm/drm_connector.h')
-rw-r--r--include/drm/drm_connector.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index 66b7d6744dd2..e4e545e9516d 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -181,14 +181,19 @@ int drm_display_info_set_bus_formats(struct drm_display_info *info,
/**
* struct drm_connector_state - mutable connector state
* @connector: backpointer to the connector
- * @crtc: CRTC to connect connector to, NULL if disabled
* @best_encoder: can be used by helpers and drivers to select the encoder
* @state: backpointer to global drm_atomic_state
*/
struct drm_connector_state {
struct drm_connector *connector;
- struct drm_crtc *crtc; /* do not write directly, use drm_atomic_set_crtc_for_connector() */
+ /**
+ * @crtc: CRTC to connect connector to, NULL if disabled.
+ *
+ * Do not change this directly, use drm_atomic_set_crtc_for_connector()
+ * instead.
+ */
+ struct drm_crtc *crtc;
struct drm_encoder *best_encoder;
@@ -744,4 +749,19 @@ int drm_mode_connector_set_path_property(struct drm_connector *connector,
int drm_mode_connector_set_tile_property(struct drm_connector *connector);
int drm_mode_connector_update_edid_property(struct drm_connector *connector,
const struct edid *edid);
+
+/**
+ * drm_for_each_connector - iterate over all connectors
+ * @connector: the loop cursor
+ * @dev: the DRM device
+ *
+ * Iterate over all connectors of @dev.
+ */
+#define drm_for_each_connector(connector, dev) \
+ for (assert_drm_connector_list_read_locked(&(dev)->mode_config), \
+ connector = list_first_entry(&(dev)->mode_config.connector_list, \
+ struct drm_connector, head); \
+ &connector->head != (&(dev)->mode_config.connector_list); \
+ connector = list_next_entry(connector, head))
+
#endif