Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] drm/tyr: add userspace MMIO mmap support
@ 2026-05-07 23:32 Deborah Brouwer
  2026-05-07 23:32 ` [PATCH 1/7] mm: rust: add pgprot_noncached helper Deborah Brouwer
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Deborah Brouwer @ 2026-05-07 23:32 UTC (permalink / raw)
  To: Alice Ryhl, Lorenzo Stoakes, Liam R. Howlett, Miguel Ojeda,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Trevor Gross, Danilo Krummrich, David Airlie,
	Simona Vetter, Daniel Almeida
  Cc: linux-mm, rust-for-linux, linux-kernel, dri-devel,
	boris.brezillon, beata.michalska, lyude, acourbot, work,
	alvin.sun, Laura Nao, Deborah Brouwer

This series adds support for Panthor-style userspace MMIO mappings to
the Tyr driver.

Panthor reserves a special DRM mmap offset range for exposing selected GPU
MMIO pages directly to userspace. This series implements the initial
userspace-MMIO mmap path for Tyr and wires up support for mapping the
LATEST_FLUSH USER register page.

The mapped page is read-only, non-cached, shared, and faulted in lazily
through a custom VMA fault handler using vmf_insert_pfn_prot(). This
allows userspace to observe GPU cache flush completion directly through
the mapped register instead of polling through an ioctl.

To support this, the series adds a small set of Rust MM and DRM helper
APIs:

* pgprot_noncached() wrapper for Rust MMIO mappings
* VmaRef::pgoff()
* drm::File::device()
* driver-overridable DRM file operations

The series also adds USER register page definitions and stores the MMIO
physical base address in TyrDrmDeviceData so PFNs can be derived during
fault handling.

Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>

---
Daniel Almeida (2):
      mm: rust: add pgprot_noncached helper
      mm: rust: add VMA page offset helper

Deborah Brouwer (5):
      drm/rust: add File::device() helper
      drm/rust: allow drivers to override file operations
      drm/tyr: add USER register page definitions
      drm/tyr: store MMIO physical base address
      drm/tyr: add userspace MMIO mmap support

 drivers/gpu/drm/tyr/driver.rs |  12 +-
 drivers/gpu/drm/tyr/mmap.rs   | 247 ++++++++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/tyr/regs.rs   |  18 +++
 drivers/gpu/drm/tyr/tyr.rs    |   1 +
 rust/helpers/mm.c             |   5 +
 rust/kernel/drm/device.rs     |   4 +-
 rust/kernel/drm/driver.rs     |   6 +
 rust/kernel/drm/file.rs       |  12 ++
 rust/kernel/drm/gem/mod.rs    |   3 +-
 rust/kernel/mm/virt.rs        |  10 ++
 10 files changed, 314 insertions(+), 4 deletions(-)
---
base-commit: 37f748ed0c19e007e7c5677f5d605d6b93841792
change-id: 20260507-tyr-mmap-3a9414046fbb

Best regards,
-- 
Deborah Brouwer <deborah.brouwer@collabora.com>



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

end of thread, other threads:[~2026-05-07 23:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 23:32 [PATCH 0/7] drm/tyr: add userspace MMIO mmap support Deborah Brouwer
2026-05-07 23:32 ` [PATCH 1/7] mm: rust: add pgprot_noncached helper Deborah Brouwer
2026-05-07 23:32 ` [PATCH 2/7] mm: rust: add VMA page offset helper Deborah Brouwer
2026-05-07 23:32 ` [PATCH 3/7] drm/rust: add File::device() helper Deborah Brouwer
2026-05-07 23:32 ` [PATCH 4/7] drm/rust: allow drivers to override file operations Deborah Brouwer
2026-05-07 23:32 ` [PATCH 5/7] drm/tyr: add USER register page definitions Deborah Brouwer
2026-05-07 23:32 ` [PATCH 6/7] drm/tyr: store MMIO physical base address Deborah Brouwer
2026-05-07 23:32 ` [PATCH 7/7] drm/tyr: add userspace MMIO mmap support Deborah Brouwer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox