drivers/gpu/drm/ttm/ttm_bo_internal.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/ttm/ttm_bo_internal.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/ttm/ttm_bo_internal.h- Extension
.h- Size
- 2012 bytes
- Lines
- 61
- 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/ttm/ttm_bo.h
Detected Declarations
function filesfunction ttm_bo_get_unless_zero
Annotated Snippet
#ifndef _TTM_BO_INTERNAL_H_
#define _TTM_BO_INTERNAL_H_
#include <drm/ttm/ttm_bo.h>
/**
* ttm_bo_get - reference a struct ttm_buffer_object
*
* @bo: The buffer object.
*/
static inline void ttm_bo_get(struct ttm_buffer_object *bo)
{
kref_get(&bo->kref);
}
/**
* ttm_bo_get_unless_zero - reference a struct ttm_buffer_object unless
* its refcount has already reached zero.
* @bo: The buffer object.
*
* Used to reference a TTM buffer object in lookups where the object is removed
* from the lookup structure during the destructor and for RCU lookups.
*
* Returns: @bo if the referencing was successful, NULL otherwise.
*/
static inline __must_check struct ttm_buffer_object *
ttm_bo_get_unless_zero(struct ttm_buffer_object *bo)
{
if (!kref_get_unless_zero(&bo->kref))
return NULL;
return bo;
}
void ttm_bo_put(struct ttm_buffer_object *bo);
#endif
Annotation
- Immediate include surface: `drm/ttm/ttm_bo.h`.
- Detected declarations: `function files`, `function ttm_bo_get_unless_zero`.
- 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.