Lines Matching refs:csg_id

577 	int csg_id;  member
874 drm_WARN_ON(&ptdev->base, group->csg_id >= 0); in group_release()
904 group_bind_locked(struct panthor_group *group, u32 csg_id) in group_bind_locked() argument
912 if (drm_WARN_ON(&ptdev->base, group->csg_id != -1 || csg_id >= MAX_CSGS || in group_bind_locked()
913 ptdev->scheduler->csg_slots[csg_id].group)) in group_bind_locked()
920 csg_slot = &ptdev->scheduler->csg_slots[csg_id]; in group_bind_locked()
922 group->csg_id = csg_id; in group_bind_locked()
932 group->queues[i]->doorbell_id = csg_id + 1; in group_bind_locked()
953 if (drm_WARN_ON(&ptdev->base, group->csg_id < 0 || group->csg_id >= MAX_CSGS)) in group_unbind_locked()
959 slot = &ptdev->scheduler->csg_slots[group->csg_id]; in group_unbind_locked()
961 group->csg_id = -1; in group_unbind_locked()
988 cs_slot_prog_locked(struct panthor_device *ptdev, u32 csg_id, u32 cs_id) in cs_slot_prog_locked() argument
990 struct panthor_queue *queue = ptdev->scheduler->csg_slots[csg_id].group->queues[cs_id]; in cs_slot_prog_locked()
991 struct panthor_fw_cs_iface *cs_iface = panthor_fw_get_cs_iface(ptdev, csg_id, cs_id); in cs_slot_prog_locked()
1032 cs_slot_reset_locked(struct panthor_device *ptdev, u32 csg_id, u32 cs_id) in cs_slot_reset_locked() argument
1034 struct panthor_fw_cs_iface *cs_iface = panthor_fw_get_cs_iface(ptdev, csg_id, cs_id); in cs_slot_reset_locked()
1035 struct panthor_group *group = ptdev->scheduler->csg_slots[csg_id].group; in cs_slot_reset_locked()
1066 csg_slot_sync_priority_locked(struct panthor_device *ptdev, u32 csg_id) in csg_slot_sync_priority_locked() argument
1068 struct panthor_csg_slot *csg_slot = &ptdev->scheduler->csg_slots[csg_id]; in csg_slot_sync_priority_locked()
1073 csg_iface = panthor_fw_get_csg_iface(ptdev, csg_id); in csg_slot_sync_priority_locked()
1086 cs_slot_sync_queue_state_locked(struct panthor_device *ptdev, u32 csg_id, u32 cs_id) in cs_slot_sync_queue_state_locked() argument
1088 struct panthor_group *group = ptdev->scheduler->csg_slots[csg_id].group; in cs_slot_sync_queue_state_locked()
1091 panthor_fw_get_cs_iface(group->ptdev, csg_id, cs_id); in cs_slot_sync_queue_state_locked()
1137 csg_slot_sync_queues_state_locked(struct panthor_device *ptdev, u32 csg_id) in csg_slot_sync_queues_state_locked() argument
1139 struct panthor_csg_slot *csg_slot = &ptdev->scheduler->csg_slots[csg_id]; in csg_slot_sync_queues_state_locked()
1150 cs_slot_sync_queue_state_locked(ptdev, csg_id, i); in csg_slot_sync_queues_state_locked()
1155 csg_slot_sync_state_locked(struct panthor_device *ptdev, u32 csg_id) in csg_slot_sync_state_locked() argument
1157 struct panthor_csg_slot *csg_slot = &ptdev->scheduler->csg_slots[csg_id]; in csg_slot_sync_state_locked()
1165 csg_iface = panthor_fw_get_csg_iface(ptdev, csg_id); in csg_slot_sync_state_locked()
1192 csg_id, csg_state); in csg_slot_sync_state_locked()
1207 csg_slot_sync_queues_state_locked(ptdev, csg_id); in csg_slot_sync_state_locked()
1220 cs_slot_reset_locked(ptdev, csg_id, i); in csg_slot_sync_state_locked()
1228 csg_slot_prog_locked(struct panthor_device *ptdev, u32 csg_id, u32 priority) in csg_slot_prog_locked() argument
1240 if (drm_WARN_ON(&ptdev->base, csg_id >= MAX_CSGS)) in csg_slot_prog_locked()
1243 csg_slot = &ptdev->scheduler->csg_slots[csg_id]; in csg_slot_prog_locked()
1248 csg_iface = panthor_fw_get_csg_iface(group->ptdev, csg_id); in csg_slot_prog_locked()
1252 cs_slot_prog_locked(ptdev, csg_id, i); in csg_slot_prog_locked()
1285 u32 csg_id, u32 cs_id) in cs_slot_process_fatal_event_locked() argument
1288 struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; in cs_slot_process_fatal_event_locked()
1296 cs_iface = panthor_fw_get_cs_iface(ptdev, csg_id, cs_id); in cs_slot_process_fatal_event_locked()
1318 csg_id, cs_id, in cs_slot_process_fatal_event_locked()
1327 u32 csg_id, u32 cs_id) in cs_slot_process_fault_event_locked() argument
1330 struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; in cs_slot_process_fault_event_locked()
1340 cs_iface = panthor_fw_get_cs_iface(ptdev, csg_id, cs_id); in cs_slot_process_fault_event_locked()
1366 csg_id, cs_id, in cs_slot_process_fault_event_locked()
1381 int ret, csg_id; in group_process_tiler_oom() local
1384 csg_id = group->csg_id; in group_process_tiler_oom()
1385 if (csg_id >= 0) { in group_process_tiler_oom()
1388 cs_iface = panthor_fw_get_cs_iface(ptdev, csg_id, cs_id); in group_process_tiler_oom()
1402 if (unlikely(csg_id < 0)) in group_process_tiler_oom()
1429 csg_id = group->csg_id; in group_process_tiler_oom()
1430 if (csg_id >= 0) { in group_process_tiler_oom()
1434 csg_iface = panthor_fw_get_csg_iface(ptdev, csg_id); in group_process_tiler_oom()
1435 cs_iface = panthor_fw_get_cs_iface(ptdev, csg_id, cs_id); in group_process_tiler_oom()
1441 panthor_fw_ring_csg_doorbells(ptdev, BIT(csg_id)); in group_process_tiler_oom()
1449 if (unlikely(csg_id < 0 && new_chunk_va)) in group_process_tiler_oom()
1477 u32 csg_id, u32 cs_id) in cs_slot_process_tiler_oom_event_locked() argument
1480 struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; in cs_slot_process_tiler_oom_event_locked()
1499 u32 csg_id, u32 cs_id) in cs_slot_process_irq_locked() argument
1506 cs_iface = panthor_fw_get_cs_iface(ptdev, csg_id, cs_id); in cs_slot_process_irq_locked()
1512 cs_slot_process_fatal_event_locked(ptdev, csg_id, cs_id); in cs_slot_process_irq_locked()
1515 cs_slot_process_fault_event_locked(ptdev, csg_id, cs_id); in cs_slot_process_irq_locked()
1518 cs_slot_process_tiler_oom_event_locked(ptdev, csg_id, cs_id); in cs_slot_process_irq_locked()
1528 static void csg_slot_sync_idle_state_locked(struct panthor_device *ptdev, u32 csg_id) in csg_slot_sync_idle_state_locked() argument
1530 struct panthor_csg_slot *csg_slot = &ptdev->scheduler->csg_slots[csg_id]; in csg_slot_sync_idle_state_locked()
1535 csg_iface = panthor_fw_get_csg_iface(ptdev, csg_id); in csg_slot_sync_idle_state_locked()
1539 static void csg_slot_process_idle_event_locked(struct panthor_device *ptdev, u32 csg_id) in csg_slot_process_idle_event_locked() argument
1555 u32 csg_id) in csg_slot_sync_update_locked() argument
1557 struct panthor_csg_slot *csg_slot = &ptdev->scheduler->csg_slots[csg_id]; in csg_slot_sync_update_locked()
1569 csg_slot_process_progress_timer_event_locked(struct panthor_device *ptdev, u32 csg_id) in csg_slot_process_progress_timer_event_locked() argument
1572 struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; in csg_slot_process_progress_timer_event_locked()
1577 drm_warn(&ptdev->base, "CSG slot %d progress timeout\n", csg_id); in csg_slot_process_progress_timer_event_locked()
1586 static void sched_process_csg_irq_locked(struct panthor_device *ptdev, u32 csg_id) in sched_process_csg_irq_locked() argument
1594 if (drm_WARN_ON(&ptdev->base, csg_id >= ptdev->scheduler->csg_slot_count)) in sched_process_csg_irq_locked()
1597 csg_iface = panthor_fw_get_csg_iface(ptdev, csg_id); in sched_process_csg_irq_locked()
1622 csg_slot_process_idle_event_locked(ptdev, csg_id); in sched_process_csg_irq_locked()
1625 csg_slot_process_progress_timer_event_locked(ptdev, csg_id); in sched_process_csg_irq_locked()
1631 if (cs_slot_process_irq_locked(ptdev, csg_id, cs_id)) in sched_process_csg_irq_locked()
1638 csg_slot_sync_update_locked(ptdev, csg_id); in sched_process_csg_irq_locked()
1643 panthor_fw_ring_csg_doorbells(ptdev, BIT(csg_id)); in sched_process_csg_irq_locked()
1691 u32 csg_id = ffs(events) - 1; in process_fw_events_work() local
1693 sched_process_csg_irq_locked(ptdev, csg_id); in process_fw_events_work()
1694 events &= ~BIT(csg_id); in process_fw_events_work()
1743 u32 csg_id, u32 value, u32 mask) in csgs_upd_ctx_queue_reqs() argument
1746 drm_WARN_ON(&ptdev->base, csg_id >= ptdev->scheduler->csg_slot_count)) in csgs_upd_ctx_queue_reqs()
1749 ctx->requests[csg_id].value = (ctx->requests[csg_id].value & ~mask) | (value & mask); in csgs_upd_ctx_queue_reqs()
1750 ctx->requests[csg_id].mask |= mask; in csgs_upd_ctx_queue_reqs()
1751 ctx->update_mask |= BIT(csg_id); in csgs_upd_ctx_queue_reqs()
1767 u32 csg_id = ffs(update_slots) - 1; in csgs_upd_ctx_apply_locked() local
1769 update_slots &= ~BIT(csg_id); in csgs_upd_ctx_apply_locked()
1770 csg_iface = panthor_fw_get_csg_iface(ptdev, csg_id); in csgs_upd_ctx_apply_locked()
1772 ctx->requests[csg_id].value, in csgs_upd_ctx_apply_locked()
1773 ctx->requests[csg_id].mask); in csgs_upd_ctx_apply_locked()
1781 u32 csg_id = ffs(update_slots) - 1; in csgs_upd_ctx_apply_locked() local
1782 u32 req_mask = ctx->requests[csg_id].mask, acked; in csgs_upd_ctx_apply_locked()
1785 update_slots &= ~BIT(csg_id); in csgs_upd_ctx_apply_locked()
1786 csg_iface = panthor_fw_get_csg_iface(ptdev, csg_id); in csgs_upd_ctx_apply_locked()
1788 ret = panthor_fw_csg_wait_acks(ptdev, csg_id, req_mask, &acked, 100); in csgs_upd_ctx_apply_locked()
1791 csg_slot_sync_priority_locked(ptdev, csg_id); in csgs_upd_ctx_apply_locked()
1794 csg_slot_sync_state_locked(ptdev, csg_id); in csgs_upd_ctx_apply_locked()
1797 csg_slot_sync_queues_state_locked(ptdev, csg_id); in csgs_upd_ctx_apply_locked()
1798 csg_slot_sync_idle_state_locked(ptdev, csg_id); in csgs_upd_ctx_apply_locked()
1803 drm_err(&ptdev->base, "CSG %d update request timedout", csg_id); in csgs_upd_ctx_apply_locked()
1804 ctx->timedout_mask |= BIT(csg_id); in csgs_upd_ctx_apply_locked()
1839 if (group->csg_id >= 0) in group_is_idle()
1840 return ptdev->scheduler->csg_slots[group->csg_id].idle; in group_is_idle()
1909 struct panthor_csg_slot *csg_slot = &sched->csg_slots[group->csg_id]; in tick_ctx_insert_old_group()
1927 struct panthor_csg_slot *other_csg_slot = &sched->csg_slots[other_group->csg_id]; in tick_ctx_insert_old_group()
2072 } else if (group->csg_id >= 0) { in tick_ctx_cleanup()
2092 if (group->csg_id >= 0) { in tick_ctx_cleanup()
2122 int csg_id = group->csg_id; in tick_ctx_apply() local
2124 if (drm_WARN_ON(&ptdev->base, csg_id < 0)) in tick_ctx_apply()
2127 csg_slot = &sched->csg_slots[csg_id]; in tick_ctx_apply()
2128 csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id, in tick_ctx_apply()
2136 int csg_id = group->csg_id; in tick_ctx_apply() local
2138 if (csg_id < 0) { in tick_ctx_apply()
2143 csg_slot = &sched->csg_slots[csg_id]; in tick_ctx_apply()
2144 csg_iface = panthor_fw_get_csg_iface(ptdev, csg_id); in tick_ctx_apply()
2153 csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id, in tick_ctx_apply()
2174 if (group->csg_id >= 0) in tick_ctx_apply()
2175 sched_process_csg_irq_locked(ptdev, group->csg_id); in tick_ctx_apply()
2192 int csg_id = group->csg_id; in tick_ctx_apply() local
2195 if (csg_id >= 0) { in tick_ctx_apply()
2200 csg_id = ffs(free_csg_slots) - 1; in tick_ctx_apply()
2201 if (drm_WARN_ON(&ptdev->base, csg_id < 0)) in tick_ctx_apply()
2204 csg_iface = panthor_fw_get_csg_iface(ptdev, csg_id); in tick_ctx_apply()
2205 csg_slot = &sched->csg_slots[csg_id]; in tick_ctx_apply()
2206 group_bind_locked(group, csg_id); in tick_ctx_apply()
2207 csg_slot_prog_locked(ptdev, csg_id, new_csg_prio--); in tick_ctx_apply()
2208 csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id, in tick_ctx_apply()
2212 csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id, in tick_ctx_apply()
2215 free_csg_slots &= ~BIT(csg_id); in tick_ctx_apply()
2457 if (group->csg_id < 0) { in sync_upd_work()
2643 u32 csg_id = ffs(slot_mask) - 1; in panthor_sched_suspend() local
2644 struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; in panthor_sched_suspend()
2651 csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id, in panthor_sched_suspend()
2654 slot_mask &= ~BIT(csg_id); in panthor_sched_suspend()
2661 u32 csg_id = ffs(slot_mask) - 1; in panthor_sched_suspend() local
2662 struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; in panthor_sched_suspend()
2670 slot_mask &= ~BIT(csg_id); in panthor_sched_suspend()
2685 u32 csg_id = ffs(slot_mask) - 1; in panthor_sched_suspend() local
2686 struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; in panthor_sched_suspend()
2691 csg_slot_sync_update_locked(ptdev, csg_id); in panthor_sched_suspend()
2693 slot_mask &= ~BIT(csg_id); in panthor_sched_suspend()
2706 if (group->csg_id >= 0) in panthor_sched_suspend()
2707 sched_process_csg_irq_locked(ptdev, group->csg_id); in panthor_sched_suspend()
2936 if (group->csg_id < 0) { in queue_run_job()
2990 if (group->csg_id >= 0) { in queue_timedout_job()
3129 group->csg_id = -1; in panthor_group_create()
3242 if (group->csg_id >= 0) { in panthor_group_destroy()