* [PATCH] drm: add more document for drm_crtc_from_index()
@ 2017-01-07 8:52 Shawn Guo
2017-01-09 10:24 ` Daniel Vetter
0 siblings, 1 reply; 2+ messages in thread
From: Shawn Guo @ 2017-01-07 8:52 UTC (permalink / raw)
To: Daniel Vetter; +Cc: dri-devel
From: Shawn Guo <shawn.guo@linaro.org>
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.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
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(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 5c1bb1f34697..85a7452d0fb4 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -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)
{
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 62b98f386fd1..535dec4f508d 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -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)
--
1.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm: add more document for drm_crtc_from_index()
2017-01-07 8:52 [PATCH] drm: add more document for drm_crtc_from_index() Shawn Guo
@ 2017-01-09 10:24 ` Daniel Vetter
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2017-01-09 10:24 UTC (permalink / raw)
To: Shawn Guo; +Cc: dri-devel
On Sat, Jan 07, 2017 at 04:52:11PM +0800, Shawn Guo wrote:
> From: Shawn Guo <shawn.guo@linaro.org>
>
> 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.
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Applied, thanks.
-Daniel
> ---
> 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(-)
>
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 5c1bb1f34697..85a7452d0fb4 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -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)
> {
> diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
> index 62b98f386fd1..535dec4f508d 100644
> --- a/drivers/gpu/drm/drm_plane.c
> +++ b/drivers/gpu/drm/drm_plane.c
> @@ -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)
> --
> 1.9.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-01-09 10:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-07 8:52 [PATCH] drm: add more document for drm_crtc_from_index() Shawn Guo
2017-01-09 10:24 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox