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.

Dependency Surface

Detected Declarations

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

Implementation Notes