drm: Document drm_cache interface
Subsystems (3)
PATCH 1/2 drm: Document drm_cache interface
--- drivers/gpu/drm/drm_cache.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+)
drivers/gpu/drm/drm_cache.c +23 -0
@@ -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) {
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/2 drm: Move drm_clflush prototypes to drm_cache header file
Continue to clean up drmP.h by moving the cache flushing functions into it's own header file.
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/vgem/vgem_drv.h | 1 + include/drm/drmP.h | 5 ----- include/drm/drm_cache.h | 4 ++++ 4 files changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -49,6 +49,7 @@#include <drm/drm_legacy.h> /* for struct drm_dma_handle */ #include <drm/drm_gem.h> #include <drm/drm_auth.h> +#include <drm/drm_cache.h> #include "i915_params.h" #include "i915_reg.h"
drivers/gpu/drm/vgem/vgem_drv.h +1 -0
@@ -31,6 +31,7 @@#include <drm/drmP.h> #include <drm/drm_gem.h> +#include <drm/drm_cache.h> #include <uapi/drm/vgem_drm.h>
include/drm/drmP.h +0 -5
@@ -730,11 +730,6 @@ int drm_noop(struct drm_device *dev, void *data,int drm_invalid_op (struct drm_device *dev,void *data,struct drm_file *file_priv); -/* Cache management (drm_cache.c) */ -void drm_clflush_pages (struct page *pages[],unsigned long num_pages); -void drm_clflush_sg (struct sg_table *st); -void drm_clflush_virt_range (void *addr,unsigned long length); -/* * These are exported to drivers so that they can implement fencing using * DMA quiscent + idle. DMA quiescent usually requires the hardware lock.
include/drm/drm_cache.h +4 -0
@@ -33,7 +33,11 @@#ifndef _DRM_CACHE_H_#define _DRM_CACHE_H_ +#include <linux/scatterlist.h> +void drm_clflush_pages (struct page *pages[],unsigned long num_pages); +void drm_clflush_sg (struct sg_table *st); +void drm_clflush_virt_range (void *addr,unsigned long length);static inline bool drm_arch_can_wc_memory (void ) {
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 3 lines · Gabriel Krisman Bertazi
Signed-off-by Gabriel Krisman Bertazi <[email protected]>--- 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
Quoted 36 lines
1 file changed, 23 insertions(+)drivers/gpu/drm/drm_cache.c +15
-0@@ -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) {
drivers/gpu/drm/drm_cache.c drm_clflush_sg(struct sg_table *st) · line 145
Quoted 6 lines
drivers/gpu/drm/drm_cache.c +3
-0@@ -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.
Quoted 15 lines
drivers/gpu/drm/drm_cache.c +5
-0+* @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) {Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
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
Quoted 10 lines · Daniel Vetter
Quoted 3 lines · Gabriel Krisman Bertazi
Signed-off-by Gabriel Krisman Bertazi <[email protected]>--- 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.rstI 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
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 12 lines · Chris Wilson
Quoted 10 lines · Daniel Vetter
Quoted 3 lines · Gabriel Krisman Bertazi
Signed-off-by Gabriel Krisman Bertazi <[email protected]>--- 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.rstI 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 ;-)
Quoted 4 lines
How close are we to having the spine of the kernelbook described in
Documentation/and the indiviualchapter.rstnext to the source indrivers/gpu/drm/etc? Something like:
Documentation/gpu/drm.rst: includedrivers/gpu/drm/*.rst?
Hm, not sure we ever discussed this ... Adding linux-doc. But pre-coffee, sounds like an intriguing idea at least.
-Daniel
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