drivers/gpu/drm/loongson/lsdc_ttm.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/loongson/lsdc_ttm.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/loongson/lsdc_ttm.h- Extension
.h- Size
- 2436 bytes
- Lines
- 100
- 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
linux/container_of.hlinux/iosys-map.hlinux/list.hdrm/drm_gem.hdrm/ttm/ttm_bo.hdrm/ttm/ttm_placement.hdrm/ttm/ttm_range_manager.hdrm/ttm/ttm_tt.h
Detected Declarations
struct lsdc_bo
Annotated Snippet
struct lsdc_bo {
struct ttm_buffer_object tbo;
/* Protected by gem.mutex */
struct list_head list;
struct iosys_map map;
unsigned int vmap_count;
/* cross device driver sharing reference count */
unsigned int sharing_count;
struct ttm_bo_kmap_obj kmap;
void *kptr;
bool is_iomem;
size_t size;
u32 initial_domain;
struct ttm_placement placement;
struct ttm_place placements[4];
};
static inline struct ttm_buffer_object *to_ttm_bo(struct drm_gem_object *gem)
{
return container_of(gem, struct ttm_buffer_object, base);
}
static inline struct lsdc_bo *to_lsdc_bo(struct ttm_buffer_object *tbo)
{
return container_of(tbo, struct lsdc_bo, tbo);
}
static inline struct lsdc_bo *gem_to_lsdc_bo(struct drm_gem_object *gem)
{
return container_of(gem, struct lsdc_bo, tbo.base);
}
const char *lsdc_mem_type_to_str(uint32_t mem_type);
const char *lsdc_domain_to_str(u32 domain);
struct lsdc_bo *lsdc_bo_create(struct drm_device *ddev,
u32 domain,
size_t size,
bool kernel,
struct sg_table *sg,
struct dma_resv *resv);
struct lsdc_bo *lsdc_bo_create_kernel_pinned(struct drm_device *ddev,
u32 domain,
size_t size);
void lsdc_bo_free_kernel_pinned(struct lsdc_bo *lbo);
int lsdc_bo_reserve(struct lsdc_bo *lbo);
void lsdc_bo_unreserve(struct lsdc_bo *lbo);
int lsdc_bo_pin(struct lsdc_bo *lbo, u32 domain, u64 *gpu_addr);
void lsdc_bo_unpin(struct lsdc_bo *lbo);
void lsdc_bo_ref(struct lsdc_bo *lbo);
void lsdc_bo_unref(struct lsdc_bo *lbo);
u64 lsdc_bo_gpu_offset(struct lsdc_bo *lbo);
size_t lsdc_bo_size(struct lsdc_bo *lbo);
int lsdc_bo_kmap(struct lsdc_bo *lbo);
void lsdc_bo_kunmap(struct lsdc_bo *lbo);
void lsdc_bo_clear(struct lsdc_bo *lbo);
int lsdc_bo_evict_vram(struct drm_device *ddev);
int lsdc_ttm_init(struct lsdc_device *ldev);
void lsdc_ttm_debugfs_init(struct lsdc_device *ldev);
#endif
Annotation
- Immediate include surface: `linux/container_of.h`, `linux/iosys-map.h`, `linux/list.h`, `drm/drm_gem.h`, `drm/ttm/ttm_bo.h`, `drm/ttm/ttm_placement.h`, `drm/ttm/ttm_range_manager.h`, `drm/ttm/ttm_tt.h`.
- Detected declarations: `struct lsdc_bo`.
- 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.