STRUCT DRM_MOCK_SCHEDULER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct drm_mock_scheduler(9) πŸ’…

okay so bestie, welcome to the struct drm_mock_scheduler(9) page from the Kernel API Manual β€” this is the whole entire glow-up tour of a fake-but-fabulous GPU execution engine, and yes, I'm obsessed 🫢


✨ NAME ✨

struct drm_mock_scheduler β€” it implements a trivial mock GPU execution engine. That's it, that's the vibe. A pretend little scheduler for your tests, no real hardware required, no cap πŸ’…


🌸 SYNOPSIS 🌸

struct drm_mock_scheduler {
    struct drm_gpu_scheduler base;
    struct kunit            *test;
    spinlock_t lock;
    struct list_head        job_list;
    struct {
      u64 context;
      atomic_t next_seqno;
      unsigned int    cur_seqno;
    } hw_timeline;
 };

πŸŽ€ Members πŸŽ€

  • base β€” the DRM scheduler base class, literally the whole foundation of this struct's main character energy ✨
  • test β€” a backpointer to the kunit test case that owns this thing, iykyk 🧚
  • lock β€” the lock that protects the simulated hw_timeline and the job_list. keep 'em safe, queen πŸ‘‘
  • job_list β€” the list of jobs submitted to the mock GPU. everybody queued up in here πŸ¦‹
  • hw_timeline β€” the simulated hardware timeline! it's got a context, a next_seqno and a cur_seqno, which together implement a struct dma_fence signaling the simulated job completion. so extra, so iconic πŸ”₯

⭐ Description ⭐

This trivial mock GPU execution engine tracks submitted jobs and β€” here's the slay β€” enables completing them strictly in submission order. no jumping the queue, no cutting in line, periodt πŸ’€


πŸ’– SEE ALSO πŸ’–

Kernel file ./drivers/gpu/drm/scheduler/tests/sched_tests.h and its besties: struct drm_mock_sched_entity(9), struct drm_mock_sched_job(9), drm_mock_sched_job_submit(9), drm_mock_sched_job_set_duration_us(9), drm_mock_sched_job_is_finished(9), drm_mock_sched_job_wait_finished(9), drm_mock_sched_job_wait_scheduled(9) β€” go read them all, fr fr 🌈


and that's the page bestie!! πŸ“ live from ./drivers/gpu/drm/scheduler/tests, dated October 2026, brought to you by the struct drm_mock_scheduler(9) of the Kernel API Manual πŸ’œ mwah, go write some tests ✨

πŸ“¦ where this page comes from