diff options
| author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-09-21 04:59:25 -0400 |
|---|---|---|
| committer | Sean Paul <seanpaul@chromium.org> | 2016-09-22 03:04:01 -0400 |
| commit | 532b36712ddfdca90f4db9a5365039cc08a3ff84 (patch) | |
| tree | 1570fbb736ce7964fcda7bcaf7eada3c3cdc0de5 /include/drm | |
| parent | 43968d7b806d7a7e021261294c583a216fddf0e5 (diff) | |
drm/doc: Polish for drm_plane.[hc]
Big thing is untangling and carefully documenting the different uapi
types of planes. I also sprinkled a few more cross references around
to make this easier to discover.
As usual, remove the kerneldoc for internal functions which are not
exported. Aside: We should probably go OCD on all the ioctl handlers
and consistenly give them an _ioctl postfix.
Acked-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1474448370-32227-2-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'include/drm')
| -rw-r--r-- | include/drm/drm_plane.h | 57 |
1 files changed, 55 insertions, 2 deletions
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h index 1407715736a5..256219bfd07b 100644 --- a/include/drm/drm_plane.h +++ b/include/drm/drm_plane.h | |||
| @@ -319,10 +319,48 @@ struct drm_plane_funcs { | |||
| 319 | void (*early_unregister)(struct drm_plane *plane); | 319 | void (*early_unregister)(struct drm_plane *plane); |
| 320 | }; | 320 | }; |
| 321 | 321 | ||
| 322 | /** | ||
| 323 | * enum drm_plane_type - uapi plane type enumeration | ||
| 324 | * | ||
| 325 | * For historical reasons not all planes are made the same. This enumeration is | ||
| 326 | * used to tell the different types of planes apart to implement the different | ||
| 327 | * uapi semantics for them. For userspace which is universal plane aware and | ||
| 328 | * which is using that atomic IOCTL there's no difference between these planes | ||
| 329 | * (beyong what the driver and hardware can support of course). | ||
| 330 | * | ||
| 331 | * For compatibility with legacy userspace, only overlay planes are made | ||
| 332 | * available to userspace by default. Userspace clients may set the | ||
| 333 | * DRM_CLIENT_CAP_UNIVERSAL_PLANES client capability bit to indicate that they | ||
| 334 | * wish to receive a universal plane list containing all plane types. See also | ||
| 335 | * drm_for_each_legacy_plane(). | ||
| 336 | */ | ||
| 322 | enum drm_plane_type { | 337 | enum drm_plane_type { |
| 323 | DRM_PLANE_TYPE_OVERLAY, | 338 | /** |
| 339 | * @DRM_PLANE_TYPE_PRIMARY: | ||
| 340 | * | ||
| 341 | * Primary planes represent a "main" plane for a CRTC. Primary planes | ||
| 342 | * are the planes operated upon by CRTC modesetting and flipping | ||
| 343 | * operations described in the page_flip and set_config hooks in struct | ||
| 344 | * &drm_crtc_funcs. | ||
| 345 | */ | ||
| 324 | DRM_PLANE_TYPE_PRIMARY, | 346 | DRM_PLANE_TYPE_PRIMARY, |
| 347 | |||
| 348 | /** | ||
| 349 | * @DRM_PLANE_TYPE_CURSOR: | ||
| 350 | * | ||
| 351 | * Cursor planes represent a "cursor" plane for a CRTC. Cursor planes | ||
| 352 | * are the planes operated upon by the DRM_IOCTL_MODE_CURSOR and | ||
| 353 | * DRM_IOCTL_MODE_CURSOR2 IOCTLs. | ||
| 354 | */ | ||
| 325 | DRM_PLANE_TYPE_CURSOR, | 355 | DRM_PLANE_TYPE_CURSOR, |
| 356 | |||
| 357 | /** | ||
| 358 | * @DRM_PLANE_TYPE_OVERLAY: | ||
| 359 | * | ||
| 360 | * Overlay planes represent all non-primary, non-cursor planes. Some | ||
| 361 | * drivers refer to these types of planes as "sprites" internally. | ||
| 362 | */ | ||
| 363 | DRM_PLANE_TYPE_OVERLAY, | ||
| 326 | }; | 364 | }; |
| 327 | 365 | ||
| 328 | 366 | ||
| @@ -458,11 +496,26 @@ static inline struct drm_plane *drm_plane_find(struct drm_device *dev, | |||
| 458 | list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \ | 496 | list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \ |
| 459 | for_each_if ((plane_mask) & (1 << drm_plane_index(plane))) | 497 | for_each_if ((plane_mask) & (1 << drm_plane_index(plane))) |
| 460 | 498 | ||
| 461 | /* Plane list iterator for legacy (overlay only) planes. */ | 499 | /** |
| 500 | * drm_for_each_legacy_plane - iterate over all planes for legacy userspace | ||
| 501 | * @plane: the loop cursor | ||
| 502 | * @dev: the DRM device | ||
| 503 | * | ||
| 504 | * Iterate over all legacy planes of @dev, excluding primary and cursor planes. | ||
| 505 | * This is useful for implementing userspace apis when userspace is not | ||
| 506 | * universal plane aware. See also enum &drm_plane_type. | ||
| 507 | */ | ||
| 462 | #define drm_for_each_legacy_plane(plane, dev) \ | 508 | #define drm_for_each_legacy_plane(plane, dev) \ |
| 463 | list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) \ | 509 | list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) \ |
| 464 | for_each_if (plane->type == DRM_PLANE_TYPE_OVERLAY) | 510 | for_each_if (plane->type == DRM_PLANE_TYPE_OVERLAY) |
| 465 | 511 | ||
| 512 | /** | ||
| 513 | * drm_for_each_plane - iterate over all planes | ||
| 514 | * @plane: the loop cursor | ||
| 515 | * @dev: the DRM device | ||
| 516 | * | ||
| 517 | * Iterate over all planes of @dev, include primary and cursor planes. | ||
| 518 | */ | ||
| 466 | #define drm_for_each_plane(plane, dev) \ | 519 | #define drm_for_each_plane(plane, dev) \ |
| 467 | list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) | 520 | list_for_each_entry(plane, &(dev)->mode_config.plane_list, head) |
| 468 | 521 | ||
