drm: Document drm_cache interface
Subsystems (4)
PATCH v2 1/2 drm: Document drm_cache interface
Notice that this uncovers an issue with the kernel-doc handling of array arguments, causing the first parameter of drm_clflush_pages() to not show up in the rst-generated page. A proposed fix is under review in
linux-doc: <http://www.spinics.net/lists/linux-doc/msg42544.html>
Changes since v1:
- Add section to drm-mm.rst.
- Fix kernel-doc style issues.
- s/memory/kernel memory/.
--- Documentation/gpu/drm-mm.rst | 6 ++++++ drivers/gpu/drm/drm_cache.c | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+)
Documentation/gpu/drm-mm.rst +6 -0
@@ -470,3 +470,9 @@ DRM MM Range Allocator Function References .. kernel-doc:: include/drm/drm_mm.h :internal: + +DRM Cache Handling +================== + +.. kernel-doc:: drivers/gpu/drm/drm_cache.c + :export:
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: List of pages to be flushed. +* @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 kernel 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 v2 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.
Compile-tested only
--- 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
@@ -731,11 +731,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 11 lines · Gabriel Krisman Bertazi
Notice that this uncovers an issue with the kernel-doc handling of array arguments, causing the first parameter of
drm_clflush_pages()to not show up in the rst-generated page. A proposed fix is under review in
linux-doc: <http://www.spinics.net/lists/linux-doc/msg42544.html>Changes since v1:
- Add section todrm-mm.rst.
- Fix kernel-doc style issues.
- s/memory/kernel memory/.Signed-off-by Gabriel Krisman Bertazi <[email protected]>
For the series:
Quoted 70 lines
--- Documentation/gpu/drm-mm.rst | 6 ++++++ drivers/gpu/drm/drm_cache.c | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+)Documentation/gpu/drm-mm.rst +6
-0@@ -470,3 +470,9 @@ DRM MM Range Allocator Function References .. kernel-doc:: include/drm/drm_mm.h :internal: + +DRM Cache Handling +================== + +.. kernel-doc:: drivers/gpu/drm/drm_cache.c + :export:drivers/gpu/drm/drm_cache.c +23
-1@@ -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: List of pages to be flushed. +* @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 kernel 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) { --2.11.0
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 12 lines · Alex Deucher
Quoted 10 lines · Gabriel Krisman Bertazi
Notice that this uncovers an issue with the kernel-doc handling of array arguments, causing the first parameter of
drm_clflush_pages()to not show up in the rst-generated page. A proposed fix is under review in
linux-doc: <http://www.spinics.net/lists/linux-doc/msg42544.html>Changes since v1:
- Add section todrm-mm.rst.
- Fix kernel-doc style issues.
- s/memory/kernel memory/.
Quoted 4 lines
Quoted 1 line
Signed-off-by Gabriel Krisman Bertazi <[email protected]>For the series:
Reviewed-by Alex Deucher <[email protected]>
Both applied, thanks for patches&review.
-Daniel
Quoted 79 lines
Quoted 71 lines
--- Documentation/gpu/drm-mm.rst | 6 ++++++ drivers/gpu/drm/drm_cache.c | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+)Documentation/gpu/drm-mm.rst +6
-0@@ -470,3 +470,9 @@ DRM MM Range Allocator Function References .. kernel-doc:: include/drm/drm_mm.h :internal: + +DRM Cache Handling +================== + +.. kernel-doc:: drivers/gpu/drm/drm_cache.c + :export:drivers/gpu/drm/drm_cache.c +23
-1@@ -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: List of pages to be flushed. +* @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 kernel 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) { --2.11.0
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
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