drivers/gpu/drm/nouveau/include/nvif/push.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/include/nvif/push.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/nouveau/include/nvif/push.h- Extension
.h- Size
- 15986 bytes
- Lines
- 370
- 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
nvif/mem.hnvif/printf.hnvhw/drf.h
Detected Declarations
struct nvif_pushfunction PUSH_WAITfunction PUSH_KICK
Annotated Snippet
struct nvif_push {
int (*wait)(struct nvif_push *push, u32 size);
void (*kick)(struct nvif_push *push);
struct nvif_mem mem;
u64 addr;
struct {
u32 get;
u32 max;
} hw;
u32 *bgn;
u32 *cur;
u32 *seg;
u32 *end;
};
static inline __must_check int
PUSH_WAIT(struct nvif_push *push, u32 size)
{
if (push->cur + size > push->end) {
int ret = push->wait(push, size);
if (ret)
return ret;
}
#ifdef CONFIG_NOUVEAU_DEBUG_PUSH
push->seg = push->cur + size;
#endif
return 0;
}
static inline int
PUSH_KICK(struct nvif_push *push)
{
if (push->cur != push->bgn) {
push->kick(push);
push->bgn = push->cur;
}
return 0;
}
#ifdef CONFIG_NOUVEAU_DEBUG_PUSH
#define PUSH_PRINTF(p,f,a...) do { \
struct nvif_push *_ppp = (p); \
u32 __o = _ppp->cur - (u32 *)_ppp->mem.object.map.ptr; \
NVIF_DEBUG(&_ppp->mem.object, "%08x: "f, __o * 4, ##a); \
(void)__o; \
} while(0)
#define PUSH_ASSERT_ON(a,b) WARN((a), b)
#else
#define PUSH_PRINTF(p,f,a...)
#define PUSH_ASSERT_ON(a, b)
#endif
#define PUSH_ASSERT(a,b) do { \
static_assert( \
__builtin_choose_expr(__builtin_constant_p(a), (a), 1), b \
); \
PUSH_ASSERT_ON(!(a), b); \
} while(0)
#define PUSH_DATA__(p,d,f,a...) do { \
struct nvif_push *_p = (p); \
u32 _d = (d); \
PUSH_ASSERT(_p->cur < _p->seg, "segment overrun"); \
PUSH_ASSERT(_p->cur < _p->end, "pushbuf overrun"); \
PUSH_PRINTF(_p, "%08x"f, _d, ##a); \
*_p->cur++ = _d; \
} while(0)
#define PUSH_DATA_(X,p,m,i0,i1,d,s,f,a...) PUSH_DATA__((p), (d), "-> "#m f, ##a)
#define PUSH_DATA(p,d) PUSH_DATA__((p), (d), " data - %s", __func__)
//XXX: error-check this against *real* pushbuffer end?
#define PUSH_RSVD(p,d) do { \
struct nvif_push *__p = (p); \
__p->seg++; \
__p->end++; \
d; \
} while(0)
#ifdef CONFIG_NOUVEAU_DEBUG_PUSH
#define PUSH_DATAp(X,p,m,i,o,d,s,f,a...) do { \
struct nvif_push *_pp = (p); \
const u32 *_dd = (d); \
u32 _s = (s), _i = (i?PUSH_##o##_INC); \
if (_s--) { \
PUSH_DATA_(X, _pp, X##m, i0, i1, *_dd++, 1, "+0x%x", 0); \
Annotation
- Immediate include surface: `nvif/mem.h`, `nvif/printf.h`, `nvhw/drf.h`.
- Detected declarations: `struct nvif_push`, `function PUSH_WAIT`, `function PUSH_KICK`.
- 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.