STRUCT XE_LRC(9)
π struct xe_lrc(9)
okay bestie, so this is from the Kernel API Manual (yes, the Kernel API Manual, we're in the big leagues now) and it's literally all about struct xe_lrc β the Logical ring context (LRC) and submission ring object. it's giving "the paperwork behind every GPU submission" energy and honestly? kind of iconic. π
β¨ NAME β¨
struct xe_lrc β the logical ring context (LRC) plus the submission ring object. that's it, that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
here's the whole struct, copied exactly because we do not mess with code in this house:
struct xe_lrc {
struct xe_bo *bo;
struct xe_bo *seqno_bo;
u32 size;
u32 replay_size;
struct xe_gt *gt;
#define XE_LRC_FLAG_INDIRECT_CTX 0x1;
#define XE_LRC_FLAG_INDIRECT_RING_STATE 0x2;
u32 flags;
struct kref refcount;
struct {
u32 size;
u32 tail;
u32 old_tail;
} ring;
u64 desc;
struct xe_hw_fence_ctx fence_ctx;
u64 ctx_timestamp;
u64 queue_timestamp;
struct {
struct xe_lrc *primary_lrc;
u8 pos;
} multi_queue;
};
like, look at those two #defines just chilling in the middle of a struct. not me being obsessed with XE_LRC_FLAG_INDIRECT_CTX being 0x1 and XE_LRC_FLAG_INDIRECT_RING_STATE being 0x2 π₯
π Members π
okay so every single field, one by one, no skipping (iykyk):
boβ the buffer object (that's memory, bestie) for the logical ring context, plus the per-process HW status page, plus the submission ring. three jobs, onebo, main character energy fr fr πseqno_boβ the buffer object (memory) holding seqno numbers. it's always in system memory, because this is a CPU-read / GPU-write path object. no cap, that's just how it lives π§sizeβ size of the lrc and the optional indirect ring statereplay_sizeβ the Size LRC needed for replaying a hang π (yes, hangs happen, we plan for them)gtβ the gt that this LRC belongs toflagsβ LRC flagsrefcountβ ref count of this lrcringβ submission ring statering.sizeβ size of submission ringring.tailβ tail of submission ringring.old_tailβ shadow of tail π» (a shadow! of the tail! we love a spooky little duplicate)descβ LRC descriptorfence_ctxβ context for hw fencectx_timestampβ readout value ofCTX_TIMESTAMPon last update β±οΈqueue_timestampβ value ofQUEUE_TIMESTAMPon last update β±οΈmulti_queueβ multi queue LRC related informationmulti_queue.primary_lrcβ Primary lrc of this multi-queue group πmulti_queue.posβ Position of LRC within the multi-queue group
π SEE ALSO π
- the Kernel file:
./drivers/gpu/drm/xe/xe_lrc_types.hβ go read it, bestie, it's the source of truth π
lowkey a note: the nested ones likering.size,ring.tail,ring.old_tail,multi_queue.primary_lrcandmulti_queue.posare their own listed members in the docs, not just me being extra. keep them all. periodt. π
okay and finally, the cute little sign-off: this page came from ./drivers/gpu/drm/xe and it's dated October 2026 β yes, 2026, she's future-dated and thriving, don't ask β¨π«Ά au revoir bestie, go forth and understand your LRCs π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms