PATH:
usr
/
src
/
kernels
/
5.14.0-611.49.2.el9_7.x86_64
/
include
/
drm
/* SPDX-License-Identifier: GPL-2.0 OR MIT */ #ifndef __DRM_EXEC_H__ #define __DRM_EXEC_H__ #include <linux/compiler.h> #include <linux/ww_mutex.h> #define DRM_EXEC_INTERRUPTIBLE_WAIT BIT(0) #define DRM_EXEC_IGNORE_DUPLICATES BIT(1) struct drm_gem_object; /** * struct drm_exec - Execution context */ struct drm_exec { /** * @flags: Flags to control locking behavior */ u32 flags; /** * @ticket: WW ticket used for acquiring locks */ struct ww_acquire_ctx ticket; /** * @num_objects: number of objects locked */ unsigned int num_objects; /** * @max_objects: maximum objects in array */ unsigned int max_objects; /** * @objects: array of the locked objects */ struct drm_gem_object **objects; /** * @contended: contended GEM object we backed off for */ struct drm_gem_object *contended; /** * @prelocked: already locked GEM object due to contention */ struct drm_gem_object *prelocked; }; /** * drm_exec_obj() - Return the object for a give drm_exec index * @exec: Pointer to the drm_exec context * @index: The index. * * Return: Pointer to the locked object corresponding to @index if * index is within the number of locked objects. NULL otherwise. */ static inline struct drm_gem_object * drm_exec_obj(struct drm_exec *exec, unsigned long index) { return index < exec->num_objects ? exec->objects[index] : NULL; } /** * drm_exec_for_each_locked_object - iterate over all the locked objects * @exec: drm_exec object * @index: unsigned long index for the iteration * @obj: the current GEM object * * Iterate over all the locked GEM objects inside the drm_exec object. */ #define drm_exec_for_each_locked_object(exec, index, obj) \ for ((index) = 0; ((obj) = drm_exec_obj(exec, index)); ++(index)) /** * drm_exec_for_each_locked_object_reverse - iterate over all the locked * objects in reverse locking order * @exec: drm_exec object * @index: unsigned long index for the iteration * @obj: the current GEM object * * Iterate over all the locked GEM objects inside the drm_exec object in * reverse locking order. Note that @index may go below zero and wrap, * but that will be caught by drm_exec_obj(), returning a NULL object. */ #define drm_exec_for_each_locked_object_reverse(exec, index, obj) \ for ((index) = (exec)->num_objects - 1; \ ((obj) = drm_exec_obj(exec, index)); --(index)) /** * drm_exec_until_all_locked - loop until all GEM objects are locked * @exec: drm_exec object * * Core functionality of the drm_exec object. Loops until all GEM objects are * locked and no more contention exists. At the beginning of the loop it is * guaranteed that no GEM object is locked. * * Since labels can't be defined local to the loops body we use a jump pointer * to make sure that the retry is only used from within the loops body. */ #define drm_exec_until_all_locked(exec) \ __PASTE(__drm_exec_, __LINE__): \ for (void *__drm_exec_retry_ptr; ({ \ __drm_exec_retry_ptr = &&__PASTE(__drm_exec_, __LINE__);\ (void)__drm_exec_retry_ptr; \ drm_exec_cleanup(exec); \ });) /** * drm_exec_retry_on_contention - restart the loop to grap all locks * @exec: drm_exec object * * Control flow helper to continue when a contention was detected and we need to * clean up and re-start the loop to prepare all GEM objects. */ #define drm_exec_retry_on_contention(exec) \ do { \ if (unlikely(drm_exec_is_contended(exec))) \ goto *__drm_exec_retry_ptr; \ } while (0) /** * drm_exec_is_contended - check for contention * @exec: drm_exec object * * Returns true if the drm_exec object has run into some contention while * locking a GEM object and needs to clean up. */ static inline bool drm_exec_is_contended(struct drm_exec *exec) { return !!exec->contended; } void drm_exec_init(struct drm_exec *exec, u32 flags, unsigned nr); void drm_exec_fini(struct drm_exec *exec); bool drm_exec_cleanup(struct drm_exec *exec); int drm_exec_lock_obj(struct drm_exec *exec, struct drm_gem_object *obj); void drm_exec_unlock_obj(struct drm_exec *exec, struct drm_gem_object *obj); int drm_exec_prepare_obj(struct drm_exec *exec, struct drm_gem_object *obj, unsigned int num_fences); int drm_exec_prepare_array(struct drm_exec *exec, struct drm_gem_object **objects, unsigned int num_objects, unsigned int num_fences); #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]