STRUCT DRM_MOCK_SCHED_JOB(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct drm_mock_sched_job β€” implements a mock GPU job ✨

okay so bestie, welcome to the struct drm_mock_sched_job(9) page from the Kernel API Manual πŸ’… this is the whole vibe of a mock GPU job, and honestly? it's giving test-harness main character energy πŸ”₯


🌸 SYNOPSIS 🌸

struct drm_mock_sched_job {
    struct drm_sched_job    base;
    struct completion       done;
  #define DRM_MOCK_SCHED_JOB_DONE                 0x1;
  #define DRM_MOCK_SCHED_JOB_TIMEDOUT             0x2;
  #define DRM_MOCK_SCHED_JOB_DONT_RESET           0x4;
  #define DRM_MOCK_SCHED_JOB_RESET_SKIPPED        0x8;
    unsigned long           flags;
    struct list_head        link;
    struct hrtimer          timer;
    unsigned int            duration_us;
    ktime_t finish_at;
    struct dma_fence        hw_fence;
    struct kunit            *test;
 };

like, that's the whole struct, no notes πŸ’–


πŸŽ€ Members πŸŽ€

  • base β€” the DRM sched job base class, aka where it gets its whole sched-job inheritance from, slay 🫢
  • done β€” a completion that signals the job is done. literally the "we're so back" notification 😭
  • flags β€” flags that designate the job's state. the little status stickers of this struct ✨
  • link β€” a list head element that the drm_mock_scheduler uses to keep track of the job. it's on the list, bestie πŸ“‹
  • timer β€” a timer used for simulating how long the job takes to execute. fake execution, real vibes ⏱️
  • duration_us β€” the simulated job duration in micro seconds, or zero if you're in manual timeline advance mode. zero means you're driving, not the timer πŸ‘‘
  • finish_at β€” the absolute time when jobs that have a duration set will complete. it's the deadline, and she knows it ⭐
  • hw_fence β€” the fence that gets returned to the DRM scheduler as the hardware fence. handing over the official receipt 🧾
  • test β€” a backpointer to the owning kunit test case. yes it knows who its parent is, it's giving very attached πŸ’€

πŸ¦‹ Description πŸ¦‹

so the Mock GPU sched job is what the test cases use to submit jobs to the mock scheduler. that's it, that's the whole job description β€” it's a fake GPU job for testing, no cap 🌈


🌟 SEE ALSO 🌟

Kernel file ./drivers/gpu/drm/scheduler/tests/sched_tests.h

go read those too, iykyk πŸ’œ


ngl this whole thing lives down in ./drivers/gpu/drm/scheduler/tests, from October 2026, in the Kernel API Manual β€” so if you ever need to find her again, that's where she's at πŸŽ€

k bye bestie, go write some tests, you're gonna ate πŸ’…βœ¨πŸ”₯

πŸ“¦ where this page comes from