Skip to content

DRM Rust abstractions and Nova

Danilo Krummrich dri-devel nouveau rust-for-linux 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 11 repliesIn review
  2. v1 RFC8 patches 42 repliesSuperseded

Changes in v2 from the cover letter

==============
- split up the DRM device / driver abstractions in three separate commits
- separate struct drm_device abstraction in a separte source file more cleanly
- switch struct drm_driver and struct file_operations to 'static const' allocations
- implement Registration::new_foreign_owned (using Devres), such that we don't need to keep the Registration alive on the Rust side, but automatically revoke it on device unbind
- add missing DRM driver features (Rob)
- use module_pci_driver! macro in Nova
- use a const sized pci::Bar in Nova
- increase the total amount of Documentation, rephrase some safety comments and commit messages for less ambiguity
- fix compilation issues with some documentation example

[1] https://lore.kernel.org/dri-devel/Zfsj0_tb-0-tNrJy@cassiopeiae/T/#u
[2] Reply to this mail titled "Device / Driver and PCI Rust abstractions".
[3] https://gitlab.freedesktop.org/drm/misc/kernel/-/tree/topic/rust-drm
[4] https://gitlab.freedesktop.org/drm/nova/-/tree/nova-next

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8rust: drm: ioctl: Add DRM ioctl abstractionrust/bindings/bindings_helper.h rust/kernel/drm/ioctl.rs rust/kernel/drm/mod.rs +2 more+162 -02 replies
2/8rust: Add a Sealed traitrust/kernel/lib.rs+5 -00 replies
3/8rust: drm: add driver abstractionsrust/bindings/bindings_helper.h rust/kernel/drm/drv.rs rust/kernel/drm/mod.rs+143 -05 replies
4/8rust: drm: add device abstractionrust/bindings/bindings_helper.h rust/kernel/drm/device.rs rust/kernel/drm/mod.rs+182 -00 replies
5/8rust: drm: add DRM driver registrationrust/kernel/drm/drv.rs+56 -11 reply
6/8rust: drm: file: Add File abstractionrust/bindings/bindings_helper.h rust/kernel/drm/device.rs rust/kernel/drm/drv.rs +2 more+123 -20 replies
7/8rust: drm: gem: Add GEM object abstractionrust/bindings/bindings_helper.h rust/helpers.c rust/kernel/drm/device.rs +3 more+438 -20 replies
8/8nova: add initial driver stubMAINTAINERS drivers/gpu/drm/Kconfig drivers/gpu/drm/Makefile +9 more+526 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/8] DRM Rust abstractions and Nova

This patch series implements some basic DRM Rust abstractions and a stub implementation of the Nova GPU driver.

Nova is intended to be developed upstream, starting out with just a stub driver to lift some initial required infrastructure upstream. A more detailed explanation can be found in [1].

This patch series is based on the "Device / Driver and PCI Rust abstractions" series [2].

The DRM bits can also be found in [3] and the Nova bits in [4].

Changes in v2:
==============
- split up the DRM device / driver abstractions in three separate commits
- separate struct drm_device abstraction in a separte source file more cleanly
- switch struct drm_driver and struct file_operations to 'static const' allocations
- implement Registration::new_foreign_owned (using Devres), such that we don't need to keep the Registration alive on the Rust side, but automatically revoke it on device unbind
- add missing DRM driver features (Rob)
- use module_pci_driver! macro in Nova
- use a const sized pci::Bar in Nova
- increase the total amount of Documentation, rephrase some safety comments and commit messages for less ambiguity
- fix compilation issues with some documentation example

[1] https://lore.kernel.org/dri-devel/Zfsj0_tb-0-tNrJy@cassiopeiae/T/#u
[2] Reply to this mail titled "Device / Driver and PCI Rust abstractions".
[3] https://gitlab.freedesktop.org/drm/misc/kernel/-/tree/topic/rust-drm
[4] https://gitlab.freedesktop.org/drm/nova/-/tree/nova-next

Asahi Lina (4):
rust: drm: ioctl: Add DRM ioctl abstraction
rust: Add a Sealed trait
rust: drm: file: Add File abstraction
rust: drm: gem: Add GEM object abstraction

Danilo Krummrich (4):
rust: drm: add driver abstractions
rust: drm: add device abstraction
rust: drm: add DRM driver registration
nova: add initial driver stub

 MAINTAINERS                     |  10 +
 drivers/gpu/drm/Kconfig         |   2 +
 drivers/gpu/drm/Makefile        |   1 +
 drivers/gpu/drm/nova/Kconfig    |  12 +
 drivers/gpu/drm/nova/Makefile   |   3 +
 drivers/gpu/drm/nova/driver.rs  |  85 +++++++
 drivers/gpu/drm/nova/file.rs    |  70 ++++++
 drivers/gpu/drm/nova/gem.rs     |  50 ++++
 drivers/gpu/drm/nova/gpu.rs     | 173 ++++++++++++++
 drivers/gpu/drm/nova/nova.rs    |  18 ++
 include/uapi/drm/nova_drm.h     | 101 ++++++++
 rust/bindings/bindings_helper.h |   5 +
 rust/helpers.c                  |  23 ++
 rust/kernel/drm/device.rs       | 182 ++++++++++++++
 rust/kernel/drm/drv.rs          | 199 ++++++++++++++++
 rust/kernel/drm/file.rs         | 116 +++++++++
 rust/kernel/drm/gem/mod.rs      | 409 ++++++++++++++++++++++++++++++++
 rust/kernel/drm/ioctl.rs        | 153 ++++++++++++
 rust/kernel/drm/mod.rs          |   9 +
 rust/kernel/lib.rs              |   7 +
 rust/uapi/uapi_helper.h         |   2 +
 21 files changed, 1630 insertions(+)
 create mode 100644 drivers/gpu/drm/nova/Kconfig
 create mode 100644 drivers/gpu/drm/nova/Makefile
 create mode 100644 drivers/gpu/drm/nova/driver.rs
 create mode 100644 drivers/gpu/drm/nova/file.rs
 create mode 100644 drivers/gpu/drm/nova/gem.rs
 create mode 100644 drivers/gpu/drm/nova/gpu.rs
 create mode 100644 drivers/gpu/drm/nova/nova.rs
 create mode 100644 include/uapi/drm/nova_drm.h
 create mode 100644 rust/kernel/drm/device.rs
 create mode 100644 rust/kernel/drm/drv.rs
 create mode 100644 rust/kernel/drm/file.rs
 create mode 100644 rust/kernel/drm/gem/mod.rs
 create mode 100644 rust/kernel/drm/ioctl.rs
 create mode 100644 rust/kernel/drm/mod.rs

base-commit: 6646240d29b11de3177f71ff777d0ae683c32623

Signature · 1 line
2.45.1