Lines Matching full:object

25 /// GEM object functions, which must be implemented by drivers.
27 /// Parent `Driver` for this object.
30 /// Create a new driver data object for a GEM object of a given size.
33 /// Open a new handle to an existing object, associated with a File.
34 fn open(_obj: &<Self::Driver as drm::Driver>::Object, _file: &DriverFile<Self>) -> Result {
38 /// Close a handle to an existing object, associated with a File.
39 fn close(_obj: &<Self::Driver as drm::Driver>::Object, _file: &DriverFile<Self>) {}
42 /// Trait that represents a GEM object subtype
45 /// this owning object is valid.
67 let obj = unsafe { <<T::Driver as drm::Driver>::Object as IntoGEMObject>::from_raw(raw_obj) };
82 // SAFETY: `close_callback` is specified in the AllocOps structure for `Object<T>`, ensuring
83 // that `raw_obj` is indeed contained within a `Object<T>`.
84 let obj = unsafe { <<T::Driver as drm::Driver>::Object as IntoGEMObject>::from_raw(raw_obj) };
89 impl<T: DriverObject> IntoGEMObject for Object<T> {
95 // SAFETY: `obj` is guaranteed to be in an `Object<T>` via the safety contract of this
97 unsafe { &*crate::container_of!(Opaque::cast_from(self_ptr), Object<T>, obj) }
101 /// Base operations shared by all GEM object classes
103 /// Returns the size of the object in bytes.
109 /// Creates a new handle for the object associated with a given `File`
114 D: drm::Driver<Object = Self, File = F>,
125 /// Looks up an object by its handle for a given `File`.
129 D: drm::Driver<Object = Self, File = F>,
141 // - Therefore, we're guaranteed that `ptr` must be a gem object embedded within `Self`.
153 /// Creates an mmap offset to map the object from userspace.
165 /// A base GEM object.
172 pub struct Object<T: DriverObject + Send + Sync> {
178 impl<T: DriverObject> Object<T> {
197 /// Create a new GEM object.
223 /// Returns the `Device` that owns this GEM object.
227 // object lives.
228 // - The device we used for creating the gem object is passed as &drm::Device<T::Driver> to
229 // Object::<T>::new(), so we know that `T::Driver` is the right generic parameter to use
241 // SAFETY: All of our objects are of type `Object<T>`.
249 // free callback which guarantees this object has zero remaining references,
255 // SAFETY: Instances of `Object<T>` are always reference-counted.
256 unsafe impl<T: DriverObject> crate::sync::aref::AlwaysRefCounted for Object<T> {
263 // SAFETY: `obj` is a valid pointer to an `Object<T>`.
271 impl<T: DriverObject> super::private::Sealed for Object<T> {}
273 impl<T: DriverObject> Deref for Object<T> {
281 impl<T: DriverObject> AllocImpl for Object<T> {