Commit a98a73be authored by Asahi Lina's avatar Asahi Lina Committed by Danilo Krummrich
Browse files

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: default avatarMaxime Ripard <mripard@kernel.org>
Signed-off-by: default avatarAsahi Lina <lina@asahilina.net>
Reviewed-by: default avatarAlyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: default avatarLyude 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: default avatarDanilo Krummrich <dakr@kernel.org>
parent 0600032c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment