STRUCT PANTHOR_GROUP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

struct panthor_group β€” the scheduling group object, bestie πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

struct panthor_group {
    struct kref refcount;
    struct panthor_device *ptdev;
    struct panthor_vm *vm;
    u64 compute_core_mask;
    u64 fragment_core_mask;
    u64 tiler_core_mask;
    u8 max_compute_cores;
    u8 max_fragment_cores;
    u8 max_tiler_cores;
    u8 priority;
    u32 blocked_queues;
    u32 idle_queues;
    spinlock_t fatal_lock;
    u32 fatal_queues;
    atomic_t tiler_oom;
    u32 queue_count;
    struct panthor_queue *queues[MAX_CS_PER_CSG];
    int csg_id;
    bool destroyed;
    bool timedout;
    bool innocent;
    struct panthor_kernel_bo *syncobjs;
    struct {
      struct panthor_gpu_usage data;
      spinlock_t lock;
      size_t kbo_sizes;
    } fdinfo;
    struct {
      pid_t pid;
      char comm[TASK_COMM_LEN];
    } task_info;
    enum panthor_group_state state;
    struct panthor_kernel_bo *suspend_buf;
    struct panthor_kernel_bo *protm_suspend_buf;
    struct work_struct sync_upd_work;
    struct work_struct tiler_oom_work;
    struct work_struct term_work;
    struct work_struct release_work;
    struct list_head run_node;
    struct list_head wait_node;
 };

πŸ’… MEMBERS πŸ’…

okay so this is the part where we meet every single member, no skipping, no cap 🫢

  • refcount β€” the reference count, literally keeping this whole thing alive bestie πŸ’–
  • ptdev β€” the Device, periodt.
  • vm β€” the VM that's bound to the group, slay.
  • compute_core_mask β€” mask of shader cores that can be used for compute jobs ✨
  • fragment_core_mask β€” mask of shader cores that can be used for fragment jobs 🌸
  • tiler_core_mask β€” mask of tiler cores that can be used for tiler jobs πŸŽ€
  • max_compute_cores β€” max number of shader cores used for compute jobs πŸ‘‘
  • max_fragment_cores β€” max number of shader cores used for fragment jobs πŸ’œ
  • max_tiler_cores β€” max number of tiler cores used for tiler jobs ⭐
  • priority β€” group priority (check panthor_csg_priority), iykyk.
  • blocked_queues β€” bitmask reflecting the blocked queues πŸ™ˆ
  • idle_queues β€” bitmask reflecting the idle queues 😴
  • fatal_lock β€” lock used to protect access to fatal fields πŸ”₯
  • fatal_queues β€” bitmask reflecting the queues that hit a fatal exception πŸ’€
  • tiler_oom β€” mask of queues that have a tiler OOM event to process 😭
  • queue_count β€” number of queues in this group, fr fr.
  • queues β€” queues owned by this group πŸ¦‹
  • csg_id β€” ID of the FW group slot.

It's -1 when the group is not scheduled/active.

  • destroyed β€” true when the group has been destroyed.

If a group is destroyed it becomes useless: no further jobs can be submitted to its queues. We simply wait for all references to be dropped so we can release the group object.

  • timedout β€” true when a timeout occurred on any of the queues owned by this group.

Timeouts can be reported by drm_sched or by the FW. If a reset is required, and the group can't be suspended, this also leads to a timeout. In any case, any timeout situation is unrecoverable, and the group becomes useless. We simply wait for all references to be dropped so we can release the group object.

lowkey important: a timed-out group is done for, no coming back 😭
  • innocent β€” true when the group becomes unusable because the group suspension failed during a reset.

Sometimes the FW was put in a bad state by other groups, causing the group suspension happening in the reset path to fail. In that case, we consider the group innocent πŸ₯Ί

  • syncobjs β€” pool of per-queue synchronization objects.

One sync object per queue. The position of the sync object is determined by the queue index.

  • fdinfo β€” per-file info exposed through /proc/<process>/fdinfo πŸ‘€
  • fdinfo.data β€” total sampled values for jobs in queues from this group.
  • fdinfo.lock β€” spinlock to govern concurrent access from drm file's fdinfo callback and job post-completion processing function πŸ”’
  • fdinfo.kbo_sizes β€” aggregate size of private kernel BO's held by the group.
  • task_info β€” info of current->group_leader that created the group 🫢
  • task_info.pid β€” pid of current->group_leader
  • task_info.comm β€” comm of current->group_leader
  • state β€” group state, the main character energy of this struct ✨
  • suspend_buf β€” suspend buffer.

Stores the state of the group and its queues when a group is suspended. Used at resume time to restore the group in its previous state.

The size of the suspend buffer is exposed through the FW interface.

  • protm_suspend_buf β€” protection mode suspend buffer.

Stores the state of the group and its queues when a group that's in protection mode is suspended.

Used at resume time to restore the group in its previous state.

The size of the protection mode suspend buffer is exposed through the FW interface.

  • sync_upd_work β€” work used to check/signal job fences 🌈
  • tiler_oom_work β€” work used to process tiler OOM events happening on this group πŸ˜΅β€πŸ’«
  • term_work β€” work used to finish the group termination procedure 🧚
  • release_work β€” work used to release group resources.

We need to postpone the group release to avoid a deadlock when the last ref is released in the tick work.

bestie this is the "don't deadlock urself" work item, respect it πŸ’€
  • run_node β€” node used to insert the group in the panthor_group::groups::{runnable,idle} and panthor_group::reset.stopped_groups lists πŸ”₯
  • wait_node β€” node used to insert the group in the panthor_group::groups::waiting list 🌸

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/gpu/drm/panthor/panthor_sched.c


that's the whole page bestie, hope it ate πŸ’– this lil manual situation lives in ./drivers/gpu/drm/panthor, dated October 2026, and it's literally titled struct panthor_group(9) β€” go off, king πŸ‘‘βœ¨

πŸ“¦ where this page comes from