STRUCT MSM_GPU_SUBMITQUEUE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct msm_gpu_submitqueue(9) β€” kernel API manual, but make it make sense ✨

okay bestie, welcome to section 9 of the Kernel API Manual πŸŽ€ β€” the one where we meet struct msm_gpu_submitqueue, aka a userspace created context. yes. that's the whole vibe. you make it in userspace, the kernel keeps track of it. iconic behavior honestly πŸ’–


✨ NAME ✨

struct msm_gpu_submitqueue β€” Userspace created context. that's it, that's the name, no notes 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the literal shape of it, copy it EXACTLY bestie, no freestyling πŸ™ˆ

struct msm_gpu_submitqueue {
    int id;
    u32 flags;
    u32 ring_nr;
    int faults;
    uint32_t last_fence;
    struct msm_context *ctx;
    struct list_head node;
    struct idr fence_idr;
    struct spinlock idr_lock;
    struct mutex lock;
    struct kref ref;
    struct drm_sched_entity *entity;
    struct drm_sched_entity _vm_bind_entity[0];
};

🌸 MEMBERS 🌸

okay so every single field, and what it actually does, no skips:

  • id β€” the userspace id for the submitqueue, and it's unique within the drm_file πŸ’« so like, don't try to reuse it, it's not that kind of party.
  • flags β€” userspace flags for the submitqueue, specified at creation… and lowkey they're currently unused πŸ’€ (yes the source really says "unusued", we don't fix typos here, we respect the lore).
  • ring_nr β€” the ringbuffer used by this submitqueue, which is determined by the submitqueue's priority. so priority in, ring out, main character energy πŸ‘‘
  • faults β€” the number of GPU hangs associated with this submitqueue 😭 not a flex, but a stat.
  • last_fence β€” the sequence number of the last allocated fence (for error checking) πŸ”₯
  • ctx β€” the per-drm_file context associated with the submitqueue (ie. which set of pgtables do submits jobs associated with the submitqueue use) 🧚
  • node β€” node in the context's list of submitqueues πŸŽ€ it's literally on the list.
  • fence_idr β€” maps fence-id to dma_fence for the userspace visible fence seqno, protected by the submitqueue lock πŸ”’
  • idr_lock β€” for serializing access to fence_idr. one at a time, bestie βœ‹
  • lock β€” submitqueue lock for serializing submits on a queue πŸ¦‹
  • ref β€” reference count. classic. keep it alive fr fr πŸ’œ
  • entity β€” the submit job-queue ⭐
  • _vm_bind_entity β€” used for entity pointer for VM_BIND queues 🌈 (note the [0] up there β€” yes, it's that kind of array, we don't touch it, we just respect it)

πŸ‘‘ DESCRIPTION πŸ‘‘

A submitqueue is associated with a gl context or a vk queue (or equiv) in userspace πŸ’… so like, every time your app has a context or a queue, there's a submitqueue holding its spot. periodt.


πŸ”₯ SEE ALSO πŸ”₯

go read these next, iykyk:


πŸŽ€ one last thing πŸŽ€

this whole page lives at ./drivers/gpu/drm/msm, it's from October 2026, and yes, struct msm_gpu_submitqueue(9) is the header and the footer of this masterpiece 😌 slay, go submit some queues, ily πŸ«ΆπŸ’–βœ¨

πŸ“¦ where this page comes from