Skip to contentSkip to conversation

drm: add more document for drm_crtc_from_index()

PATCH Applied Shawn Guo 2 participants 2 messages Jan 7, 2017 – Jan 9, 2017

Subsystems (2)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH 1/1 drm: add more document for drm_crtc_from_index()

From: Shawn Guo <[email protected]>

Add a bit more document for function drm_crtc_from_index() to cross link it with drm_crtc_from_index(), and explain that the function is useful in vblank code.

While at it, add cross link comment for drm_plane_from_index() as well.

---
This is a follow-up patch to address Daniel's comment [1] on my patch "[PATCH 1/3] drm: add crtc helper drm_crtc_from_index()".

Shawn

[1] http://www.spinics.net/lists/dri-devel/msg128062.html

 drivers/gpu/drm/drm_crtc.c  | 5 ++++-
 drivers/gpu/drm/drm_plane.c | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_crtc.c +4 -1
index 5c1bb1f34697..85a7452d0fb4 100644
@@ -52,7 +52,10 @@
  * @idx: index of registered CRTC to find for
  *
  * Given a CRTC index, return the registered CRTC from DRM device's
- * list of CRTCs with matching index.
+ * list of CRTCs with matching index. This is the inverse of drm_crtc_index().
+ * It's useful in the vblank callbacks (like &drm_driver.enable_vblank or
+ * &drm_driver.disable_vblank), since that still deals with indices instead
+ * of pointers to &struct drm_crtc."
  */
 struct drm_crtc *drm_crtc_from_index(struct drm_device *dev, int idx)
 {
drivers/gpu/drm/drm_plane.c +1 -1
index 62b98f386fd1..535dec4f508d 100644
@@ -254,7 +254,7 @@ void drm_plane_cleanup(struct drm_plane *plane)
  * @idx: index of registered plane to find for
  *
  * Given a plane index, return the registered plane from DRM device's
- * list of planes with matching index.
+ * list of planes with matching index. This is the inverse of drm_plane_index().
  */
 struct drm_plane *
 drm_plane_from_index(struct drm_device *dev, int idx)
Signature · 6 lines
1.9.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 9 lines · Shawn Guo

From: Shawn Guo <[email protected]>

Add a bit more document for function drm_crtc_from_index() to cross link it with drm_crtc_from_index(), and explain that the function is useful in vblank code.

While at it, add cross link comment for drm_plane_from_index() as well.

Applied, thanks.
-Daniel

Quoted 44 lines

---
This is a follow-up patch to address Daniel's comment [1] on my patch "[PATCH 1/3] drm: add crtc helper drm_crtc_from_index()".

Shawn

[1] http://www.spinics.net/lists/dri-devel/msg128062.html

 drivers/gpu/drm/drm_crtc.c  | 5 ++++-
 drivers/gpu/drm/drm_plane.c | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_crtc.c +4 -1
index 5c1bb1f34697..85a7452d0fb4 100644
@@ -52,7 +52,10 @@
  * @idx: index of registered CRTC to find for
  *
  * Given a CRTC index, return the registered CRTC from DRM device's
- * list of CRTCs with matching index.
+ * list of CRTCs with matching index. This is the inverse of drm_crtc_index().
+ * It's useful in the vblank callbacks (like &drm_driver.enable_vblank or
+ * &drm_driver.disable_vblank), since that still deals with indices instead
+ * of pointers to &struct drm_crtc."
  */
 struct drm_crtc *drm_crtc_from_index(struct drm_device *dev, int idx)
 {
drivers/gpu/drm/drm_plane.c +1 -1
index 62b98f386fd1..535dec4f508d 100644
@@ -254,7 +254,7 @@ void drm_plane_cleanup(struct drm_plane *plane)
  * @idx: index of registered plane to find for
  *
  * Given a plane index, return the registered plane from DRM device's
- * list of planes with matching index.
+ * list of planes with matching index. This is the inverse of drm_plane_index().
  */
 struct drm_plane *
 drm_plane_from_index(struct drm_device *dev, int idx)
Signature · 1 line
1.9.1
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel