mirror of
https://github.com/Dasharo/linux.git
synced 2026-03-06 15:25:10 -08:00
drm: Add a prefetching memcpy_from_wc
Reading out of write-combining mapped memory is typically very slow since the CPU doesn't prefetch. However some archs have special instructions to do this. So add a best-effort memcpy_from_wc taking dma-buf-map pointer arguments that attempts to use a fast prefetching memcpy and otherwise falls back to ordinary memcopies, taking the iomem tagging into account. The code is largely copied from i915_memcpy_from_wc. Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Christian König <christian.koenig@amd.com> Suggested-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Daniel Vetter <daniel@ffwll.ch> Link: https://lore.kernel.org/r/20210602083818.241793-5-thomas.hellstrom@linux.intel.com Link: https://patchwork.freedesktop.org/patch/msgid/20210602083818.241793-5-thomas.hellstrom@linux.intel.com
This commit is contained in:
@@ -35,6 +35,8 @@
|
||||
|
||||
#include <linux/scatterlist.h>
|
||||
|
||||
struct dma_buf_map;
|
||||
|
||||
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);
|
||||
@@ -70,4 +72,9 @@ static inline bool drm_arch_can_wc_memory(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
void drm_memcpy_init_early(void);
|
||||
|
||||
void drm_memcpy_from_wc(struct dma_buf_map *dst,
|
||||
const struct dma_buf_map *src,
|
||||
unsigned long len);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user