STRUCT DRM_MOCK_SCHEDULER(9)
π 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 simulatedhw_timelineand thejob_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 acontext, anext_seqnoand acur_seqno, which together implement astruct dma_fencesignaling 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
- 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