File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99#include <drm/drm_device.h>
1010#include <drm/drm_drv.h>
1111#include <drm/drm_file.h>
12+ #include <drm/drm_gem.h>
1213#include <drm/drm_ioctl.h>
1314#include <linux/delay.h>
1415#include <linux/device.h>
Original file line number Diff line number Diff line change 1818 * accidentally exposed.
1919 */
2020
21+ #include <drm/drm_gem.h>
2122#include <linux/bug.h>
2223#include <linux/build_bug.h>
2324#include <linux/device.h>
@@ -422,6 +423,28 @@ resource_size_t rust_helper_resource_size(const struct resource *res)
422423}
423424EXPORT_SYMBOL_GPL (rust_helper_resource_size );
424425
426+ #ifdef CONFIG_DRM
427+
428+ void rust_helper_drm_gem_object_get (struct drm_gem_object * obj )
429+ {
430+ drm_gem_object_get (obj );
431+ }
432+ EXPORT_SYMBOL_GPL (rust_helper_drm_gem_object_get );
433+
434+ void rust_helper_drm_gem_object_put (struct drm_gem_object * obj )
435+ {
436+ drm_gem_object_put (obj );
437+ }
438+ EXPORT_SYMBOL_GPL (rust_helper_drm_gem_object_put );
439+
440+ __u64 rust_helper_drm_vma_node_offset_addr (struct drm_vma_offset_node * node )
441+ {
442+ return drm_vma_node_offset_addr (node );
443+ }
444+ EXPORT_SYMBOL_GPL (rust_helper_drm_vma_node_offset_addr );
445+
446+ #endif
447+
425448/*
426449 * We use `bindgen`'s `--size_t-is-usize` option to bind the C `size_t` type
427450 * as the Rust `usize` type, so we can use it in contexts where Rust
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ pub struct AllocOps {
120120}
121121
122122/// Trait for memory manager implementations. Implemented internally.
123- pub trait AllocImpl : Sealed {
123+ pub trait AllocImpl : Sealed + drm :: gem :: IntoGEMObject {
124124 /// The C callback operations for this memory manager.
125125 const ALLOC_OPS : AllocOps ;
126126}
@@ -256,7 +256,7 @@ impl<T: Driver> Registration<T> {
256256 drm,
257257 registered : false ,
258258 vtable,
259- fops : Default :: default ( ) , // TODO: GEM abstraction
259+ fops : drm :: gem :: create_fops ( ) ,
260260 _pin : PhantomPinned ,
261261 _p : PhantomData ,
262262 } )
You can’t perform that action at this time.
0 commit comments