Lines Matching refs:h2g
221 static void guc_ct_ctb_h2g_init(struct xe_device *xe, struct guc_ctb *h2g, in guc_ct_ctb_h2g_init() argument
224 h2g->info.size = CTB_H2G_BUFFER_SIZE / sizeof(u32); in guc_ct_ctb_h2g_init()
225 h2g->info.resv_space = 0; in guc_ct_ctb_h2g_init()
226 h2g->info.tail = 0; in guc_ct_ctb_h2g_init()
227 h2g->info.head = 0; in guc_ct_ctb_h2g_init()
228 h2g->info.space = CIRC_SPACE(h2g->info.tail, h2g->info.head, in guc_ct_ctb_h2g_init()
229 h2g->info.size) - in guc_ct_ctb_h2g_init()
230 h2g->info.resv_space; in guc_ct_ctb_h2g_init()
231 h2g->info.broken = false; in guc_ct_ctb_h2g_init()
233 h2g->desc = *map; in guc_ct_ctb_h2g_init()
234 xe_map_memset(xe, &h2g->desc, 0, 0, sizeof(struct guc_ct_buffer_desc)); in guc_ct_ctb_h2g_init()
236 h2g->cmds = IOSYS_MAP_INIT_OFFSET(map, CTB_DESC_SIZE * 2); in guc_ct_ctb_h2g_init()
266 size = ct->ctbs.h2g.info.size * sizeof(u32); in guc_ct_ctb_h2g_register()
398 guc_ct_ctb_h2g_init(xe, &ct->ctbs.h2g, &ct->bo->vmap); in xe_guc_ct_enable()
463 struct guc_ctb *h2g = &ct->ctbs.h2g; in h2g_has_room() local
467 if (cmd_len > h2g->info.space) { in h2g_has_room()
468 h2g->info.head = desc_read(ct_to_xe(ct), h2g, head); in h2g_has_room()
469 h2g->info.space = CIRC_SPACE(h2g->info.tail, h2g->info.head, in h2g_has_room()
470 h2g->info.size) - in h2g_has_room()
471 h2g->info.resv_space; in h2g_has_room()
472 if (cmd_len > h2g->info.space) in h2g_has_room()
502 ct->ctbs.h2g.info.space -= cmd_len; in h2g_reserve_space()
548 struct guc_ctb *h2g = &ct->ctbs.h2g; in h2g_write() local
550 u32 tail = h2g->info.tail; in h2g_write()
552 struct iosys_map map = IOSYS_MAP_INIT_OFFSET(&h2g->cmds, in h2g_write()
559 xe_gt_assert(gt, tail <= h2g->info.size); in h2g_write()
562 if (tail + full_len > h2g->info.size) { in h2g_write()
564 (h2g->info.size - tail) * sizeof(u32)); in h2g_write()
565 h2g_reserve_space(ct, (h2g->info.size - tail)); in h2g_write()
566 h2g->info.tail = 0; in h2g_write()
567 desc_write(xe, h2g, tail, h2g->info.tail); in h2g_write()
602 h2g->info.tail = (tail + full_len) % h2g->info.size; in h2g_write()
606 desc_write(xe, h2g, tail, h2g->info.tail); in h2g_write()
609 desc_read(xe, h2g, head), h2g->info.tail); in h2g_write()
648 if (unlikely(ct->ctbs.h2g.info.broken)) { in __guc_ct_send_locked()
740 struct guc_ctb *h2g = &ct->ctbs.h2g; in guc_ct_send_locked() local
745 trace_xe_guc_ct_h2g_flow_control(xe, h2g->info.head, h2g->info.tail, in guc_ct_send_locked()
746 h2g->info.size, in guc_ct_send_locked()
747 h2g->info.space, in guc_ct_send_locked()
783 ct->ctbs.h2g.info.broken = true; in guc_ct_send_locked()
849 (xe_guc_ct_enabled(ct) && !ct->ctbs.h2g.info.broken && \ in retry_failure()
1517 guc_ctb_snapshot_capture(xe, &ct->ctbs.h2g, in xe_guc_ct_snapshot_capture()
1518 &snapshot->h2g, atomic); in xe_guc_ct_snapshot_capture()
1541 guc_ctb_snapshot_print(&snapshot->h2g, p); in xe_guc_ct_snapshot_print()
1565 guc_ctb_snapshot_free(&snapshot->h2g); in xe_guc_ct_snapshot_free()