]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/sched: Add internal job peek/pop API
authorTvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fri, 21 Feb 2025 10:50:33 +0000 (10:50 +0000)
committerPhilipp Stanner <phasta@kernel.org>
Mon, 24 Feb 2025 09:17:39 +0000 (10:17 +0100)
commitb6eb664d89e7ed1e3369fe2860fea31e6dc45e34
tree529fdb07484e768b7c7f6fa70f62a844c5405acf
parentacf3256160bdabcb5c07032f3bf6eb5a21f5b95f
drm/sched: Add internal job peek/pop API

Idea is to add helpers for peeking and popping jobs from entities with
the goal of decoupling the hidden assumption in the code that queue_node
is the first element in struct drm_sched_job.

That assumption usually comes in the form of:

  while ((job = to_drm_sched_job(spsc_queue_pop(&entity->job_queue))))

Which breaks if the queue_node is re-positioned due to_drm_sched_job
being implemented with a container_of.

This also allows us to remove duplicate definitions of to_drm_sched_job.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Philipp Stanner <phasta@kernel.org>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250221105038.79665-2-tvrtko.ursulin@igalia.com
drivers/gpu/drm/scheduler/sched_entity.c
drivers/gpu/drm/scheduler/sched_internal.h [new file with mode: 0644]
drivers/gpu/drm/scheduler/sched_main.c