Lines Matching full:safety
219 // SAFETY:
233 // SAFETY: `raw_drm` is a valid pointer to `Self`, given that `__drm_dev_alloc` was
237 // SAFETY: `raw_drm` is a valid pointer to `Self`.
240 // SAFETY:
244 // SAFETY: `__drm_dev_alloc()` was successful, hence `drm_dev` must be valid and the
249 // SAFETY: `drm_dev` is still private to this function.
252 // SAFETY: `raw_drm` is valid; no concurrent access before registration.
255 // SAFETY: The reference count is one, and now we take ownership of that reference as a
287 /// # Safety
291 // SAFETY: By the safety requirements of this function `ptr` is a valid pointer to a
296 /// # Safety
300 // SAFETY: By the safety requirements of this function, `ptr` is a valid pointer to `Self`.
306 /// # Safety
317 // SAFETY: By the safety requirements of this function `ptr` is a valid pointer to a
321 // SAFETY: `ptr` is valid by the safety requirements of this function.
326 // SAFETY: `ptr` is a valid pointer to a `struct drm_device` and embedded in `Self`.
329 // SAFETY:
337 /// # Safety
342 // SAFETY: The data layout is identical via our type invariants.
356 // SAFETY: `self.as_raw()` is a valid pointer to a `struct drm_device`.
364 // SAFETY: See INVARIANT above; the `Registered` context invariant holds.
397 /// # Safety
404 // SAFETY:
425 // SAFETY: `Registered` guarantees the device is registered and the parent bus device is
445 // SAFETY: `self.idx` was returned by a successful `drm_dev_enter()` call, as guaranteed
464 // SAFETY: The caller holds a `Device<T, Registered>`, which guarantees all invariants
475 // SAFETY: The caller holds a `Device<T, Ioctl>`, which guarantees all invariants
481 // SAFETY: DRM device objects are always reference counted and the get/put functions
485 // SAFETY: The existence of a shared reference guarantees that the refcount is non-zero.
490 // SAFETY: `obj` is a valid pointer to `Self`.
493 // SAFETY: The safety requirements guarantee that the refcount is non-zero.
500 // SAFETY: `bindings::drm_device::dev` is valid as long as the DRM device itself is valid,
504 // SAFETY: The DRM device was constructed in `UnregisteredDevice::new()` with a parent
515 // SAFETY: A `Device<T, Registered>` guarantees that the parent device is bound.
518 // SAFETY: The DRM device was constructed in `UnregisteredDevice::new()` with a parent
524 // SAFETY: A `drm::Device` can be released from any thread.
527 // SAFETY: A `drm::Device` can be shared among threads because all immutable methods are protected
543 // SAFETY:
560 // SAFETY: The caller promises that `ptr` points to a valid `Device<T, C>`.
563 // SAFETY: `data_ptr` is a valid pointer to `T::Data`.
568 // SAFETY: The caller promises that `ptr` points at a `Work` field in
572 // SAFETY: `T::Data` is stored as the `data` field in `Device<T, C>`.
577 // SAFETY: Our `HasWork<T, ID>` implementation returns a `work_struct` that is