drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h- Extension
.h- Size
- 46875 bytes
- Lines
- 1525
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/suspend.hlinux/sync_file.hlinux/hashtable.hdrm/drm_auth.hdrm/drm_device.hdrm/drm_file.hdrm/drm_print.hdrm/drm_rect.hdrm/ttm/ttm_execbuf_util.hdrm/ttm/ttm_tt.hdrm/ttm/ttm_placement.hdrm/ttm/ttm_bo.httm_object.hvmwgfx_fence.hvmwgfx_reg.hvmwgfx_validation.hdrm/vmwgfx_drm.h
Detected Declarations
struct vmw_fprivstruct vmwgfx_hash_itemstruct vmw_res_funcstruct vmw_bostruct vmw_bostruct vmw_resource_dirtystruct vmw_resourcestruct vmw_cmdbuf_res_managerstruct vmw_cursor_snooperstruct vmw_framebufferstruct vmw_surface_offsetstruct vmw_surface_metadatastruct vmw_surfacestruct vmw_fifo_statestruct vmw_res_cache_entrystruct vmw_sg_tablestruct vmw_piterstruct vmw_ttm_ttstruct vmw_validation_contextstruct vmw_ctx_validation_infostruct vmw_sw_contextstruct vmw_legacy_displaystruct vmw_overlaystruct vmw_otablestruct vmw_otable_batchstruct vmw_privatestruct vmw_user_objectstruct vmw_user_resource_convstruct vmw_bo_paramsstruct vmw_mobstruct vmw_ctx_binding_statestruct vmw_cmdbuf_manstruct vmw_cmdbuf_headerstruct vmw_diff_cpyenum vmw_res_typeenum vmw_cmdbuf_res_typeenum vmw_dma_map_modeenum vmw_display_unit_typeenum vmw_sm_typefunction vmw_is_svga_v3function vmw_writefunction vmw_readfunction has_sm4_contextfunction has_sm4_1_contextfunction has_sm5_contextfunction has_gl43_contextfunction vmw_max_num_uavsfunction vmw_resource_mob_attached
Annotated Snippet
struct vmw_fpriv {
struct ttm_object_file *tfile;
bool gb_aware; /* user-space is guest-backed aware */
};
struct vmwgfx_hash_item {
struct hlist_node head;
unsigned long key;
};
struct vmw_res_func;
struct vmw_bo;
struct vmw_bo;
struct vmw_resource_dirty;
/**
* struct vmw_resource - base class for hardware resources
*
* @kref: For refcounting.
* @dev_priv: Pointer to the device private for this resource. Immutable.
* @id: Device id. Protected by @dev_priv::resource_lock.
* @used_prio: Priority for this resource.
* @guest_memory_size: Guest memory buffer size. Immutable.
* @res_dirty: Resource contains data not yet in the guest memory buffer.
* Protected by resource reserved.
* @guest_memory_dirty: Guest memory buffer contains data not yet in the HW
* resource. Protected by resource reserved.
* @coherent: Emulate coherency by tracking vm accesses.
* @guest_memory_bo: The guest memory buffer if any. Protected by resource
* reserved.
* @guest_memory_offset: Offset into the guest memory buffer if any. Protected
* by resource reserved. Note that only a few resource types can have a
* @guest_memory_offset different from zero.
* @pin_count: The pin count for this resource. A pinned resource has a
* pin-count greater than zero. It is not on the resource LRU lists and its
* guest memory buffer is pinned. Hence it can't be evicted.
* @func: Method vtable for this resource. Immutable.
* @mob_node: Node for the MOB guest memory rbtree. Protected by
* @guest_memory_bo reserved.
* @lru_head: List head for the LRU list. Protected by @dev_priv::resource_lock.
* @binding_head: List head for the context binding list. Protected by
* the @dev_priv::binding_mutex
* @dirty: resource's dirty tracker
* @res_free: The resource destructor.
* @hw_destroy: Callback to destroy the resource on the device, as part of
* resource destruction.
*/
struct vmw_resource {
struct kref kref;
struct vmw_private *dev_priv;
int id;
u32 used_prio;
unsigned long guest_memory_size;
u32 res_dirty : 1;
u32 guest_memory_dirty : 1;
u32 coherent : 1;
struct vmw_bo *guest_memory_bo;
unsigned long guest_memory_offset;
unsigned long pin_count;
const struct vmw_res_func *func;
struct rb_node mob_node;
struct list_head lru_head;
struct list_head binding_head;
struct vmw_resource_dirty *dirty;
void (*res_free) (struct vmw_resource *res);
void (*hw_destroy) (struct vmw_resource *res);
};
/*
* Resources that are managed using ioctls.
*/
enum vmw_res_type {
vmw_res_context,
vmw_res_surface,
vmw_res_stream,
vmw_res_shader,
vmw_res_dx_context,
vmw_res_cotable,
vmw_res_view,
vmw_res_streamoutput,
vmw_res_max
};
/*
* Resources that are managed using command streams.
*/
enum vmw_cmdbuf_res_type {
vmw_cmdbuf_res_shader,
Annotation
- Immediate include surface: `linux/suspend.h`, `linux/sync_file.h`, `linux/hashtable.h`, `drm/drm_auth.h`, `drm/drm_device.h`, `drm/drm_file.h`, `drm/drm_print.h`, `drm/drm_rect.h`.
- Detected declarations: `struct vmw_fpriv`, `struct vmwgfx_hash_item`, `struct vmw_res_func`, `struct vmw_bo`, `struct vmw_bo`, `struct vmw_resource_dirty`, `struct vmw_resource`, `struct vmw_cmdbuf_res_manager`, `struct vmw_cursor_snooper`, `struct vmw_framebuffer`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.