drivers/gpu/drm/panthor/panthor_sched.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/panthor/panthor_sched.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/panthor/panthor_sched.c- Extension
.c- Size
- 120808 bytes
- Lines
- 4190
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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
drm/drm_drv.hdrm/drm_exec.hdrm/drm_file.hdrm/drm_managed.hdrm/drm_print.hdrm/gpu_scheduler.hdrm/panthor_drm.hlinux/build_bug.hlinux/cleanup.hlinux/clk.hlinux/delay.hlinux/dma-mapping.hlinux/dma-resv.hlinux/firmware.hlinux/interrupt.hlinux/io.hlinux/iopoll.hlinux/iosys-map.hlinux/module.hlinux/platform_device.hlinux/pm_runtime.hlinux/rcupdate.hpanthor_devfreq.hpanthor_device.hpanthor_fw.hpanthor_fw_regs.hpanthor_gem.hpanthor_gpu.hpanthor_gpu_regs.hpanthor_heap.hpanthor_mmu.hpanthor_sched.h
Detected Declarations
struct panthor_groupstruct panthor_csg_slotstruct panthor_schedulerstruct panthor_syncobj_32bstruct panthor_syncobj_64bstruct panthor_queuestruct panthor_groupstruct panthor_job_profiling_datastruct panthor_group_poolstruct panthor_jobstruct panthor_csg_slots_upd_ctxstruct panthor_sched_tick_ctxstruct panthor_job_ringbuf_instrsstruct panthor_job_instrstruct panthor_job_cs_paramsenum panthor_csg_priorityenum panthor_group_statefunction panthor_queue_put_syncwait_objfunction panthor_queue_get_syncwait_objfunction group_free_queuefunction group_release_workfunction group_releasefunction group_putfunction group_getfunction group_bind_lockedfunction group_unbind_lockedfunction group_is_idlefunction group_can_runfunction queue_timeout_is_suspendedfunction queue_reset_timeout_lockedfunction queue_suspend_timeout_lockedfunction queue_suspend_timeoutfunction queue_resume_timeoutfunction cs_slot_prog_lockedfunction cs_slot_reset_lockedfunction csg_slot_sync_priority_lockedfunction cs_slot_sync_queue_state_lockedfunction csg_slot_sync_queues_state_lockedfunction csg_slot_sync_state_lockedfunction csg_slot_prog_lockedfunction cs_slot_process_fatal_event_lockedfunction cs_slot_process_fault_event_lockedfunction list_for_each_entryfunction group_process_tiler_oomfunction group_tiler_oom_workfunction cs_slot_process_tiler_oom_event_lockedfunction cs_slot_process_irq_lockedfunction csg_slot_process_idle_event_locked
Annotated Snippet
struct panthor_csg_slot {
/** @group: Scheduling group bound to this slot. */
struct panthor_group *group;
/** @priority: Group priority. */
u8 priority;
};
/**
* enum panthor_csg_priority - Group priority
*/
enum panthor_csg_priority {
/** @PANTHOR_CSG_PRIORITY_LOW: Low priority group. */
PANTHOR_CSG_PRIORITY_LOW = 0,
/** @PANTHOR_CSG_PRIORITY_MEDIUM: Medium priority group. */
PANTHOR_CSG_PRIORITY_MEDIUM,
/** @PANTHOR_CSG_PRIORITY_HIGH: High priority group. */
PANTHOR_CSG_PRIORITY_HIGH,
/**
* @PANTHOR_CSG_PRIORITY_RT: Real-time priority group.
*
* Real-time priority allows one to preempt scheduling of other
* non-real-time groups. When such a group becomes executable,
* it will evict the group with the lowest non-rt priority if
* there's no free group slot available.
*/
PANTHOR_CSG_PRIORITY_RT,
/** @PANTHOR_CSG_PRIORITY_COUNT: Number of priority levels. */
PANTHOR_CSG_PRIORITY_COUNT,
};
/**
* struct panthor_scheduler - Object used to manage the scheduler
*/
struct panthor_scheduler {
/** @ptdev: Device. */
struct panthor_device *ptdev;
/**
* @wq: Workqueue used by our internal scheduler logic and
* drm_gpu_scheduler.
*
* Used for the scheduler tick, group update or other kind of FW
* event processing that can't be handled in the threaded interrupt
* path. Also passed to the drm_gpu_scheduler instances embedded
* in panthor_queue.
*/
struct workqueue_struct *wq;
/**
* @heap_alloc_wq: Workqueue used to schedule tiler_oom works.
*
* We have a queue dedicated to heap chunk allocation works to avoid
* blocking the rest of the scheduler if the allocation tries to
* reclaim memory.
*/
struct workqueue_struct *heap_alloc_wq;
/** @tick_work: Work executed on a scheduling tick. */
struct delayed_work tick_work;
/**
* @sync_upd_work: Work used to process synchronization object updates.
*
* We use this work to unblock queues/groups that were waiting on a
* synchronization object.
*/
struct work_struct sync_upd_work;
/**
* @fw_events_work: Work used to process FW events outside the interrupt path.
*
* Even if the interrupt is threaded, we need any event processing
* that require taking the panthor_scheduler::lock to be processed
* outside the interrupt path so we don't block the tick logic when
* it calls panthor_fw_{csg,wait}_wait_acks(). Since most of the
* event processing requires taking this lock, we just delegate all
* FW event processing to the scheduler workqueue.
*/
struct work_struct fw_events_work;
/**
* @fw_events: Bitmask encoding pending FW events.
*/
atomic_t fw_events;
Annotation
- Immediate include surface: `drm/drm_drv.h`, `drm/drm_exec.h`, `drm/drm_file.h`, `drm/drm_managed.h`, `drm/drm_print.h`, `drm/gpu_scheduler.h`, `drm/panthor_drm.h`, `linux/build_bug.h`.
- Detected declarations: `struct panthor_group`, `struct panthor_csg_slot`, `struct panthor_scheduler`, `struct panthor_syncobj_32b`, `struct panthor_syncobj_64b`, `struct panthor_queue`, `struct panthor_group`, `struct panthor_job_profiling_data`, `struct panthor_group_pool`, `struct panthor_job`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.