[PATCH v4 00/11] drm/tyr: add VM and BO ioctl support
From: Ke Sun via B4 Relay
Date: Tue Oct 20 2026 - 04:30:35 EST
Add the VM and BO ioctls to the Tyr driver, aligning its userspace
interface with panthor.
The series is based on Danilo's `drm-file` series on
`drm-rust-next`. It also carries Sami Tolvanen's buffer
cache-management patches from
https://gitlab.freedesktop.org/panfrost/linux sami/tyr/7.3/dev.
The panthor IGT tests pass on an RK3588S device.
A branch with the full series and all prerequisites applied is
available at:
https://gitlab.freedesktop.org/alvinsun039/linux.git tyr-ioctls
Link: https://gitlab.freedesktop.org/panfrost/linux/-/merge_requests/64
Signed-off-by: Ke Sun <sunke@xxxxxxxxxx>
---
Changes in v4:
- Rework VmPool teardown: add() returns an AddError the caller owns,
a conflicting stored VM is killed with EBUSY, and remove() kills
before the ID is reused (Daniel, Deborah).
- Wrap dev_dma_attr in a DmaAttr type with dma_attr()/is_coherent()
and rename the patch accordingly (Danilo).
- Fetch the sg_table unconditionally in new_object() and drop the
conditional flush call (Daniel).
- Use dev_dbg!() instead of dev_err!() for user-input validation and
EOPNOTSUPP for the async VM_BIND path (Daniel).
- Drop the pr_err!() calls from the VM specification patch (Daniel).
- Link to v3: https://patch.msgid.link/20260929-tyr-ioctls-v3-0-26955fb111d5@xxxxxxxxxx
Changes in v3:
- Drop the VmOwner wrapper and kill VMs explicitly on destroy and
file close (Deborah).
- Add Sami Tolvanen's buffer cache-management patches: coherent
devices map buffers cached, write-combine buffers flush at
creation, and BO_CREATE accepts WB_MMAP.
- Drop the new_dummy_object refactor; the dummy object stays a direct
Bo::new since new_object now fetches the sgtable for write-combine
buffers.
- Document the LargeSizeConstants trait in the sizes patch (Miguel).
- Misc commit message and comment cleanups.
- Link to v2: https://lore.kernel.org/r/20260908-tyr-ioctls-v2-0-88bea777df67@xxxxxxxxxx
Changes in v2:
- Fold the VM pool into vm.rs and cap it at 32 VMs per file (Deborah).
- Add VmOwner so a VM is killed exactly once on drop, regardless of
remaining references (Daniel).
- Replace the VmSpec enum with new_for_fw()/new_for_user()
constructors (Daniel).
- Parse VM_BIND op types via VmBindOpType and use the kernel
Atomic<bool> for the unusable flag (Daniel).
- Use PAGE_SIZE for the dummy object size (Daniel).
- Rename BoData::create_flags() to flags() (Daniel).
- Report VA-split failures with dev_err! at the caller.
- Link to v1: https://lore.kernel.org/r/20260902-tyr-ioctls-v1-0-e0fdbf8bd108@xxxxxxxxxx
To: Miguel Ojeda <ojeda@xxxxxxxxxx>
To: Boqun Feng <boqun@xxxxxxxxxx>
To: Gary Guo <gary@xxxxxxxxxxx>
To: Björn Roy Baron <bjorn3_gh@xxxxxxxxxxxxxx>
To: Benno Lossin <lossin@xxxxxxxxxx>
To: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
To: Alice Ryhl <aliceryhl@xxxxxxxxxx>
To: Trevor Gross <tmgross@xxxxxxxxx>
To: Danilo Krummrich <dakr@xxxxxxxxxx>
To: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
To: Tamir Duberstein <tamird@xxxxxxxxxx>
To: Alexandre Courbot <acourbot@xxxxxxxxxx>
To: Onur Özkan <work@xxxxxxxxxxxxx>
To: Lorenzo Stoakes <ljs@xxxxxxxxxx>
To: "Liam R. Howlett" <liam@xxxxxxxxxxxxx>
To: Lyude Paul <lyude@xxxxxxxxxx>
To: David Airlie <airlied@xxxxxxxxx>
To: Simona Vetter <simona@xxxxxxxx>
To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
To: "Rafael J. Wysocki" <rafael@xxxxxxxxxx>
Cc: rust-for-linux@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-mm@xxxxxxxxx
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: driver-core@xxxxxxxxxxxxxxx
---
Alvin Sun (8):
rust: sizes: add SZ_4G constant
rust: mm: add `task_size` helper
rust: sync: arc: relax `ForeignOwnable` for `Arc<T>`
drm/tyr: add per-file VM pool
drm/tyr: add user and MCU VM specifications
drm/tyr: add BO creation and lookup helpers
drm/tyr: add VM-related ioctls
drm/tyr: add BO-related ioctls
Sami Tolvanen (3):
rust: device: expose the device DMA attribute
drm/tyr: gem: flush write-combine BOs from probe-time coherence
drm/tyr: gem: map cached BOs for DRM_PANTHOR_BO_WB_MMAP
drivers/gpu/drm/tyr/driver.rs | 24 ++-
drivers/gpu/drm/tyr/file.rs | 407 +++++++++++++++++++++++++++++++++++++++-
drivers/gpu/drm/tyr/fw.rs | 21 ++-
drivers/gpu/drm/tyr/gem.rs | 76 +++++++-
drivers/gpu/drm/tyr/vm.rs | 357 +++++++++++++++++++++++++++++++++--
rust/bindings/bindings_helper.h | 1 +
rust/kernel/device.rs | 24 +++
rust/kernel/mm.rs | 7 +
rust/kernel/sizes.rs | 12 ++
rust/kernel/sync/arc.rs | 12 +-
10 files changed, 891 insertions(+), 50 deletions(-)
---
base-commit: 015bdd5eb1e4a1a35673727f294a88fb0969c77c
change-id: 20260901-tyr-ioctls-f10ef0dcbfa6
Best regards,
--
Ke Sun <sunke@xxxxxxxxxx>