rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Danilo Krummrich <dakr@redhat.com>
To: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch,
	ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com,
	boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com,
	benno.lossin@proton.me, a.hindborg@samsung.com,
	aliceryhl@google.com, lina@asahilina.net, pstanner@redhat.com,
	ajanulgu@redhat.com, lyude@redhat.com,
	gregkh@linuxfoundation.org, robh@kernel.org,
	daniel.almeida@collabora.com
Cc: rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org,
	nouveau@lists.freedesktop.org, Danilo Krummrich <dakr@redhat.com>
Subject: [PATCH v2 0/8] DRM Rust abstractions and Nova
Date: Wed, 19 Jun 2024 01:31:36 +0200	[thread overview]
Message-ID: <20240618233324.14217-1-dakr@redhat.com> (raw)

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
-- 
2.45.1


             reply	other threads:[~2024-06-18 23:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18 23:31 Danilo Krummrich [this message]
2024-06-18 23:31 ` [PATCH v2 1/8] rust: drm: ioctl: Add DRM ioctl abstraction Danilo Krummrich
2024-09-02 16:15   ` Daniel Vetter
2024-09-03 11:17     ` Danilo Krummrich
2024-06-18 23:31 ` [PATCH v2 2/8] rust: Add a Sealed trait Danilo Krummrich
2024-06-18 23:31 ` [PATCH v2 3/8] rust: drm: add driver abstractions Danilo Krummrich
2024-09-02 16:29   ` Daniel Vetter
2024-09-03 11:04     ` Asahi Lina
2024-09-03 11:11     ` Danilo Krummrich
2024-09-03 12:39       ` Simona Vetter
2024-09-04 18:30     ` Lyude Paul
2024-06-18 23:31 ` [PATCH v2 4/8] rust: drm: add device abstraction Danilo Krummrich
2024-06-18 23:31 ` [PATCH v2 5/8] rust: drm: add DRM driver registration Danilo Krummrich
2024-07-02 17:26   ` Lyude Paul
2024-06-18 23:31 ` [PATCH v2 6/8] rust: drm: file: Add File abstraction Danilo Krummrich
2024-06-18 23:31 ` [PATCH v2 7/8] rust: drm: gem: Add GEM object abstraction Danilo Krummrich
2024-06-18 23:31 ` [PATCH v2 8/8] nova: add initial driver stub Danilo Krummrich
2024-06-18 23:31 ` [PATCH v2 10/10] " Danilo Krummrich
2024-06-18 23:42 ` Device / Driver and PCI Rust abstractions Danilo Krummrich
2024-09-02 16:40 ` [PATCH v2 0/8] DRM Rust abstractions and Nova Daniel Vetter
2024-09-03  7:32   ` Simona Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240618233324.14217-1-dakr@redhat.com \
    --to=dakr@redhat.com \
    --cc=a.hindborg@samsung.com \
    --cc=airlied@gmail.com \
    --cc=ajanulgu@redhat.com \
    --cc=alex.gaynor@gmail.com \
    --cc=aliceryhl@google.com \
    --cc=benno.lossin@proton.me \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=daniel.almeida@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=lina@asahilina.net \
    --cc=lyude@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=ojeda@kernel.org \
    --cc=pstanner@redhat.com \
    --cc=robh@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=wedsonaf@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).