From: Maíra Canal <[email protected]> To: "Maarten Lankhorst"<[email protected]>, "Maxime Ripard"<[email protected]>, "Thomas Zimmermann"<[email protected]>, "David Airlie"<[email protected]>, "Simona Vetter"<[email protected]>, "Faith Ekstrand"<[email protected]>, "Boris Brezillon"<[email protected]>, "Rob Herring"<[email protected]>, "Steven Price"<[email protected]>, "Adrián Larumbe"<[email protected]>, "Liviu Dudau"<[email protected]>, "Alex Deucher"<[email protected]>, "Christian König"<[email protected]>, "Melissa Wen"<[email protected]>, "Iago Toral"<[email protected]>, "JaeHoon Lee"<[email protected]> Cc: <[email protected]>, <[email protected]>, "Maíra Canal"<[email protected]> Date: Fri., 30 Oct. 2026 16:50:18 -0400 Subject: [PATCH RFC 00/12] drm/v3d: Add support for write-back cacheable BOs
> 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. Not entirely included in the mailing list discussion was why we abandon this approach for panfrost/panthor: CPU mapping shared dma-bufs is tricky, especialy with non-coherent caching. Gone are the days when we dma-buf had an ownership concept and clients properly bookended usage with begin/end. With explicit cache management, there are too many ways that one client can screw up another if the BO is shared. The solution was to disallow BO sharing for any BOs that weren't mapped write-combined or uncached. A number of DRM drivers already have a concept of non-sharable BOs for locking reasons. We simply required that for write-back caching. This doesn't mean that the common SHMEM helper isn't useful. I still think that patch is fine. Just that plugging it all into PRIME is fraught. This wasn't obvious from the ML discussions because a lot of the back-and-forth happened in chat or in meetings inside Collabora. ~Faith Ekstrand
