diff mbox

[1/2] drm: Document drm_cache interface

Message ID 20170102171706.22314-1-krisman@collabora.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Gabriel Krisman Bertazi Jan. 2, 2017, 5:17 p.m. UTC
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
---
 drivers/gpu/drm/drm_cache.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Comments

Daniel Vetter Jan. 4, 2017, 9:01 a.m. UTC | #1
On Mon, Jan 02, 2017 at 03:17:05PM -0200, Gabriel Krisman Bertazi wrote:
> Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> ---
>  drivers/gpu/drm/drm_cache.c | 23 +++++++++++++++++++++++

When adding docs, please also add a kernel-doc stanza (good place would be
a new chapter in Documentation/gpu/drm-mm.rst I think) to pull it all in.
Otherwise it's not built, which means not checked by 0day, which means
will get out of data. Also, you can't find it when browsing the html docs
;-)

Otherwise looks pretty, thanks for the patch. One nit below.
-Daniel

>  1 file changed, 23 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c
> index a7916e5f8864..b52e16e2b8ef 100644
> --- a/drivers/gpu/drm/drm_cache.c
> +++ b/drivers/gpu/drm/drm_cache.c
> @@ -67,6 +67,14 @@ static void drm_cache_flush_clflush(struct page *pages[],
>  }
>  #endif
>  
> +/**
> + * drm_clflush_pages - Flush dcache lines of a set of pages
> + * @pages - struct page array
> + * @num_pages - Number of pages in the array
> + *
> + * Flush every data cache line entry that points to an address belonging
> + * to a page in the array.
> + */
>  void
>  drm_clflush_pages(struct page *pages[], unsigned long num_pages)
>  {
> @@ -101,6 +109,13 @@ drm_clflush_pages(struct page *pages[], unsigned long num_pages)
>  }
>  EXPORT_SYMBOL(drm_clflush_pages);
>  
> +/**
> + * drm_clflush_sg - Flush dcache lines pointing to a scather-gather
> + * @st - struct sg_table
> + *
> + * Flush every data cache line entry that points to an address in the
> + * sg.
> + */
>  void
>  drm_clflush_sg(struct sg_table *st)
>  {
> @@ -125,6 +140,14 @@ drm_clflush_sg(struct sg_table *st)
>  }
>  EXPORT_SYMBOL(drm_clflush_sg);
>  
> +/**
> + * drm_clflush_virt_range - Flush dcache lines of a region
> + * @addr - Initial memory address

s/memory/kernel memory/ is clearer I think.

> + * @length - Region size
> + *
> + * Flush every data cache line entry that points to an address in the
> + * region requested.
> + */
>  void
>  drm_clflush_virt_range(void *addr, unsigned long length)
>  {
> -- 
> 2.11.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Chris Wilson Jan. 4, 2017, 9:39 a.m. UTC | #2
On Wed, Jan 04, 2017 at 10:01:37AM +0100, Daniel Vetter wrote:
> On Mon, Jan 02, 2017 at 03:17:05PM -0200, Gabriel Krisman Bertazi wrote:
> > Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> > ---
> >  drivers/gpu/drm/drm_cache.c | 23 +++++++++++++++++++++++
> 
> When adding docs, please also add a kernel-doc stanza (good place would be
> a new chapter in Documentation/gpu/drm-mm.rst I think) to pull it all in.
> Otherwise it's not built, which means not checked by 0day, which means
> will get out of data. Also, you can't find it when browsing the html docs
> ;-)

How close are we to having the spine of the kernelbook described in
Documentation/ and the indiviual chapter.rst next to the source in
drivers/gpu/drm/ etc? Something like:
	Documentation/gpu/drm.rst: include drivers/gpu/drm/*.rst ?
-Chris
Daniel Vetter Jan. 4, 2017, 9:46 a.m. UTC | #3
On Wed, Jan 04, 2017 at 09:39:48AM +0000, Chris Wilson wrote:
> On Wed, Jan 04, 2017 at 10:01:37AM +0100, Daniel Vetter wrote:
> > On Mon, Jan 02, 2017 at 03:17:05PM -0200, Gabriel Krisman Bertazi wrote:
> > > Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
> > > ---
> > >  drivers/gpu/drm/drm_cache.c | 23 +++++++++++++++++++++++
> > 
> > When adding docs, please also add a kernel-doc stanza (good place would be
> > a new chapter in Documentation/gpu/drm-mm.rst I think) to pull it all in.
> > Otherwise it's not built, which means not checked by 0day, which means
> > will get out of data. Also, you can't find it when browsing the html docs
> > ;-)
> 
> How close are we to having the spine of the kernelbook described in
> Documentation/ and the indiviual chapter.rst next to the source in
> drivers/gpu/drm/ etc? Something like:
> 	Documentation/gpu/drm.rst: include drivers/gpu/drm/*.rst ?

Hm, not sure we ever discussed this ... Adding linux-doc. But pre-coffee,
sounds like an intriguing idea at least.
-Daniel
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c
index a7916e5f8864..b52e16e2b8ef 100644
--- a/drivers/gpu/drm/drm_cache.c
+++ b/drivers/gpu/drm/drm_cache.c
@@ -67,6 +67,14 @@  static void drm_cache_flush_clflush(struct page *pages[],
 }
 #endif
 
+/**
+ * drm_clflush_pages - Flush dcache lines of a set of pages
+ * @pages - struct page array
+ * @num_pages - Number of pages in the array
+ *
+ * Flush every data cache line entry that points to an address belonging
+ * to a page in the array.
+ */
 void
 drm_clflush_pages(struct page *pages[], unsigned long num_pages)
 {
@@ -101,6 +109,13 @@  drm_clflush_pages(struct page *pages[], unsigned long num_pages)
 }
 EXPORT_SYMBOL(drm_clflush_pages);
 
+/**
+ * drm_clflush_sg - Flush dcache lines pointing to a scather-gather
+ * @st - struct sg_table
+ *
+ * Flush every data cache line entry that points to an address in the
+ * sg.
+ */
 void
 drm_clflush_sg(struct sg_table *st)
 {
@@ -125,6 +140,14 @@  drm_clflush_sg(struct sg_table *st)
 }
 EXPORT_SYMBOL(drm_clflush_sg);
 
+/**
+ * drm_clflush_virt_range - Flush dcache lines of a region
+ * @addr - Initial memory address
+ * @length - Region size
+ *
+ * Flush every data cache line entry that points to an address in the
+ * region requested.
+ */
 void
 drm_clflush_virt_range(void *addr, unsigned long length)
 {