drivers/gpu/drm/vmwgfx/vmwgfx_validation.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/vmwgfx/vmwgfx_validation.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/vmwgfx/vmwgfx_validation.h- Extension
.h- Size
- 6992 bytes
- Lines
- 191
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/list.hlinux/hashtable.hlinux/ww_mutex.hdrm/ttm/ttm_execbuf_util.h
Detected Declarations
struct vmw_validation_contextstruct vmw_bostruct vmw_resourcestruct vmw_fence_objfunction vmw_validation_has_bosfunction vmw_validation_bo_reservefunction vmw_validation_bo_fencefunction vmw_validation_align
Annotated Snippet
struct vmw_validation_context {
struct vmw_sw_context *sw_context;
struct list_head resource_list;
struct list_head resource_ctx_list;
struct list_head bo_list;
struct list_head page_list;
struct ww_acquire_ctx ticket;
struct mutex *res_mutex;
unsigned int merge_dups;
unsigned int mem_size_left;
u8 *page_address;
};
struct vmw_bo;
struct vmw_resource;
struct vmw_fence_obj;
#if 0
/**
* DECLARE_VAL_CONTEXT - Declare a validation context with initialization
* @_name: The name of the variable
* @_sw_context: Contains the hash table used to find dups or NULL if none
* @_merge_dups: Whether to merge duplicate buffer object- or resource
* entries. If set to true, ideally a hash table pointer should be supplied
* as well unless the number of resources and buffer objects per validation
* is known to be very small
*/
#endif
#define DECLARE_VAL_CONTEXT(_name, _sw_context, _merge_dups) \
struct vmw_validation_context _name = \
{ .sw_context = _sw_context, \
.resource_list = LIST_HEAD_INIT((_name).resource_list), \
.resource_ctx_list = LIST_HEAD_INIT((_name).resource_ctx_list), \
.bo_list = LIST_HEAD_INIT((_name).bo_list), \
.page_list = LIST_HEAD_INIT((_name).page_list), \
.res_mutex = NULL, \
.merge_dups = _merge_dups, \
.mem_size_left = 0, \
}
/**
* vmw_validation_has_bos - return whether the validation context has
* any buffer objects registered.
*
* @ctx: The validation context
* Returns: Whether any buffer objects are registered
*/
static inline bool
vmw_validation_has_bos(struct vmw_validation_context *ctx)
{
return !list_empty(&ctx->bo_list);
}
/**
* vmw_validation_bo_reserve - Reserve buffer objects registered with a
* validation context
* @ctx: The validation context
* @intr: Perform waits interruptible
*
* Return: Zero on success, -ERESTARTSYS when interrupted, negative error
* code on failure
*/
static inline int
vmw_validation_bo_reserve(struct vmw_validation_context *ctx,
bool intr)
{
return ttm_eu_reserve_buffers(&ctx->ticket, &ctx->bo_list, intr,
NULL);
}
/**
* vmw_validation_bo_fence - Unreserve and fence buffer objects registered
* with a validation context
* @ctx: The validation context
*
* This function unreserves the buffer objects previously reserved using
* vmw_validation_bo_reserve, and fences them with a fence object.
*/
static inline void
vmw_validation_bo_fence(struct vmw_validation_context *ctx,
struct vmw_fence_obj *fence)
{
ttm_eu_fence_buffer_objects(&ctx->ticket, &ctx->bo_list,
(void *) fence);
}
/**
* vmw_validation_align - Align a validation memory allocation
* @val: The size to be aligned
*
Annotation
- Immediate include surface: `linux/list.h`, `linux/hashtable.h`, `linux/ww_mutex.h`, `drm/ttm/ttm_execbuf_util.h`.
- Detected declarations: `struct vmw_validation_context`, `struct vmw_bo`, `struct vmw_resource`, `struct vmw_fence_obj`, `function vmw_validation_has_bos`, `function vmw_validation_bo_reserve`, `function vmw_validation_bo_fence`, `function vmw_validation_align`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.