STRUCT XE_LRC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, one bo, 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 state
  • replay_size β€” the Size LRC needed for replaying a hang 😭 (yes, hangs happen, we plan for them)
  • gt β€” the gt that this LRC belongs to
  • flags β€” LRC flags
  • refcount β€” ref count of this lrc
  • ring β€” submission ring state
  • ring.size β€” size of submission ring
  • ring.tail β€” tail of submission ring
  • ring.old_tail β€” shadow of tail πŸ‘» (a shadow! of the tail! we love a spooky little duplicate)
  • desc β€” LRC descriptor
  • fence_ctx β€” context for hw fence
  • ctx_timestamp β€” readout value of CTX_TIMESTAMP on last update ⏱️
  • queue_timestamp β€” value of QUEUE_TIMESTAMP on last update ⏱️
  • multi_queue β€” multi queue LRC related information
  • multi_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 like ring.size, ring.tail, ring.old_tail, multi_queue.primary_lrc and multi_queue.pos are 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