Lines Matching refs:g2h

239 static void guc_ct_ctb_g2h_init(struct xe_device *xe, struct guc_ctb *g2h,  in guc_ct_ctb_g2h_init()  argument
242 g2h->info.size = CTB_G2H_BUFFER_SIZE / sizeof(u32); in guc_ct_ctb_g2h_init()
243 g2h->info.resv_space = G2H_ROOM_BUFFER_SIZE / sizeof(u32); in guc_ct_ctb_g2h_init()
244 g2h->info.head = 0; in guc_ct_ctb_g2h_init()
245 g2h->info.tail = 0; in guc_ct_ctb_g2h_init()
246 g2h->info.space = CIRC_SPACE(g2h->info.tail, g2h->info.head, in guc_ct_ctb_g2h_init()
247 g2h->info.size) - in guc_ct_ctb_g2h_init()
248 g2h->info.resv_space; in guc_ct_ctb_g2h_init()
249 g2h->info.broken = false; in guc_ct_ctb_g2h_init()
251 g2h->desc = IOSYS_MAP_INIT_OFFSET(map, CTB_DESC_SIZE); in guc_ct_ctb_g2h_init()
252 xe_map_memset(xe, &g2h->desc, 0, 0, sizeof(struct guc_ct_buffer_desc)); in guc_ct_ctb_g2h_init()
254 g2h->cmds = IOSYS_MAP_INIT_OFFSET(map, CTB_DESC_SIZE * 2 + in guc_ct_ctb_g2h_init()
294 size = ct->ctbs.g2h.info.size * sizeof(u32); in guc_ct_ctb_g2h_register()
399 guc_ct_ctb_g2h_init(xe, &ct->ctbs.g2h, &ct->bo->vmap); in xe_guc_ct_enable()
486 return ct->ctbs.g2h.info.space > g2h_len; in g2h_has_room()
507 xe_gt_assert(ct_to_gt(ct), g2h_len <= ct->ctbs.g2h.info.space); in __g2h_reserve_space()
517 ct->ctbs.g2h.info.space -= g2h_len; in __g2h_reserve_space()
525 xe_gt_assert(ct_to_gt(ct), ct->ctbs.g2h.info.space + g2h_len <= in __g2h_release_space()
526 ct->ctbs.g2h.info.size - ct->ctbs.g2h.info.resv_space); in __g2h_release_space()
529 ct->ctbs.g2h.info.space += g2h_len; in __g2h_release_space()
755 struct guc_ctb *g2h = &ct->ctbs.g2h; in guc_ct_send_locked() local
757 trace_xe_guc_ct_g2h_flow_control(xe, g2h->info.head, in guc_ct_send_locked()
758 desc_read(xe, g2h, tail), in guc_ct_send_locked()
759 g2h->info.size, in guc_ct_send_locked()
760 g2h->info.space, in guc_ct_send_locked()
766 (desc_read(ct_to_xe(ct), (&ct->ctbs.g2h), tail) != ct->ctbs.g2h.info.head) in guc_ct_send_locked()
850 !ct->ctbs.g2h.info.broken) in retry_failure()
1082 ct->ctbs.g2h.info.broken = true; in parse_g2h_msg()
1100 ct->ctbs.g2h.info.broken = true; in parse_g2h_msg()
1188 struct guc_ctb *g2h = &ct->ctbs.g2h; in g2h_read() local
1203 if (g2h->info.broken) in g2h_read()
1209 tail = desc_read(xe, g2h, tail); in g2h_read()
1210 avail = tail - g2h->info.head; in g2h_read()
1215 avail += g2h->info.size; in g2h_read()
1218 xe_map_memcpy_from(xe, msg, &g2h->cmds, sizeof(u32) * g2h->info.head, in g2h_read()
1224 g2h->info.broken = true; in g2h_read()
1229 head = (g2h->info.head + 1) % g2h->info.size; in g2h_read()
1233 if (avail + head > g2h->info.size) { in g2h_read()
1234 u32 avail_til_wrap = g2h->info.size - head; in g2h_read()
1237 &g2h->cmds, sizeof(u32) * head, in g2h_read()
1240 &g2h->cmds, 0, in g2h_read()
1244 &g2h->cmds, sizeof(u32) * head, in g2h_read()
1265 g2h->info.head = (head + avail) % g2h->info.size; in g2h_read()
1266 desc_write(xe, g2h, head, g2h->info.head); in g2h_read()
1269 action, len, g2h->info.head, tail); in g2h_read()
1519 guc_ctb_snapshot_capture(xe, &ct->ctbs.g2h, in xe_guc_ct_snapshot_capture()
1520 &snapshot->g2h, atomic); in xe_guc_ct_snapshot_capture()
1544 guc_ctb_snapshot_print(&snapshot->g2h, p); in xe_guc_ct_snapshot_print()
1566 guc_ctb_snapshot_free(&snapshot->g2h); in xe_guc_ct_snapshot_free()