All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 00/10] drm/tyr: add VM and BO ioctl support
@ 2026-11-09  0:36 ` Ke Sun
  0 siblings, 0 replies; 27+ messages in thread
From: Ke Sun via B4 Relay @ 2026-11-09  0:36 UTC (permalink / raw)
  To: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, Daniel Almeida, Tamir Duberstein,
	Alexandre Courbot, Onur Özkan, Lyude Paul, David Airlie,
	Simona Vetter, Greg Kroah-Hartman, Rafael J. Wysocki,
	Johan Hovold
  Cc: Sami Tolvanen, rust-for-linux, dri-devel, driver-core, Ke Sun,
	Alvin Sun

Add the VM and BO ioctls to the Tyr driver, aligning its userspace
interface with panthor.

The series is based on v2 of Danilo's lifetime-parameterized DRM File
private data series:
https://lore.kernel.org/all/20261107021427.2105374-1-dakr@kernel.org/

It also carries Sami Tolvanen's buffer cache-management patches from
https://gitlab.freedesktop.org/panfrost/linux sami/tyr/7.3/dev.

The panthor GEM and VM IGT tests pass on an RK3588S device. The group
and dev_query tests are not supported yet.

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@kylinos.cn>
---
Changes in v6:
- Rebase onto v2 of Danilo's lifetime-parameterized DRM File private
  data series and use the Driver::File<'a> associated type instead of
  ForLt.
- Drop the unrelated Firmware::new closure rework from the VM
  specifications patch (Deborah).
- Merge the write-combine and WB_MMAP patches into one, with the full
  should_map_wc() helper in a single place (Deborah).
- Accept DRM_PANTHOR_BO_WB_MMAP directly in the BO_CREATE patch,
  reject NO_MMAP combined with WB_MMAP, and return EOPNOTSUPP for
  unsupported requests such as an exclusive VM (Deborah).
- Pass the bound device from file.inner_with() to new_object() and
  drop the unsafe as_bound() access (Deborah).
- Expose all three DmaAttr values as constants instead of providing
  is_coherent() (Deborah).
- Validate the VM id before the empty-ops early return in VM_BIND and
  reject sync objects before the size check, as in Panthor (Deborah).
- Require an exact ops stride for now, use from_safe_cast for the id
  and size conversions, and add TODO notes for variable strides and
  zerocopy FromBytes (Deborah).
- Link to v5: https://patch.msgid.link/20261027-tyr-ioctls-v5-0-59dfe98cb003@kylinos.cn

Changes in v5:
- Replace the mm-based task_size() (always returned 0) with Sami's
  CurrentTask::task_size() implementation (Deborah, Alice).
- Use from_safe_cast() for the id conversions and annotate the AddError
  fields so the VM pool patch compiles on its own (Deborah).
- Store a clone on pool conflicts and return the caller's VM instead of
  expect()-ing (Deborah).
- Drop the redundant project() in PinnedDrop (Deborah).
- Fix the rustfmt issues found in the series (Deborah).
- Link to v4: https://patch.msgid.link/20261020-tyr-ioctls-v4-0-704de77da223@kylinos.cn

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@kylinos.cn

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@kylinos.cn

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@kylinos.cn

---
Alvin Sun (7):
      rust: sizes: add SZ_4G constant
      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: task: add task_size()
      rust: device: expose the device DMA attribute
      drm/tyr: support write-combine BO mappings

 drivers/gpu/drm/tyr/driver.rs   |  25 ++-
 drivers/gpu/drm/tyr/file.rs     | 390 +++++++++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/tyr/fw.rs       |   5 +-
 drivers/gpu/drm/tyr/gem.rs      |  79 +++++++-
 drivers/gpu/drm/tyr/vm.rs       | 355 ++++++++++++++++++++++++++++++++++--
 rust/bindings/bindings_helper.h |   1 +
 rust/helpers/task.c             |   6 +
 rust/kernel/device.rs           |  27 +++
 rust/kernel/sizes.rs            |  12 ++
 rust/kernel/sync/arc.rs         |  12 +-
 rust/kernel/task.rs             |  12 ++
 11 files changed, 883 insertions(+), 41 deletions(-)
---
base-commit: cef0cd809e564cca9ac824a369c995ab7e0d16f3
change-id: 20260901-tyr-ioctls-f10ef0dcbfa6
prerequisite-message-id: <20261107021427.2105374-1-dakr@kernel.org>
prerequisite-patch-id: e17775a2fb002d71edd479f6002dc3380b9b6bb4
prerequisite-patch-id: 388c5b871c09dbb6bad46c68be04813bcbdaadb6
prerequisite-patch-id: f31098f7dcd1b2d7843767f9ef778788f8773477
prerequisite-patch-id: b0ea30b4c39e5a43e53ceaf28bd8b39db5b26a76
prerequisite-patch-id: e0735b7cd0f226e702c0edc4ed889340f93d24cf
prerequisite-patch-id: 086eb00ec9c9c445c99bbb8d1a052b3fad56b5bd
prerequisite-patch-id: d186dd1af2f3ce256afd8c7b6ff749d74def5d1a

Best regards,
--  
Ke Sun <sunke@kylinos.cn>



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

end of thread, other threads:[~2026-11-13  1:18 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-09  0:36 [PATCH v6 00/10] drm/tyr: add VM and BO ioctl support Ke Sun via B4 Relay
2026-11-09  0:36 ` Ke Sun
2026-11-09  0:36 ` [PATCH v6 01/10] rust: sizes: add SZ_4G constant Ke Sun via B4 Relay
2026-11-09  0:36   ` Ke Sun
2026-11-09  0:36 ` [PATCH v6 02/10] rust: task: add task_size() Ke Sun via B4 Relay
2026-11-09  0:36   ` Ke Sun
2026-11-09  0:36 ` [PATCH v6 03/10] rust: sync: arc: relax `ForeignOwnable` for `Arc<T>` Ke Sun via B4 Relay
2026-11-09  0:36   ` Ke Sun
2026-11-09  0:36 ` [PATCH v6 04/10] drm/tyr: add per-file VM pool Ke Sun via B4 Relay
2026-11-09  0:36   ` Ke Sun
2026-11-09  0:48   ` sashiko-bot
2026-11-13  1:17     ` Deborah Brouwer
2026-11-09  0:36 ` [PATCH v6 05/10] drm/tyr: add user and MCU VM specifications Ke Sun via B4 Relay
2026-11-09  0:36   ` Ke Sun
2026-11-09  0:36 ` [PATCH v6 06/10] drm/tyr: add BO creation and lookup helpers Ke Sun via B4 Relay
2026-11-09  0:36   ` Ke Sun
2026-11-09  0:36 ` [PATCH v6 07/10] drm/tyr: add VM-related ioctls Ke Sun via B4 Relay
2026-11-09  0:36   ` Ke Sun
2026-11-09  1:01   ` sashiko-bot
2026-11-09  0:36 ` [PATCH v6 08/10] rust: device: expose the device DMA attribute Ke Sun via B4 Relay
2026-11-09  0:36   ` Ke Sun
2026-11-09  0:36 ` [PATCH v6 09/10] drm/tyr: support write-combine BO mappings Ke Sun via B4 Relay
2026-11-09  0:36   ` Ke Sun
2026-11-09  1:10   ` sashiko-bot
2026-11-09  0:36 ` [PATCH v6 10/10] drm/tyr: add BO-related ioctls Ke Sun via B4 Relay
2026-11-09  0:36   ` Ke Sun
2026-11-09  1:05   ` sashiko-bot

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.