include/drm/ttm/ttm_bo.h

Source file repositories/reference/linux-study-clean/include/drm/ttm/ttm_bo.h

File Facts

System
Linux kernel
Corpus path
include/drm/ttm/ttm_bo.h
Extension
.h
Size
19048 bytes
Lines
557
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ttm_buffer_object {
	struct drm_gem_object base;

	/*
	 * Members constant at init.
	 */
	struct ttm_device *bdev;
	enum ttm_bo_type type;
	uint32_t page_alignment;
	void (*destroy) (struct ttm_buffer_object *);

	/*
	* Members not needing protection.
	*/
	struct kref kref;

	/*
	 * Members protected by the bo::resv::reserved lock.
	 */
	struct ttm_resource *resource;
	struct ttm_tt *ttm;
	bool deleted;
	struct ttm_lru_bulk_move *bulk_move;
	unsigned priority;
	unsigned pin_count;

	/**
	 * @delayed_delete: Work item used when we can't delete the BO
	 * immediately
	 */
	struct work_struct delayed_delete;

	/**
	 * @sg: external source of pages and DMA addresses, protected by the
	 * reservation lock.
	 */
	struct sg_table *sg;
};

#define TTM_BO_MAP_IOMEM_MASK 0x80

/**
 * struct ttm_bo_kmap_obj
 *
 * @virtual: The current kernel virtual address.
 * @page: The page when kmap'ing a single page.
 * @bo_kmap_type: Type of bo_kmap.
 * @bo: The TTM BO.
 *
 * Object describing a kernel mapping. Since a TTM bo may be located
 * in various memory types with various caching policies, the
 * mapping can either be an ioremap, a vmap, a kmap or part of a
 * premapped region.
 */
struct ttm_bo_kmap_obj {
	void *virtual;
	struct page *page;
	enum {
		ttm_bo_map_iomap        = 1 | TTM_BO_MAP_IOMEM_MASK,
		ttm_bo_map_vmap         = 2,
		ttm_bo_map_kmap         = 3,
		ttm_bo_map_premapped    = 4 | TTM_BO_MAP_IOMEM_MASK,
	} bo_kmap_type;
	struct ttm_buffer_object *bo;
};

/**
 * struct ttm_operation_ctx
 *
 * Context for TTM operations like changing buffer placement or general memory
 * allocation.
 */
struct ttm_operation_ctx {
	/** @interruptible: Sleep interruptible if sleeping. */
	bool interruptible;
	/** @no_wait_gpu: Return immediately if the GPU is busy. */
	bool no_wait_gpu;
	/**
	 * @gfp_retry_mayfail: Use __GFP_RETRY_MAYFAIL | __GFP_NOWARN
	 * when allocation pages. This is to avoid invoking the OOM
	 * killer when populating a buffer object, in order to
	 * forward the error for it to be dealt with.
	 */
	bool gfp_retry_mayfail;
	/**
	 * @allow_res_evict: Allow eviction of reserved BOs. Can be used
	 * when multiple BOs share the same reservation object @resv.
	 */
	bool allow_res_evict;
	/**

Annotation

Implementation Notes