All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/13] drm: Support short-term vmap via vmap_local
@ 2021-01-08  9:43 ` Thomas Zimmermann
  0 siblings, 0 replies; 94+ messages in thread
From: Thomas Zimmermann @ 2021-01-08  9:43 UTC (permalink / raw)
  To: sumit.semwal, christian.koenig, airlied, daniel,
	maarten.lankhorst, mripard, kraxel, hdegoede, sean, eric, sam
  Cc: linux-media, dri-devel, linaro-mm-sig, virtualization, Thomas Zimmermann

GEM VRAM helpers used to pin the BO in their implementation of vmap, so
that they could not be relocated. In recent discussions, [1][2] it became
clear that this is incorrect for in-kernel use cases, such as fbdev
emulation; which should rather depend on the reservation lock to prevent
relocation.

This patchset addresses the issue by introducing the new interfaces
vmap_local and vunmap_local throughout dma-buf and GEM. It further adds
support to DRM's CMA, SHMEM and VRAM helpers and finally converts fbdev
emulation to the new interface.

Patches 1 and 2 add the vmap_local infrastructure throughout dma-buf,
GEM and PRIME.

Patches 3 to 11 add implementations of vmap_local to DRM's various GEM
helper libraries. Due to the simple nature of these libraries, existing
vmap code can be reused easily. Several drivers are updated as well to
use the new interfaces.

Patch 12 converts generic fbdev emulation to use vmap_local. Only DRM
drivers that use GEM helpers currently use fbdev emulation, so patches
3 to 11 covered all necessary instances.

Finally patch 13 removes drm_gem_vram_vmap() functionality, which is now
unused.

I smoke-tested the patchset with ast (VRAM helpers), mgag200 (SHMEM) and
vc4 (CMA). I also tested with a version of radeon (raw TTM) that had been
converted to generic fbdev emulation.

v4:
	* move driver changes out of SHMEM and VRAM patches (Daniel)
	* call dma_buf_vmap_local() in SHMEM implementation (Daniel)
	* remove unused drm_gem_vram_vmap() functionality
	* update documentation (Daniel)
v3:
	* rewrite patchset around vmap_local
v2:
	* make importers acquire resv locks by themselves
	* document dma-buf vmap/vunmap ops

[1] https://patchwork.freedesktop.org/patch/400054/?series=83765&rev=1
[2] https://patchwork.freedesktop.org/patch/405407/?series=84401&rev=2

Thomas Zimmermann (13):
  dma-buf: Add vmap_local and vnumap_local operations
  drm/gem: Create infrastructure for GEM vmap_local
  drm/cma-helper: Provide a vmap function for short-term mappings
  drm/shmem-helper: Provide a vmap function for short-term mappings
  drm/mgag200: Use drm_gem_shmem_vmap_local() in damage handling
  drm/cirrus: Use drm_gem_shmem_vmap_local() in damage handling
  drm/gm12u320: Use drm_gem_shmem_vmap_local() in damage handling
  drm/udl: Use drm_gem_shmem_vmap_local() in damage handling
  drm/vram-helper: Provide a vmap function for short-term mappings
  drm/ast: Use drm_gem_vram_vmap_local() in cursor update
  drm/vboxvideo: Use drm_gem_vram_vmap_local() in cursor update
  drm/fb-helper: Move BO locking from DRM client to fbdev damage worker
  drm/vram-helper: Remove unused drm_gem_vram_{vmap,vunmap}()

 drivers/dma-buf/dma-buf.c              |  81 ++++++++++++++
 drivers/gpu/drm/ast/ast_cursor.c       |  37 +++++--
 drivers/gpu/drm/drm_client.c           |  94 +++++++++++++++++
 drivers/gpu/drm/drm_fb_helper.c        |  41 ++++----
 drivers/gpu/drm/drm_gem.c              |  28 +++++
 drivers/gpu/drm/drm_gem_cma_helper.c   |  27 +++++
 drivers/gpu/drm/drm_gem_shmem_helper.c |  90 ++++++++++++++--
 drivers/gpu/drm/drm_gem_vram_helper.c  | 139 ++++++++-----------------
 drivers/gpu/drm/drm_internal.h         |   2 +
 drivers/gpu/drm/drm_prime.c            |  39 +++++++
 drivers/gpu/drm/mgag200/mgag200_mode.c |  16 ++-
 drivers/gpu/drm/tiny/cirrus.c          |  10 +-
 drivers/gpu/drm/tiny/gm12u320.c        |  14 ++-
 drivers/gpu/drm/udl/udl_modeset.c      |  18 ++--
 drivers/gpu/drm/vboxvideo/vbox_mode.c  |  15 +--
 drivers/gpu/drm/vc4/vc4_bo.c           |   1 +
 drivers/gpu/drm/virtio/virtgpu_prime.c |   2 +
 include/drm/drm_client.h               |   4 +
 include/drm/drm_gem.h                  |  21 ++++
 include/drm/drm_gem_cma_helper.h       |   1 +
 include/drm/drm_gem_shmem_helper.h     |   2 +
 include/drm/drm_gem_vram_helper.h      |   4 +-
 include/drm/drm_prime.h                |   2 +
 include/linux/dma-buf.h                |  34 ++++++
 24 files changed, 566 insertions(+), 156 deletions(-)

--
2.29.2


^ permalink raw reply	[flat|nested] 94+ messages in thread

end of thread, other threads:[~2021-02-02 17:43 UTC | newest]

Thread overview: 94+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08  9:43 [PATCH v4 00/13] drm: Support short-term vmap via vmap_local Thomas Zimmermann
2021-01-08  9:43 ` Thomas Zimmermann
2021-01-08  9:43 ` Thomas Zimmermann
2021-01-08  9:43 ` [PATCH v4 01/13] dma-buf: Add vmap_local and vnumap_local operations Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08 16:12   ` Ruhl, Michael J
2021-01-08 16:12     ` Ruhl, Michael J
2021-01-12  7:45     ` Thomas Zimmermann
2021-01-12  7:45       ` Thomas Zimmermann
2021-01-12  7:45       ` Thomas Zimmermann
2021-01-14 14:39       ` Ruhl, Michael J
2021-01-14 14:39         ` Ruhl, Michael J
2021-01-08  9:43 ` [PATCH v4 02/13] drm/gem: Create infrastructure for GEM vmap_local Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43 ` [PATCH v4 03/13] drm/cma-helper: Provide a vmap function for short-term mappings Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43 ` [PATCH v4 04/13] drm/shmem-helper: " Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-11 16:50   ` Daniel Vetter
2021-01-11 16:50     ` Daniel Vetter
2021-01-11 16:50     ` Daniel Vetter
2021-01-12 13:11     ` Thomas Zimmermann
2021-01-12 13:11       ` Thomas Zimmermann
2021-01-12 13:11       ` Thomas Zimmermann
2021-01-12 14:16       ` Daniel Vetter
2021-01-12 14:16         ` Daniel Vetter
2021-01-12 14:16         ` Daniel Vetter
2021-01-27 12:08     ` Thomas Zimmermann
2021-01-27 12:08       ` Thomas Zimmermann
2021-01-27 12:08       ` Thomas Zimmermann
2021-02-02 14:11       ` Daniel Vetter
2021-02-02 14:11         ` Daniel Vetter
2021-02-02 14:11         ` Daniel Vetter
2021-01-08  9:43 ` [PATCH v4 05/13] drm/mgag200: Use drm_gem_shmem_vmap_local() in damage handling Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-11 16:53   ` Daniel Vetter
2021-01-11 16:53     ` Daniel Vetter
2021-01-11 16:53     ` Daniel Vetter
2021-01-11 16:58     ` Daniel Vetter
2021-01-11 16:58       ` Daniel Vetter
2021-01-11 16:58       ` Daniel Vetter
2021-01-08  9:43 ` [PATCH v4 06/13] drm/cirrus: " Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-11 17:00   ` Daniel Vetter
2021-01-11 17:00     ` Daniel Vetter
2021-01-11 17:00     ` Daniel Vetter
2021-01-11 17:03     ` Daniel Vetter
2021-01-11 17:03       ` Daniel Vetter
2021-01-11 17:03       ` Daniel Vetter
2021-01-08  9:43 ` [PATCH v4 07/13] drm/gm12u320: " Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-11 17:01   ` Daniel Vetter
2021-01-11 17:01     ` Daniel Vetter
2021-01-11 17:01     ` Daniel Vetter
2021-01-08  9:43 ` [PATCH v4 08/13] drm/udl: " Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43 ` [PATCH v4 09/13] drm/vram-helper: Provide a vmap function for short-term mappings Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43 ` [PATCH v4 10/13] drm/ast: Use drm_gem_vram_vmap_local() in cursor update Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43 ` [PATCH v4 11/13] drm/vboxvideo: " Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-11 17:06   ` Daniel Vetter
2021-01-11 17:06     ` Daniel Vetter
2021-01-11 17:06     ` Daniel Vetter
2021-01-12  7:54     ` Thomas Zimmermann
2021-01-12  7:54       ` Thomas Zimmermann
2021-01-12  7:54       ` Thomas Zimmermann
2021-01-12  9:17       ` Daniel Vetter
2021-01-12  9:17         ` Daniel Vetter
2021-01-12  9:17         ` Daniel Vetter
2021-01-12  9:53         ` Thomas Zimmermann
2021-01-12  9:53           ` Thomas Zimmermann
2021-01-12  9:53           ` Thomas Zimmermann
2021-01-08  9:43 ` [PATCH v4 12/13] drm/fb-helper: Move BO locking from DRM client to fbdev damage worker Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-08  9:43 ` [PATCH v4 13/13] drm/vram-helper: Remove unused drm_gem_vram_{vmap,vunmap}() Thomas Zimmermann
2021-01-08  9:43   ` [PATCH v4 13/13] drm/vram-helper: Remove unused drm_gem_vram_{vmap, vunmap}() Thomas Zimmermann
2021-01-08  9:43   ` Thomas Zimmermann
2021-01-11 16:52   ` [PATCH v4 13/13] drm/vram-helper: Remove unused drm_gem_vram_{vmap,vunmap}() Daniel Vetter
2021-01-11 16:52     ` Daniel Vetter
2021-01-11 16:52     ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.