mbox series

[git,pull] vmwgfx-coherent

Message ID 20191113131639.4653-1-thomas_os@shipmail.org (mailing list archive)
State New, archived
Headers show
Series [git,pull] vmwgfx-coherent | expand

Pull-request

git://people.freedesktop.org/~thomash/linux vmwgfx-coherent

Message

Thomas Hellström (Intel) Nov. 13, 2019, 1:16 p.m. UTC
Dave, Daniel,

Take 2 of the coherent memory patches are now ready for pulling.
Following the discussion we had after the last merge attempt that had to
be reverted, it might make sense to send this to Linus as a pull request
separate from other DRM stuff.

This time Linus has been heavily involved in the outcome of the -mm patches,
and Andrew Morton has acked them for merging through DRM:

https://lore.kernel.org/r/20191105195114.f75be5e76763da5546121b41@linux-foundation.org/

If you think it's too late for the 5.5 merge window, deferring to 5.6 is
not a problem.

There is a dependency on drm-misc:
This needs to be merged after drm-misc caa478af4812, to avoid a compilation
error.

Cover message:
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%.

The following changes since commit 7aef29f4d4613570f413301b0807ea66a21f5e3b:

  drm/ttm: Convert vm callbacks to helpers (2019-11-06 13:02:00 +0100)

are available in the Git repository at:

  git://people.freedesktop.org/~thomash/linux vmwgfx-coherent

for you to fetch changes up to 9ca7d19ff8ba6207bccab46536814fe4839df80a:

  drm/vmwgfx: Add surface dirty-tracking callbacks (2019-11-06 15:45:32 +0100)

----------------------------------------------------------------
Thomas Hellstrom (8):
      mm: Remove BUG_ON mmap_sem not held from xxx_trans_huge_lock()
      mm: pagewalk: Take the pagetable lock in walk_pte_range()
      mm: Add a walk_page_mapping() function to the pagewalk code
      mm: Add write-protect and clean utilities for address space ranges
      drm/vmwgfx: Implement an infrastructure for write-coherent resources
      drm/vmwgfx: Use an RBtree instead of linked list for MOB resources
      drm/vmwgfx: Implement an infrastructure for read-coherent resources
      drm/vmwgfx: Add surface dirty-tracking callbacks

 drivers/gpu/drm/vmwgfx/Kconfig                     |   1 +
 drivers/gpu/drm/vmwgfx/Makefile                    |   2 +-
 .../drm/vmwgfx/device_include/svga3d_surfacedefs.h | 233 +++++++++-
 drivers/gpu/drm/vmwgfx/vmwgfx_bo.c                 |  10 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.h                |  44 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c            |   1 -
 drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c         | 488 +++++++++++++++++++++
 drivers/gpu/drm/vmwgfx/vmwgfx_resource.c           | 193 +++++++-
 drivers/gpu/drm/vmwgfx/vmwgfx_resource_priv.h      |  13 +
 drivers/gpu/drm/vmwgfx/vmwgfx_surface.c            | 395 ++++++++++++++++-
 drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c           |  15 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_validation.c         |  74 +++-
 drivers/gpu/drm/vmwgfx/vmwgfx_validation.h         |  16 +-
 include/linux/huge_mm.h                            |   2 -
 include/linux/mm.h                                 |  13 +-
 include/linux/pagewalk.h                           |   9 +
 include/uapi/drm/vmwgfx_drm.h                      |   4 +-
 mm/Kconfig                                         |   3 +
 mm/Makefile                                        |   1 +
 mm/mapping_dirty_helpers.c                         | 315 +++++++++++++
 mm/pagewalk.c                                      |  99 ++++-
 21 files changed, 1875 insertions(+), 56 deletions(-)
 create mode 100644 drivers/gpu/drm/vmwgfx/vmwgfx_page_dirty.c
 create mode 100644 mm/mapping_dirty_helpers.c