include/drm/ttm/ttm_device.h
Source file repositories/reference/linux-study-clean/include/drm/ttm/ttm_device.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/ttm/ttm_device.h- Extension
.h- Size
- 8832 bytes
- Lines
- 306
- 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.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/workqueue.hdrm/ttm/ttm_allocation.hdrm/ttm/ttm_resource.hdrm/ttm/ttm_pool.h
Detected Declarations
struct ttm_devicestruct ttm_placementstruct ttm_buffer_objectstruct ttm_operation_ctxstruct ttm_device_funcsstruct ttm_devicefunction ttm_manager_typefunction ttm_set_driver_manager
Annotated Snippet
struct ttm_device_funcs {
/**
* ttm_tt_create
*
* @bo: The buffer object to create the ttm for.
* @page_flags: Page flags as identified by TTM_TT_FLAG_XX flags.
*
* Create a struct ttm_tt to back data with system memory pages.
* No pages are actually allocated.
* Returns:
* NULL: Out of memory.
*/
struct ttm_tt *(*ttm_tt_create)(struct ttm_buffer_object *bo,
uint32_t page_flags);
/**
* ttm_tt_populate
*
* @ttm: The struct ttm_tt to contain the backing pages.
*
* Allocate all backing pages
* Returns:
* -ENOMEM: Out of memory.
*/
int (*ttm_tt_populate)(struct ttm_device *bdev,
struct ttm_tt *ttm,
struct ttm_operation_ctx *ctx);
/**
* ttm_tt_unpopulate
*
* @ttm: The struct ttm_tt to contain the backing pages.
*
* Free all backing page
*/
void (*ttm_tt_unpopulate)(struct ttm_device *bdev,
struct ttm_tt *ttm);
/**
* ttm_tt_destroy
*
* @bdev: Pointer to a ttm device
* @ttm: Pointer to a struct ttm_tt.
*
* Destroy the backend. This will be call back from ttm_tt_destroy so
* don't call ttm_tt_destroy from the callback or infinite loop.
*/
void (*ttm_tt_destroy)(struct ttm_device *bdev, struct ttm_tt *ttm);
/**
* struct ttm_bo_driver member eviction_valuable
*
* @bo: the buffer object to be evicted
* @place: placement we need room for
*
* Check with the driver if it is valuable to evict a BO to make room
* for a certain placement.
*/
bool (*eviction_valuable)(struct ttm_buffer_object *bo,
const struct ttm_place *place);
/**
* struct ttm_bo_driver member evict_flags:
*
* @bo: the buffer object to be evicted
*
* Return the bo flags for a buffer which is not mapped to the hardware.
* These will be placed in proposed_flags so that when the move is
* finished, they'll end up in bo->mem.flags
* This should not cause multihop evictions, and the core will warn
* if one is proposed.
*/
void (*evict_flags)(struct ttm_buffer_object *bo,
struct ttm_placement *placement);
/**
* struct ttm_bo_driver member move:
*
* @bo: the buffer to move
* @evict: whether this motion is evicting the buffer from
* the graphics address space
* @ctx: context for this move with parameters
* @new_mem: the new memory region receiving the buffer
* @hop: placement for driver directed intermediate hop
*
* Move a buffer between two memory regions.
* Returns errno -EMULTIHOP if driver requests a hop
*/
int (*move)(struct ttm_buffer_object *bo, bool evict,
struct ttm_operation_ctx *ctx,
Annotation
- Immediate include surface: `linux/types.h`, `linux/workqueue.h`, `drm/ttm/ttm_allocation.h`, `drm/ttm/ttm_resource.h`, `drm/ttm/ttm_pool.h`.
- Detected declarations: `struct ttm_device`, `struct ttm_placement`, `struct ttm_buffer_object`, `struct ttm_operation_ctx`, `struct ttm_device_funcs`, `struct ttm_device`, `function ttm_manager_type`, `function ttm_set_driver_manager`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.