All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 00/12] drm/v3d: Add support for write-back cacheable BOs
@ 2026-10-30 20:50 Maíra Canal
  2026-10-30 20:50 ` [PATCH RFC 01/12] drm/prime: Allow custom dma_buf_ops in PRIME helpers Maíra Canal
                   ` (11 more replies)
  0 siblings, 12 replies; 15+ messages in thread
From: Maíra Canal @ 2026-10-30 20:50 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
	Simona Vetter, Faith Ekstrand, Boris Brezillon, Rob Herring,
	Steven Price, Adrián Larumbe, Liviu Dudau, Alex Deucher,
	Christian König, Melissa Wen, Iago Toral, JaeHoon Lee
  Cc: kernel-dev, dri-devel, Maíra Canal

This series aims to implement cached maps and explicit flushing for the
V3D driver, which is mostly motivated by Vulkan's host cached memory.

V3D's implementation of cached maps is quite similar to Panfrost's and
therefore, I decided to revamp Panthor/Panfrost's efforts [1] to implement
common shmem helpers for CPU cache maintenance. The other option would be
copying the same code in V3D, so I preferred to retake the discussion
and see if we can reach some consensus.

The most controversial part of this series are the first three patches,
which were extensively discussed in Boris' series.

Patch 1 lets the PRIME helpers work with custom dma_buf_ops, following
Thomas' feedback on [1]: drm_gem_prime_export_with_ops() exports with
driver-provided ops, and gem_prime_is_exporter() lets a driver recognize
its own DMA-BUFs on import, without adding buffer callbacks to struct
drm_driver, as requested by Thomas.

Patches 2-3 are taken from [1], rebased on top of drm-misc-next with some
minor kernel-doc fixes.

Patches 4-8 convert Panfrost, Panthor and amdgpu to the new helpers. Note
that I didn't use the new helpers from patches 2-3 in Panthor, as they
recently parted ways with DRM GEM shmem.

Finally, patches 9-12 add v3d support to cacheable BOs and the new ioctl
DRM_IOCTL_V3D_SYNC_BO.

About the userspace implementation, I tested this implementation using
a hack implementation (based in PanVK), as I preferred to leave the
userspace implementation to be finished by JaeHoon Lee, which is already
working on it on [2].

[1] https://lore.kernel.org/dri-devel/20251126124455.3656651-1-boris.brezillon@collabora.com/
[2] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42974

Best regards,
- Maíra

---
Boris Brezillon (1):
      drm/shmem: Provide a generic {begin, end}_cpu_access() implementation

Faith Ekstrand (1):
      drm/shmem: Add a drm_gem_shmem_sync() helper

Maíra Canal (10):
      drm/prime: Allow custom dma_buf_ops in PRIME helpers
      drm/panfrost: Use PRIME helpers with custom dma_buf_ops
      drm/panfrost: Use common shmem helpers for dma_buf CPU access
      drm/panfrost: Use drm_gem_shmem_sync()
      drm/panthor: Use PRIME helpers with custom dma_buf_ops
      drm/amdgpu: Use drm_gem_prime_export_with_ops()
      drm/v3d: Provide a custom dma_buf implementation
      drm/v3d: Add flag to map BOs write-back cacheable
      drm/v3d: Add a DRM_IOCTL_V3D_SYNC_BO ioctl
      drm/v3d: Advertise support for write-back cacheable BOs

 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c |   9 +-
 drivers/gpu/drm/drm_gem_shmem_helper.c      | 208 ++++++++++++++++++++++++++++
 drivers/gpu/drm/drm_prime.c                 |  47 +++++--
 drivers/gpu/drm/panfrost/panfrost_drv.c     |   2 +-
 drivers/gpu/drm/panfrost/panfrost_gem.c     | 185 ++-----------------------
 drivers/gpu/drm/panfrost/panfrost_gem.h     |   5 +-
 drivers/gpu/drm/panthor/panthor_drv.c       |   2 +-
 drivers/gpu/drm/panthor/panthor_gem.c       |  28 +---
 drivers/gpu/drm/panthor/panthor_gem.h       |   5 +-
 drivers/gpu/drm/v3d/v3d_bo.c                | 101 +++++++++++++-
 drivers/gpu/drm/v3d/v3d_drv.c               |   5 +
 drivers/gpu/drm/v3d/v3d_drv.h               |   6 +-
 drivers/gpu/drm/v3d/v3d_irq.c               |   2 +-
 include/drm/drm_drv.h                       |  11 ++
 include/drm/drm_gem_shmem_helper.h          |  27 ++++
 include/drm/drm_prime.h                     |   4 +
 include/uapi/drm/v3d_drm.h                  |  58 +++++++-
 17 files changed, 474 insertions(+), 231 deletions(-)
---
base-commit: a1e63ab695ad76850ab9787b9eb6aab695dc2965
change-id: 20261028-v3d-cached-maps-faae3ba95e11


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

end of thread, other threads:[~2026-10-30 21:11 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30 20:50 [PATCH RFC 00/12] drm/v3d: Add support for write-back cacheable BOs Maíra Canal
2026-10-30 20:50 ` [PATCH RFC 01/12] drm/prime: Allow custom dma_buf_ops in PRIME helpers Maíra Canal
2026-10-30 20:50 ` [PATCH RFC 02/12] drm/shmem: Provide a generic {begin, end}_cpu_access() implementation Maíra Canal
2026-10-30 21:04   ` sashiko-bot
2026-10-30 20:50 ` [PATCH RFC 03/12] drm/shmem: Add a drm_gem_shmem_sync() helper Maíra Canal
2026-10-30 21:11   ` sashiko-bot
2026-10-30 20:50 ` [PATCH RFC 04/12] drm/panfrost: Use PRIME helpers with custom dma_buf_ops Maíra Canal
2026-10-30 20:50 ` [PATCH RFC 05/12] drm/panfrost: Use common shmem helpers for dma_buf CPU access Maíra Canal
2026-10-30 20:50 ` [PATCH RFC 06/12] drm/panfrost: Use drm_gem_shmem_sync() Maíra Canal
2026-10-30 20:50 ` [PATCH RFC 07/12] drm/panthor: Use PRIME helpers with custom dma_buf_ops Maíra Canal
2026-10-30 20:50 ` [PATCH RFC 08/12] drm/amdgpu: Use drm_gem_prime_export_with_ops() Maíra Canal
2026-10-30 20:50 ` [PATCH RFC 09/12] drm/v3d: Provide a custom dma_buf implementation Maíra Canal
2026-10-30 20:50 ` [PATCH RFC 10/12] drm/v3d: Add flag to map BOs write-back cacheable Maíra Canal
2026-10-30 20:50 ` [PATCH RFC 11/12] drm/v3d: Add a DRM_IOCTL_V3D_SYNC_BO ioctl Maíra Canal
2026-10-30 20:50 ` [PATCH RFC 12/12] drm/v3d: Advertise support for write-back cacheable BOs Maíra Canal

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.