PATH:
usr
/
src
/
kernels
/
5.14.0-611.49.2.el9_7.x86_64
/
include
/
drm
// SPDX-License-Identifier: GPL-2.0 #ifndef _DRM_MANAGED_H_ #define _DRM_MANAGED_H_ #include <linux/gfp.h> #include <linux/overflow.h> #include <linux/types.h> struct drm_device; struct mutex; typedef void (*drmres_release_t)(struct drm_device *dev, void *res); /** * drmm_add_action - add a managed release action to a &drm_device * @dev: DRM device * @action: function which should be called when @dev is released * @data: opaque pointer, passed to @action * * This function adds the @release action with optional parameter @data to the * list of cleanup actions for @dev. The cleanup actions will be run in reverse * order in the final drm_dev_put() call for @dev. */ #define drmm_add_action(dev, action, data) \ __drmm_add_action(dev, action, data, #action) int __must_check __drmm_add_action(struct drm_device *dev, drmres_release_t action, void *data, const char *name); /** * drmm_add_action_or_reset - add a managed release action to a &drm_device * @dev: DRM device * @action: function which should be called when @dev is released * @data: opaque pointer, passed to @action * * Similar to drmm_add_action(), with the only difference that upon failure * @action is directly called for any cleanup work necessary on failures. */ #define drmm_add_action_or_reset(dev, action, data) \ __drmm_add_action_or_reset(dev, action, data, #action) int __must_check __drmm_add_action_or_reset(struct drm_device *dev, drmres_release_t action, void *data, const char *name); void drmm_release_action(struct drm_device *dev, drmres_release_t action, void *data); void *drmm_kmalloc(struct drm_device *dev, size_t size, gfp_t gfp) __malloc; /** * drmm_kzalloc - &drm_device managed kzalloc() * @dev: DRM device * @size: size of the memory allocation * @gfp: GFP allocation flags * * This is a &drm_device managed version of kzalloc(). The allocated memory is * automatically freed on the final drm_dev_put(). Memory can also be freed * before the final drm_dev_put() by calling drmm_kfree(). */ static inline void *drmm_kzalloc(struct drm_device *dev, size_t size, gfp_t gfp) { return drmm_kmalloc(dev, size, gfp | __GFP_ZERO); } /** * drmm_kmalloc_array - &drm_device managed kmalloc_array() * @dev: DRM device * @n: number of array elements to allocate * @size: size of array member * @flags: GFP allocation flags * * This is a &drm_device managed version of kmalloc_array(). The allocated * memory is automatically freed on the final drm_dev_put() and works exactly * like a memory allocation obtained by drmm_kmalloc(). */ static inline void *drmm_kmalloc_array(struct drm_device *dev, size_t n, size_t size, gfp_t flags) { size_t bytes; if (unlikely(check_mul_overflow(n, size, &bytes))) return NULL; return drmm_kmalloc(dev, bytes, flags); } /** * drmm_kcalloc - &drm_device managed kcalloc() * @dev: DRM device * @n: number of array elements to allocate * @size: size of array member * @flags: GFP allocation flags * * This is a &drm_device managed version of kcalloc(). The allocated memory is * automatically freed on the final drm_dev_put() and works exactly like a * memory allocation obtained by drmm_kmalloc(). */ static inline void *drmm_kcalloc(struct drm_device *dev, size_t n, size_t size, gfp_t flags) { return drmm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); } char *drmm_kstrdup(struct drm_device *dev, const char *s, gfp_t gfp); void drmm_kfree(struct drm_device *dev, void *data); void __drmm_mutex_release(struct drm_device *dev, void *res); /** * drmm_mutex_init - &drm_device-managed mutex_init() * @dev: DRM device * @lock: lock to be initialized * * Returns: * 0 on success, or a negative errno code otherwise. * * This is a &drm_device-managed version of mutex_init(). The initialized * lock is automatically destroyed on the final drm_dev_put(). */ #define drmm_mutex_init(dev, lock) ({ \ mutex_init(lock); \ drmm_add_action_or_reset(dev, __drmm_mutex_release, lock); \ }) \ void __drmm_workqueue_release(struct drm_device *device, void *wq); #define drmm_alloc_ordered_workqueue(dev, fmt, flags, args...) \ ({ \ struct workqueue_struct *wq = alloc_ordered_workqueue(fmt, flags, ##args); \ wq ? ({ \ int ret = drmm_add_action_or_reset(dev, __drmm_workqueue_release, wq); \ ret ? ERR_PTR(ret) : wq; \ }) : \ wq; \ }) #endif
[-] drm_eld.h
[edit]
[-] drm_bridge.h
[edit]
[-] spsc_queue.h
[edit]
[-] drm_gem_dma_helper.h
[edit]
[-] drm_property.h
[edit]
[-] drm_auth.h
[edit]
[-] drm_mipi_dbi.h
[edit]
[-] drm_mode_object.h
[edit]
[-] drm_pciids.h
[edit]
[+]
ttm
[-] drm_privacy_screen_machine.h
[edit]
[-] drm_fixed.h
[edit]
[-] drm_fb_helper.h
[edit]
[-] drm_gem_ttm_helper.h
[edit]
[-] drm_pagemap.h
[edit]
[-] drm_atomic_uapi.h
[edit]
[-] drm_module.h
[edit]
[+]
display
[-] drm_encoder.h
[edit]
[-] drm_file.h
[edit]
[-] drm_connector.h
[edit]
[-] drm_utils.h
[edit]
[-] drm_suballoc.h
[edit]
[+]
intel
[-] drm_audio_component.h
[edit]
[-] drm_prime.h
[edit]
[-] drm_atomic_helper.h
[edit]
[-] i915_pciids.h
[edit]
[-] drm_mipi_dsi.h
[edit]
[-] drm_writeback.h
[edit]
[-] drm_gem_framebuffer_helper.h
[edit]
[-] drm_lease.h
[edit]
[-] drm_crtc_helper.h
[edit]
[-] drm_client.h
[edit]
[-] Makefile
[edit]
[-] drm_vblank.h
[edit]
[-] drm_format_helper.h
[edit]
[-] drm_fb_dma_helper.h
[edit]
[-] drm_mode_config.h
[edit]
[-] drm_debugfs.h
[edit]
[-] drm_print.h
[edit]
[-] drm_client_event.h
[edit]
[-] drm_panel.h
[edit]
[-] drm_gem_shmem_helper.h
[edit]
[-] drm_debugfs_crc.h
[edit]
[-] drm_cache.h
[edit]
[-] drm_sysfs.h
[edit]
[+]
clients
[-] drm_edid.h
[edit]
[-] drm_modeset_helper.h
[edit]
[-] drm_atomic_state_helper.h
[edit]
[-] drm_ioctl.h
[edit]
[-] drm_blend.h
[edit]
[-] drm_gem_vram_helper.h
[edit]
[-] drm_panic.h
[edit]
[-] drm_plane_helper.h
[edit]
[-] drm_fbdev_dma.h
[edit]
[-] drm_bridge_connector.h
[edit]
[-] drm_probe_helper.h
[edit]
[-] drm_modeset_helper_vtables.h
[edit]
[-] drm_device.h
[edit]
[-] drm_exec.h
[edit]
[-] drm_atomic.h
[edit]
[-] gud.h
[edit]
[-] drm_gem.h
[edit]
[-] drm_gpuvm.h
[edit]
[-] drm_mm.h
[edit]
[-] drm_plane.h
[edit]
[-] drm_gpusvm.h
[edit]
[-] drm_simple_kms_helper.h
[edit]
[-] drm_syncobj.h
[edit]
[-] drm_gem_atomic_helper.h
[edit]
[-] drm_fbdev_shmem.h
[edit]
[-] drm_framebuffer.h
[edit]
[-] drm_accel.h
[edit]
[-] drm_self_refresh_helper.h
[edit]
[-] amd_asic_type.h
[edit]
[-] drm_privacy_screen_consumer.h
[edit]
[-] gpu_scheduler.h
[edit]
[-] drm_fbdev_ttm.h
[edit]
[-] drm_managed.h
[edit]
[-] task_barrier.h
[edit]
[-] drm_fourcc.h
[edit]
[-] drm_vblank_work.h
[edit]
[-] drm_modes.h
[edit]
[-] drm_vma_manager.h
[edit]
[-] drm_buddy.h
[edit]
[-] drm_of.h
[edit]
[+]
..
[+]
bridge
[-] drm_modeset_lock.h
[edit]
[-] drm_rect.h
[edit]
[-] drm_flip_work.h
[edit]
[-] drm_util.h
[edit]
[-] drm_damage_helper.h
[edit]
[-] drm_drv.h
[edit]
[-] drm_kunit_helpers.h
[edit]
[-] drm_color_mgmt.h
[edit]
[-] drm_crtc.h
[edit]
[-] drm_privacy_screen_driver.h
[edit]