drivers/gpu/drm/scheduler/tests/tests_scheduler.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/scheduler/tests/tests_scheduler.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/scheduler/tests/tests_scheduler.c- Extension
.c- Size
- 22932 bytes
- Lines
- 875
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/kthread.hlinux/ktime.hlinux/math64.hsched_tests.h
Detected Declarations
struct drm_sched_client_paramsstruct drm_sched_test_paramsstruct test_client_statsstruct test_clientfunction drm_sched_scheduler_initfunction drm_sched_scheduler_init2function drm_sched_scheduler_exitfunction drm_sched_scheduler_queue_overheadfunction drm_sched_scheduler_ping_pongfunction drm_sched_descfunction update_statsfunction get_stats_avgfunction drm_sched_client_workfunction client_donefunction drm_sched_scheduler_two_clients_testfunction drm_sched_scheduler_many_clients_test
Annotated Snippet
struct drm_sched_client_params {
enum drm_sched_priority priority;
unsigned int job_cnt;
unsigned int job_us;
bool sync;
unsigned int wait_us;
};
struct drm_sched_test_params {
const char *description;
unsigned int num_clients;
struct drm_sched_client_params client[2];
};
static const struct drm_sched_test_params drm_sched_cases[] = {
{
.description = "Normal priority and normal priority",
.client[0] = {
.priority = DRM_SCHED_PRIORITY_NORMAL,
.job_cnt = 1,
.job_us = 8000,
.wait_us = 0,
.sync = false,
},
.client[1] = {
.priority = DRM_SCHED_PRIORITY_NORMAL,
.job_cnt = 1,
.job_us = 8000,
.wait_us = 0,
.sync = false,
},
},
{
.description = "Normal priority and low priority",
.client[0] = {
.priority = DRM_SCHED_PRIORITY_NORMAL,
.job_cnt = 1,
.job_us = 8000,
.wait_us = 0,
.sync = false,
},
.client[1] = {
.priority = DRM_SCHED_PRIORITY_LOW,
.job_cnt = 1,
.job_us = 8000,
.wait_us = 0,
.sync = false,
},
},
{
.description = "High priority and normal priority",
.client[0] = {
.priority = DRM_SCHED_PRIORITY_HIGH,
.job_cnt = 1,
.job_us = 8000,
.wait_us = 0,
.sync = false,
},
.client[1] = {
.priority = DRM_SCHED_PRIORITY_NORMAL,
.job_cnt = 1,
.job_us = 8000,
.wait_us = 0,
.sync = false,
},
},
{
.description = "High priority and low priority",
.client[0] = {
.priority = DRM_SCHED_PRIORITY_HIGH,
.job_cnt = 1,
.job_us = 8000,
.wait_us = 0,
.sync = false,
},
.client[1] = {
.priority = DRM_SCHED_PRIORITY_LOW,
.job_cnt = 1,
.job_us = 8000,
.wait_us = 0,
.sync = false,
},
},
{
.description = "50% and 50%",
.client[0] = {
.priority = DRM_SCHED_PRIORITY_NORMAL,
.job_cnt = 1,
.job_us = 1500,
.wait_us = 1500,
Annotation
- Immediate include surface: `linux/delay.h`, `linux/kthread.h`, `linux/ktime.h`, `linux/math64.h`, `sched_tests.h`.
- Detected declarations: `struct drm_sched_client_params`, `struct drm_sched_test_params`, `struct test_client_stats`, `struct test_client`, `function drm_sched_scheduler_init`, `function drm_sched_scheduler_init2`, `function drm_sched_scheduler_exit`, `function drm_sched_scheduler_queue_overhead`, `function drm_sched_scheduler_ping_pong`, `function drm_sched_desc`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.