drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/ttm/tests/ttm_kunit_helpers.h- Extension
.h- Size
- 1661 bytes
- Lines
- 53
- 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
drm/drm_drv.hdrm/ttm/ttm_device.hdrm/ttm/ttm_bo.hdrm/ttm/ttm_placement.hdrm/drm_kunit_helpers.hkunit/test.h
Detected Declarations
struct ttm_test_devices
Annotated Snippet
struct ttm_test_devices {
struct drm_device *drm;
struct device *dev;
struct ttm_device *ttm_dev;
};
/* Building blocks for test-specific init functions */
int ttm_device_kunit_init(struct ttm_test_devices *priv,
struct ttm_device *ttm,
unsigned int alloc_flags);
int ttm_device_kunit_init_bad_evict(struct ttm_test_devices *priv,
struct ttm_device *ttm);
struct ttm_buffer_object *ttm_bo_kunit_init(struct kunit *test,
struct ttm_test_devices *devs,
size_t size,
struct dma_resv *obj);
struct ttm_place *ttm_place_kunit_init(struct kunit *test, u32 mem_type,
u32 flags);
void dummy_ttm_bo_destroy(struct ttm_buffer_object *bo);
struct ttm_test_devices *ttm_test_devices_basic(struct kunit *test);
struct ttm_test_devices *ttm_test_devices_all(struct kunit *test);
void ttm_test_devices_put(struct kunit *test, struct ttm_test_devices *devs);
/* Generic init/fini for tests that only need DRM/TTM devices */
int ttm_test_devices_init(struct kunit *test);
int ttm_test_devices_all_init(struct kunit *test);
void ttm_test_devices_fini(struct kunit *test);
#endif // TTM_KUNIT_HELPERS_H
Annotation
- Immediate include surface: `drm/drm_drv.h`, `drm/ttm/ttm_device.h`, `drm/ttm/ttm_bo.h`, `drm/ttm/ttm_placement.h`, `drm/drm_kunit_helpers.h`, `kunit/test.h`.
- Detected declarations: `struct ttm_test_devices`.
- 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.