diff options
| author | Asahi Lina <lina@asahilina.net> | 2025-04-11 01:55:25 +0200 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2025-04-24 14:11:58 +0200 |
| commit | a98a73be9ee9c42495690b2fe56e1ce27768289a (patch) | |
| tree | 0bff4bb62cb35944fe70b9f438a391d9766e4de8 /rust/bindings | |
| parent | 0600032c54b7adc309d334c109374433ce3ab243 (diff) | |
rust: drm: file: Add File abstraction
A DRM File is the DRM counterpart to a kernel file structure,
representing an open DRM file descriptor.
Add a Rust abstraction to allow drivers to implement their own File types
that implement the DriverFile trait.
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20250410235546.43736-7-dakr@kernel.org
[ Rework of drm::File
* switch to the Opaque<T> type
* fix (mutable) references to struct drm_file (which in this context
is UB)
* restructure and rename functions to align with common kernel
schemes
* write and fix safety and invariant comments
* remove necessity for and convert 'as' casts
* original source archive: https://archive.is/GH8oy
- Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'rust/bindings')
| -rw-r--r-- | rust/bindings/bindings_helper.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h index 280d3c3159c9..7b7c270db401 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -8,6 +8,7 @@ #include <drm/drm_device.h> #include <drm/drm_drv.h> +#include <drm/drm_file.h> #include <drm/drm_ioctl.h> #include <kunit/test.h> #include <linux/auxiliary_bus.h> |