STRUCT DRM_MOCK_SCHED_JOB(9)
β¨ 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β acompletionthat 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 thedrm_mock_scheduleruses 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 owningkunittest 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
struct drm_mock_scheduler(9)struct drm_mock_sched_entity(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 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
- 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