diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-01-25 01:26:57 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2017-01-25 10:36:23 -0500 |
commit | d5d487eb07c3e4652cde70651373d6a85173f685 (patch) | |
tree | 4bfd8aa33d583ef2840d32ed557dd1c80f9c6416 | |
parent | 1031548c61fe5c129ea42408bad8c38171558a63 (diff) |
drm: Update kerneldoc for drm_crtc.[hc]
After going through all the trouble of splitting out parts from
drm_crtc.[hc] and then properly documenting each I've entirely
forgotten to show the same TLC for CRTCs themselves!
Let's make amends asap.
v2: Review from Eric.
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
-rw-r--r-- | Documentation/gpu/drm-kms.rst | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/drm_crtc.c | 21 | ||||
-rw-r--r-- | include/drm/drm_crtc.h | 25 |
3 files changed, 47 insertions, 7 deletions
diff --git a/Documentation/gpu/drm-kms.rst b/Documentation/gpu/drm-kms.rst index 0c9abdc0ee31..4d4068855ec4 100644 --- a/Documentation/gpu/drm-kms.rst +++ b/Documentation/gpu/drm-kms.rst | |||
@@ -48,11 +48,17 @@ CRTC Abstraction | |||
48 | ================ | 48 | ================ |
49 | 49 | ||
50 | .. kernel-doc:: drivers/gpu/drm/drm_crtc.c | 50 | .. kernel-doc:: drivers/gpu/drm/drm_crtc.c |
51 | :export: | 51 | :doc: overview |
52 | |||
53 | CRTC Functions Reference | ||
54 | -------------------------------- | ||
52 | 55 | ||
53 | .. kernel-doc:: include/drm/drm_crtc.h | 56 | .. kernel-doc:: include/drm/drm_crtc.h |
54 | :internal: | 57 | :internal: |
55 | 58 | ||
59 | .. kernel-doc:: drivers/gpu/drm/drm_crtc.c | ||
60 | :export: | ||
61 | |||
56 | Frame Buffer Abstraction | 62 | Frame Buffer Abstraction |
57 | ======================== | 63 | ======================== |
58 | 64 | ||
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index cea7a7efa43c..5b522092d4bb 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
@@ -47,6 +47,27 @@ | |||
47 | #include "drm_internal.h" | 47 | #include "drm_internal.h" |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * DOC: overview | ||
51 | * | ||
52 | * A CRTC represents the overall display pipeline. It receives pixel data from | ||
53 | * &drm_plane and blends them together. The &drm_display_mode is also attached | ||
54 | * to the CRTC, specifying display timings. On the output side the data is fed | ||
55 | * to one or more &drm_encoder, which are then each connected to one | ||
56 | * &drm_connector. | ||
57 | * | ||
58 | * To create a CRTC, a KMS drivers allocates and zeroes an instances of | ||
59 | * &struct drm_crtc (possibly as part of a larger structure) and registers it | ||
60 | * with a call to drm_crtc_init_with_planes(). | ||
61 | * | ||
62 | * The CRTC is also the entry point for legacy modeset operations, see | ||
63 | * &drm_crtc_funcs.set_config, legacy plane operations, see | ||
64 | * &drm_crtc_funcs.page_flip and &drm_crtc_funcs.cursor_set2, and other legacy | ||
65 | * operations like &drm_crtc_funcs.gamma_set. For atomic drivers all these | ||
66 | * features are controlled through &drm_property and | ||
67 | * &drm_mode_config_funcs.atomic_check and &drm_mode_config_funcs.atomic_check. | ||
68 | */ | ||
69 | |||
70 | /** | ||
50 | * drm_crtc_from_index - find the registered CRTC at an index | 71 | * drm_crtc_from_index - find the registered CRTC at an index |
51 | * @dev: DRM device | 72 | * @dev: DRM device |
52 | * @idx: index of registered CRTC to find for | 73 | * @idx: index of registered CRTC to find for |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 10661e156d89..2404b23cddb4 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -641,7 +641,7 @@ struct drm_crtc { | |||
641 | * | 641 | * |
642 | * This provides a read lock for the overall crtc state (mode, dpms | 642 | * This provides a read lock for the overall crtc state (mode, dpms |
643 | * state, ...) and a write lock for everything which can be update | 643 | * state, ...) and a write lock for everything which can be update |
644 | * without a full modeset (fb, cursor data, crtc properties ...). Full | 644 | * without a full modeset (fb, cursor data, crtc properties ...). A full |
645 | * modeset also need to grab &drm_mode_config.connection_mutex. | 645 | * modeset also need to grab &drm_mode_config.connection_mutex. |
646 | */ | 646 | */ |
647 | struct drm_modeset_lock mutex; | 647 | struct drm_modeset_lock mutex; |
@@ -774,10 +774,8 @@ struct drm_crtc { | |||
774 | * @connectors: array of connectors to drive with this CRTC if possible | 774 | * @connectors: array of connectors to drive with this CRTC if possible |
775 | * @num_connectors: size of @connectors array | 775 | * @num_connectors: size of @connectors array |
776 | * | 776 | * |
777 | * Represents a single crtc the connectors that it drives with what mode | 777 | * This represents a modeset configuration for the legacy SETCRTC ioctl and is |
778 | * and from which framebuffer it scans out from. | 778 | * also used internally. Atomic drivers instead use &drm_atomic_state. |
779 | * | ||
780 | * This is used to set modes. | ||
781 | */ | 779 | */ |
782 | struct drm_mode_set { | 780 | struct drm_mode_set { |
783 | struct drm_framebuffer *fb; | 781 | struct drm_framebuffer *fb; |
@@ -834,7 +832,15 @@ int drm_crtc_force_disable_all(struct drm_device *dev); | |||
834 | int drm_mode_set_config_internal(struct drm_mode_set *set); | 832 | int drm_mode_set_config_internal(struct drm_mode_set *set); |
835 | struct drm_crtc *drm_crtc_from_index(struct drm_device *dev, int idx); | 833 | struct drm_crtc *drm_crtc_from_index(struct drm_device *dev, int idx); |
836 | 834 | ||
837 | /* Helpers */ | 835 | /** |
836 | * drm_crtc_find - look up a CRTC object from its ID | ||
837 | * @dev: DRM device | ||
838 | * @id: &drm_mode_object ID | ||
839 | * | ||
840 | * This can be used to look up a CRTC from its userspace ID. Only used by | ||
841 | * drivers for legacy IOCTLs and interface, nowadays extensions to the KMS | ||
842 | * userspace interface should be done using &drm_property. | ||
843 | */ | ||
838 | static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev, | 844 | static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev, |
839 | uint32_t id) | 845 | uint32_t id) |
840 | { | 846 | { |
@@ -843,6 +849,13 @@ static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev, | |||
843 | return mo ? obj_to_crtc(mo) : NULL; | 849 | return mo ? obj_to_crtc(mo) : NULL; |
844 | } | 850 | } |
845 | 851 | ||
852 | /** | ||
853 | * drm_for_each_crtc - iterate over all CRTCs | ||
854 | * @crtc: a &struct drm_crtc as the loop cursor | ||
855 | * @dev: the &struct drm_device | ||
856 | * | ||
857 | * Iterate over all CRTCs of @dev. | ||
858 | */ | ||
846 | #define drm_for_each_crtc(crtc, dev) \ | 859 | #define drm_for_each_crtc(crtc, dev) \ |
847 | list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head) | 860 | list_for_each_entry(crtc, &(dev)->mode_config.crtc_list, head) |
848 | 861 | ||