dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [RFC v3 00/33] Rust bindings for KMS + RVKMS
@ 2025-03-05 22:59 Lyude Paul
  2025-03-05 22:59 ` [RFC v3 01/33] rust: drm: Add a small handful of fourcc bindings Lyude Paul
                   ` (32 more replies)
  0 siblings, 33 replies; 71+ messages in thread
From: Lyude Paul @ 2025-03-05 22:59 UTC (permalink / raw)
  To: dri-devel, rust-for-linux
  Cc: Danilo Krummrich, mcanal, Alice Ryhl, Maxime Ripard,
	Simona Vetter, Daniel Almeida, Miguel Ojeda, Alex Gaynor,
	Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Trevor Gross

Hi! It's been a while but I think I'm quite happy with where this patch
series is at the moment. I've gone through most of the changes suggested
on the mailing list last, and have also gone and done quite a lot of
cleanup. Here's some of the big changes I've made across the patch
series:

* Cleaned up pretty much all of the WIP bits, I think I'm more confident with
  the design here now
* Limited the scope of the patches a bit more and removed:
  * Plane state iterators (I think people get the idea, we want these but
    there's nothing I have to use these just yet)
  * Some unused bindings for drm_format_info
* We use the faux driver subsytem now in response to some of Greg's comments
* All DRM types should have functions for converting from Opaque variants, and
  we now use a fancy macro for implementing this (this will make adding
  iterators in the future super easy as well)
* Lots of documentation cleanups
* Lots of safety comment cleanups
* Ensure type IDs for encoders, connectors, etc. are all fully defined using
  more fancy macro
* We now have special types for handling unregistered variants of mode objects,
  which fixes the last soundness issue I'm aware of.

There's a lot of other changes that I've noted in each patch as well. It's
entirely possible with how many changes that I missed some feedback along the
way, but I think I did a pretty thorough job of documenting all of the changes I
did made (thanks squash!).

The only thing I think is still up in the air is documentation - I've linked in
a few additional spots back to kernel headers/kernel documentation, but ideally
I would like us to be able to link back to the relevant C function for almost
every binding to try to slim down how much duplicate documentation we maintain.

This patch series still depends on the base branch that I've been maintaining as
we still have a handful of dependencies that I'm working on getting upstream,
you can find the base branch here:

https://gitlab.freedesktop.org/lyudess/linux/-/commits/rvkms-base

As well, you can find the previous version of this patch series here:

https://lore.kernel.org/dri-devel/C75763C3-A2A4-410F-934D-582B44A3B550@collabora.com/T/

ALSO!!!!!

Please help review it is ok if you don't know rust, or if you know rust but
don't know DRM. I honestly trust the DRM/rust community enough to know that
y'all will ask questions in earnest and I'm happy to do my best to answer them
:).

Lyude Paul (33):
  rust: drm: Add a small handful of fourcc bindings
  rust: drm: Add traits for registering KMS devices
  rust: drm/kms: Introduce the main ModeConfigObject traits
  rust: drm/kms: Add drm_connector bindings
  rust: drm/kms: Add drm_plane bindings
  rust: drm/kms: Add drm_crtc bindings
  rust: drm/kms: Add drm_encoder bindings
  rust: drm/kms: Add UnregisteredConnector::attach_encoder()
  rust: drm/kms: Add DriverConnector::get_mode callback
  rust: drm/kms: Add ConnectorGuard::add_modes_noedid()
  rust: drm/kms: Add ConnectorGuard::set_preferred_mode
  rust: drm/kms: Add RawConnector and RawConnectorState
  rust: drm/kms: Add RawPlane and RawPlaneState
  rust: drm/kms: Add OpaqueConnector and OpaqueConnectorState
  rust: drm/kms: Add OpaqueCrtc and OpaqueCrtcState
  rust: drm/kms: Add OpaquePlane and OpaquePlaneState
  rust: drm/kms: Add OpaqueEncoder
  rust: drm/kms: Add drm_atomic_state bindings
  rust: drm/kms: Add DriverCrtc::atomic_check()
  rust: drm/kms: Add DriverPlane::atomic_update()
  rust: drm/kms: Add DriverPlane::atomic_check()
  rust: drm/kms: Add RawCrtcState::active()
  rust: drm/kms: Add RawPlaneState::crtc()
  rust: drm/kms: Add RawPlaneState::atomic_helper_check()
  rust: drm/kms: Add drm_framebuffer bindings
  rust: drm/kms: Add RawPlane::framebuffer()
  rust: drm/kms: Add DriverCrtc::atomic_begin() and atomic_flush()
  rust: drm/kms: Add DriverCrtc::atomic_enable() and atomic_disable()
  rust: drm: Add Device::event_lock()
  rust: drm/kms: Add Device::num_crtcs()
  rust: drm/kms: Add VblankSupport
  rust: drm/kms: Add Kms::atomic_commit_tail
  drm: Introduce RVKMS!

 drivers/gpu/drm/Kconfig            |    2 +
 drivers/gpu/drm/Makefile           |    1 +
 drivers/gpu/drm/rvkms/Kconfig      |    3 +
 drivers/gpu/drm/rvkms/Makefile     |    1 +
 drivers/gpu/drm/rvkms/connector.rs |   55 ++
 drivers/gpu/drm/rvkms/crtc.rs      |  245 ++++++
 drivers/gpu/drm/rvkms/encoder.rs   |   31 +
 drivers/gpu/drm/rvkms/file.rs      |   19 +
 drivers/gpu/drm/rvkms/gem.rs       |   29 +
 drivers/gpu/drm/rvkms/output.rs    |   36 +
 drivers/gpu/drm/rvkms/plane.rs     |   73 ++
 drivers/gpu/drm/rvkms/rvkms.rs     |  140 ++++
 rust/bindings/bindings_helper.h    |   14 +
 rust/helpers/drm/atomic.c          |   32 +
 rust/helpers/drm/drm.c             |    5 +
 rust/helpers/drm/vblank.c          |    8 +
 rust/kernel/drm/device.rs          |   17 +-
 rust/kernel/drm/drv.rs             |   56 +-
 rust/kernel/drm/fourcc.rs          |   20 +
 rust/kernel/drm/gem/mod.rs         |    4 +
 rust/kernel/drm/gem/shmem.rs       |    4 +
 rust/kernel/drm/kms.rs             |  574 ++++++++++++++
 rust/kernel/drm/kms/atomic.rs      |  717 ++++++++++++++++++
 rust/kernel/drm/kms/connector.rs   | 1003 +++++++++++++++++++++++++
 rust/kernel/drm/kms/crtc.rs        | 1109 ++++++++++++++++++++++++++++
 rust/kernel/drm/kms/encoder.rs     |  413 +++++++++++
 rust/kernel/drm/kms/framebuffer.rs |   73 ++
 rust/kernel/drm/kms/plane.rs       | 1077 +++++++++++++++++++++++++++
 rust/kernel/drm/kms/vblank.rs      |  448 +++++++++++
 rust/kernel/drm/mod.rs             |    2 +
 30 files changed, 6202 insertions(+), 9 deletions(-)
 create mode 100644 drivers/gpu/drm/rvkms/Kconfig
 create mode 100644 drivers/gpu/drm/rvkms/Makefile
 create mode 100644 drivers/gpu/drm/rvkms/connector.rs
 create mode 100644 drivers/gpu/drm/rvkms/crtc.rs
 create mode 100644 drivers/gpu/drm/rvkms/encoder.rs
 create mode 100644 drivers/gpu/drm/rvkms/file.rs
 create mode 100644 drivers/gpu/drm/rvkms/gem.rs
 create mode 100644 drivers/gpu/drm/rvkms/output.rs
 create mode 100644 drivers/gpu/drm/rvkms/plane.rs
 create mode 100644 drivers/gpu/drm/rvkms/rvkms.rs
 create mode 100644 rust/helpers/drm/atomic.c
 create mode 100644 rust/helpers/drm/vblank.c
 create mode 100644 rust/kernel/drm/fourcc.rs
 create mode 100644 rust/kernel/drm/kms.rs
 create mode 100644 rust/kernel/drm/kms/atomic.rs
 create mode 100644 rust/kernel/drm/kms/connector.rs
 create mode 100644 rust/kernel/drm/kms/crtc.rs
 create mode 100644 rust/kernel/drm/kms/encoder.rs
 create mode 100644 rust/kernel/drm/kms/framebuffer.rs
 create mode 100644 rust/kernel/drm/kms/plane.rs
 create mode 100644 rust/kernel/drm/kms/vblank.rs

-- 
2.48.1


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

end of thread, other threads:[~2025-05-13  7:12 UTC | newest]

Thread overview: 71+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-05 22:59 [RFC v3 00/33] Rust bindings for KMS + RVKMS Lyude Paul
2025-03-05 22:59 ` [RFC v3 01/33] rust: drm: Add a small handful of fourcc bindings Lyude Paul
2025-03-07 16:32   ` Maxime Ripard
2025-05-12 11:49   ` Daniel Almeida
2025-05-13  7:11   ` Louis Chauvet
2025-03-05 22:59 ` [RFC v3 02/33] rust: drm: Add traits for registering KMS devices Lyude Paul
2025-03-14 10:05   ` Maxime Ripard
2025-03-21 22:00     ` Lyude Paul
2025-04-04 19:39   ` Louis Chauvet
2025-05-12 12:50   ` Daniel Almeida
2025-03-05 22:59 ` [RFC v3 03/33] rust: drm/kms: Introduce the main ModeConfigObject traits Lyude Paul
2025-03-14 10:44   ` Maxime Ripard
2025-03-21 23:23     ` Lyude Paul
2025-03-05 22:59 ` [RFC v3 04/33] rust: drm/kms: Add drm_connector bindings Lyude Paul
2025-03-14 11:02   ` Maxime Ripard
2025-03-21 23:35     ` Lyude Paul
2025-05-12 14:39   ` Louis Chauvet
2025-05-12 16:15   ` Daniel Almeida
2025-03-05 22:59 ` [RFC v3 05/33] rust: drm/kms: Add drm_plane bindings Lyude Paul
2025-03-14 11:37   ` Maxime Ripard
2025-03-21 23:38     ` Lyude Paul
2025-05-12 16:29   ` Daniel Almeida
2025-03-05 22:59 ` [RFC v3 06/33] rust: drm/kms: Add drm_crtc bindings Lyude Paul
2025-03-05 22:59 ` [RFC v3 07/33] rust: drm/kms: Add drm_encoder bindings Lyude Paul
2025-03-14 11:48   ` Maxime Ripard
2025-03-21 23:42     ` Lyude Paul
2025-03-05 22:59 ` [RFC v3 08/33] rust: drm/kms: Add UnregisteredConnector::attach_encoder() Lyude Paul
2025-03-05 22:59 ` [RFC v3 09/33] rust: drm/kms: Add DriverConnector::get_mode callback Lyude Paul
2025-03-14 11:57   ` Maxime Ripard
2025-03-21 23:47     ` Lyude Paul
2025-05-12 19:39   ` Daniel Almeida
2025-03-05 22:59 ` [RFC v3 10/33] rust: drm/kms: Add ConnectorGuard::add_modes_noedid() Lyude Paul
2025-03-14 12:02   ` Maxime Ripard
2025-03-21 23:50     ` Lyude Paul
2025-03-21 23:52       ` Lyude Paul
2025-03-22  3:31         ` Greg Kroah-Hartman
2025-03-25  9:43         ` Maxime Ripard
2025-03-05 22:59 ` [RFC v3 11/33] rust: drm/kms: Add ConnectorGuard::set_preferred_mode Lyude Paul
2025-03-05 22:59 ` [RFC v3 12/33] rust: drm/kms: Add RawConnector and RawConnectorState Lyude Paul
2025-03-14 12:04   ` Maxime Ripard
2025-03-25 21:55     ` Lyude Paul
2025-03-05 22:59 ` [RFC v3 13/33] rust: drm/kms: Add RawPlane and RawPlaneState Lyude Paul
2025-03-05 22:59 ` [RFC v3 14/33] rust: drm/kms: Add OpaqueConnector and OpaqueConnectorState Lyude Paul
2025-03-14 12:08   ` Maxime Ripard
2025-03-25 22:20     ` Lyude Paul
2025-03-05 22:59 ` [RFC v3 15/33] rust: drm/kms: Add OpaqueCrtc and OpaqueCrtcState Lyude Paul
2025-03-05 22:59 ` [RFC v3 16/33] rust: drm/kms: Add OpaquePlane and OpaquePlaneState Lyude Paul
2025-03-05 22:59 ` [RFC v3 17/33] rust: drm/kms: Add OpaqueEncoder Lyude Paul
2025-03-05 22:59 ` [RFC v3 18/33] rust: drm/kms: Add drm_atomic_state bindings Lyude Paul
2025-03-14 12:18   ` Maxime Ripard
2025-03-05 22:59 ` [RFC v3 19/33] rust: drm/kms: Add DriverCrtc::atomic_check() Lyude Paul
2025-03-14 12:21   ` Maxime Ripard
2025-03-26 21:18     ` Lyude Paul
2025-03-05 22:59 ` [RFC v3 20/33] rust: drm/kms: Add DriverPlane::atomic_update() Lyude Paul
2025-03-05 22:59 ` [RFC v3 21/33] rust: drm/kms: Add DriverPlane::atomic_check() Lyude Paul
2025-03-14 12:22   ` Maxime Ripard
2025-03-05 22:59 ` [RFC v3 22/33] rust: drm/kms: Add RawCrtcState::active() Lyude Paul
2025-03-05 22:59 ` [RFC v3 23/33] rust: drm/kms: Add RawPlaneState::crtc() Lyude Paul
2025-03-05 22:59 ` [RFC v3 24/33] rust: drm/kms: Add RawPlaneState::atomic_helper_check() Lyude Paul
2025-03-05 22:59 ` [RFC v3 25/33] rust: drm/kms: Add drm_framebuffer bindings Lyude Paul
2025-03-05 22:59 ` [RFC v3 26/33] rust: drm/kms: Add RawPlane::framebuffer() Lyude Paul
2025-03-05 22:59 ` [RFC v3 27/33] rust: drm/kms: Add DriverCrtc::atomic_begin() and atomic_flush() Lyude Paul
2025-03-14 12:25   ` Maxime Ripard
2025-03-05 22:59 ` [RFC v3 28/33] rust: drm/kms: Add DriverCrtc::atomic_enable() and atomic_disable() Lyude Paul
2025-03-05 22:59 ` [RFC v3 29/33] rust: drm: Add Device::event_lock() Lyude Paul
2025-03-05 22:59 ` [RFC v3 30/33] rust: drm/kms: Add Device::num_crtcs() Lyude Paul
2025-03-07 17:38   ` Maxime Ripard
2025-03-05 22:59 ` [RFC v3 31/33] rust: drm/kms: Add VblankSupport Lyude Paul
2025-03-14 12:37   ` Maxime Ripard
2025-03-05 22:59 ` [RFC v3 32/33] rust: drm/kms: Add Kms::atomic_commit_tail Lyude Paul
2025-03-05 22:59 ` [RFC v3 33/33] drm: Introduce RVKMS! Lyude Paul

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).