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.

Dependency Surface

Detected Declarations

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

Implementation Notes