Lines Matching defs:h2g
326 static void guc_ct_ctb_h2g_init(struct xe_device *xe, struct guc_ctb *h2g,
329 h2g->info.size = CTB_H2G_BUFFER_SIZE / sizeof(u32);
330 h2g->info.resv_space = 0;
331 h2g->info.tail = 0;
332 h2g->info.head = 0;
333 h2g->info.space = CIRC_SPACE(h2g->info.tail, h2g->info.head,
334 h2g->info.size) -
335 h2g->info.resv_space;
336 h2g->info.broken = false;
338 h2g->desc = *map;
339 xe_map_memset(xe, &h2g->desc, 0, 0, sizeof(struct guc_ct_buffer_desc));
341 h2g->cmds = IOSYS_MAP_INIT_OFFSET(map, CTB_H2G_BUFFER_OFFSET);
371 size = ct->ctbs.h2g.info.size * sizeof(u32);
521 guc_ct_ctb_h2g_init(xe, &ct->ctbs.h2g, &ct->bo->vmap);
536 ct->ctbs.h2g.info.broken = false;
645 struct guc_ctb *h2g = &ct->ctbs.h2g;
649 if (cmd_len > h2g->info.space) {
650 h2g->info.head = desc_read(ct_to_xe(ct), h2g, head);
652 if (h2g->info.head > h2g->info.size) {
654 u32 desc_status = desc_read(xe, h2g, status);
656 desc_write(xe, h2g, status, desc_status | GUC_CTB_STATUS_OVERFLOW);
659 h2g->info.head, h2g->info.size);
660 CT_DEAD(ct, h2g, H2G_HAS_ROOM);
664 h2g->info.space = CIRC_SPACE(h2g->info.tail, h2g->info.head,
665 h2g->info.size) -
666 h2g->info.resv_space;
667 if (cmd_len > h2g->info.space)
697 ct->ctbs.h2g.info.space -= cmd_len;
820 struct guc_ctb *h2g = &ct->ctbs.h2g;
822 u32 tail = h2g->info.tail;
824 struct iosys_map map = IOSYS_MAP_INIT_OFFSET(&h2g->cmds,
833 desc_status = desc_read(xe, h2g, status);
840 u32 desc_tail = desc_read(xe, h2g, tail);
841 u32 desc_head = desc_read(xe, h2g, head);
844 desc_write(xe, h2g, status, desc_status | GUC_CTB_STATUS_MISMATCH);
849 if (tail > h2g->info.size) {
850 desc_write(xe, h2g, status, desc_status | GUC_CTB_STATUS_OVERFLOW);
852 tail, h2g->info.size);
856 if (desc_head >= h2g->info.size) {
857 desc_write(xe, h2g, status, desc_status | GUC_CTB_STATUS_OVERFLOW);
859 desc_head, h2g->info.size);
865 if (tail + full_len > h2g->info.size) {
867 (h2g->info.size - tail) * sizeof(u32));
868 h2g_reserve_space(ct, (h2g->info.size - tail));
869 h2g->info.tail = 0;
870 desc_write(xe, h2g, tail, h2g->info.tail);
904 h2g->info.tail = (tail + full_len) % h2g->info.size;
908 desc_write(xe, h2g, tail, h2g->info.tail);
911 desc_read(xe, h2g, head), h2g->info.tail);
916 CT_DEAD(ct, &ct->ctbs.h2g, H2G_WRITE);
935 if (unlikely(ct->ctbs.h2g.info.broken)) {
1001 * wait before retry of sending h2g message
1018 struct guc_ctb *h2g = &ct->ctbs.h2g;
1023 trace_xe_guc_ct_h2g_flow_control(xe, h2g->info.head, h2g->info.tail,
1024 h2g->info.size,
1025 h2g->info.space,
1087 CT_DEAD(ct, &ct->ctbs.h2g, DEADLOCK);
1153 (xe_guc_ct_enabled(ct) && !ct->ctbs.h2g.info.broken && \
1931 guc_ctb_snapshot_capture(xe, &ct->ctbs.h2g, &snapshot->h2g);
1971 guc_ctb_snapshot_print(&snapshot->h2g, p);