diff options
author | Dave Airlie <airlied@redhat.com> | 2019-11-28 12:39:50 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2019-11-28 14:33:01 +1000 |
commit | 0a6cad5df541108cfd3fbd79eef48eb824c89bdc (patch) | |
tree | 767d41bf88ec067b85fe3d87a190ef08e59a1ce7 /include/linux/mm.h | |
parent | acc61b8929365e63a3e8c8c8913177795aa45594 (diff) | |
parent | 9ca7d19ff8ba6207bccab46536814fe4839df80a (diff) |
Merge branch 'vmwgfx-coherent' of git://people.freedesktop.org/~thomash/linux into drm-next
Graphics APIs like OpenGL 4.4 and Vulkan require the graphics driver
to provide coherent graphics memory, meaning that the GPU sees any
content written to the coherent memory on the next GPU operation that
touches that memory, and the CPU sees any content written by the GPU
to that memory immediately after any fence object trailing the GPU
operation is signaled.
Paravirtual drivers that otherwise require explicit synchronization
needs to do this by hooking up dirty tracking to pagefault handlers
and buffer object validation.
Provide mm helpers needed for this and that also allow for huge pmd-
and pud entries (patch 1-3), and the associated vmwgfx code (patch 4-7).
The code has been tested and exercised by a tailored version of mesa
where we disable all explicit synchronization and assume graphics memory
is coherent. The performance loss varies of course; a typical number is
around 5%.
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Thomas Hellstrom <thomas_os@shipmail.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20191113131639.4653-1-thomas_os@shipmail.org
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index a2adf95b3f9c..f6fb714fa851 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2632,7 +2632,6 @@ typedef int (*pte_fn_t)(pte_t *pte, unsigned long addr, void *data); extern int apply_to_page_range(struct mm_struct *mm, unsigned long address, unsigned long size, pte_fn_t fn, void *data); - #ifdef CONFIG_PAGE_POISONING extern bool page_poisoning_enabled(void); extern void kernel_poison_pages(struct page *page, int numpages, int enable); @@ -2873,5 +2872,17 @@ static inline int pages_identical(struct page *page1, struct page *page2) return !memcmp_pages(page1, page2); } +#ifdef CONFIG_MAPPING_DIRTY_HELPERS +unsigned long clean_record_shared_mapping_range(struct address_space *mapping, + pgoff_t first_index, pgoff_t nr, + pgoff_t bitmap_pgoff, + unsigned long *bitmap, + pgoff_t *start, + pgoff_t *end); + +unsigned long wp_shared_mapping_range(struct address_space *mapping, + pgoff_t first_index, pgoff_t nr); +#endif + #endif /* __KERNEL__ */ #endif /* _LINUX_MM_H */ |