Lines Matching refs:device
39 radv_se_is_disabled(struct radv_device *device, unsigned se) in radv_se_is_disabled() argument
42 return device->physical_device->rad_info.cu_mask[se][0] == 0; in radv_se_is_disabled()
46 gfx10_get_thread_trace_ctrl(struct radv_device *device, bool enable) in gfx10_get_thread_trace_ctrl() argument
54 if (device->physical_device->rad_info.chip_class == GFX10_3) in gfx10_get_thread_trace_ctrl()
61 radv_emit_thread_trace_start(struct radv_device *device, struct radeon_cmdbuf *cs, in radv_emit_thread_trace_start() argument
64 uint32_t shifted_size = device->thread_trace.buffer_size >> SQTT_BUFFER_ALIGN_SHIFT; in radv_emit_thread_trace_start()
65 struct radeon_info *rad_info = &device->physical_device->rad_info; in radv_emit_thread_trace_start()
69 uint64_t va = radv_buffer_get_va(device->thread_trace.bo); in radv_emit_thread_trace_start()
70 uint64_t data_va = ac_thread_trace_get_data_va(rad_info, &device->thread_trace, va, se); in radv_emit_thread_trace_start()
72 int first_active_cu = ffs(device->physical_device->rad_info.cu_mask[se][0]); in radv_emit_thread_trace_start()
74 if (radv_se_is_disabled(device, se)) in radv_emit_thread_trace_start()
82 if (device->physical_device->rad_info.chip_class >= GFX10) { in radv_emit_thread_trace_start()
117 gfx10_get_thread_trace_ctrl(device, true)); in radv_emit_thread_trace_start()
134 if (device->physical_device->rad_info.chip_class < GFX9) { in radv_emit_thread_trace_start()
153 if (device->physical_device->rad_info.chip_class == GFX9) { in radv_emit_thread_trace_start()
165 if (device->physical_device->rad_info.chip_class == GFX9) { in radv_emit_thread_trace_start()
181 device->physical_device->rad_info.chip_class >= GFX7) { in radv_emit_thread_trace_start()
208 radv_copy_thread_trace_info_regs(struct radv_device *device, struct radeon_cmdbuf *cs, in radv_copy_thread_trace_info_regs() argument
213 if (device->physical_device->rad_info.chip_class >= GFX10) { in radv_copy_thread_trace_info_regs()
215 } else if (device->physical_device->rad_info.chip_class == GFX9) { in radv_copy_thread_trace_info_regs()
218 assert(device->physical_device->rad_info.chip_class == GFX8); in radv_copy_thread_trace_info_regs()
223 uint64_t va = radv_buffer_get_va(device->thread_trace.bo); in radv_copy_thread_trace_info_regs()
239 radv_emit_thread_trace_stop(struct radv_device *device, struct radeon_cmdbuf *cs, in radv_emit_thread_trace_stop() argument
242 unsigned max_se = device->physical_device->rad_info.max_se; in radv_emit_thread_trace_stop()
246 device->physical_device->rad_info.chip_class >= GFX7) { in radv_emit_thread_trace_stop()
257 if (radv_se_is_disabled(device, se)) in radv_emit_thread_trace_stop()
265 if (device->physical_device->rad_info.chip_class >= GFX10) { in radv_emit_thread_trace_stop()
279 gfx10_get_thread_trace_ctrl(device, false)); in radv_emit_thread_trace_stop()
305 radv_copy_thread_trace_info_regs(device, cs, se); in radv_emit_thread_trace_stop()
315 radv_emit_thread_trace_userdata(const struct radv_device *device, struct radeon_cmdbuf *cs, in radv_emit_thread_trace_userdata() argument
323 radeon_check_space(device->ws, cs, 2 + count); in radv_emit_thread_trace_userdata()
327 if (device->physical_device->rad_info.chip_class >= GFX10) in radv_emit_thread_trace_userdata()
339 radv_emit_spi_config_cntl(struct radv_device *device, struct radeon_cmdbuf *cs, bool enable) in radv_emit_spi_config_cntl() argument
341 if (device->physical_device->rad_info.chip_class >= GFX9) { in radv_emit_spi_config_cntl()
346 if (device->physical_device->rad_info.chip_class >= GFX10) in radv_emit_spi_config_cntl()
359 radv_emit_inhibit_clockgating(struct radv_device *device, struct radeon_cmdbuf *cs, bool inhibit) in radv_emit_inhibit_clockgating() argument
361 if (device->physical_device->rad_info.chip_class >= GFX10) { in radv_emit_inhibit_clockgating()
364 } else if (device->physical_device->rad_info.chip_class >= GFX8) { in radv_emit_inhibit_clockgating()
371 radv_emit_wait_for_idle(struct radv_device *device, struct radeon_cmdbuf *cs, int family) in radv_emit_wait_for_idle() argument
375 cs, device->physical_device->rad_info.chip_class, NULL, 0, in radv_emit_wait_for_idle()
376 family == RING_COMPUTE && device->physical_device->rad_info.chip_class >= GFX7, in radv_emit_wait_for_idle()
386 radv_thread_trace_init_bo(struct radv_device *device) in radv_thread_trace_init_bo() argument
388 unsigned max_se = device->physical_device->rad_info.max_se; in radv_thread_trace_init_bo()
389 struct radeon_winsys *ws = device->ws; in radv_thread_trace_init_bo()
396 device->thread_trace.buffer_size = in radv_thread_trace_init_bo()
397 align64(device->thread_trace.buffer_size, 1u << SQTT_BUFFER_ALIGN_SHIFT); in radv_thread_trace_init_bo()
401 size += device->thread_trace.buffer_size * (uint64_t)max_se; in radv_thread_trace_init_bo()
408 device->thread_trace.bo = bo; in radv_thread_trace_init_bo()
412 result = ws->buffer_make_resident(ws, device->thread_trace.bo, true); in radv_thread_trace_init_bo()
416 device->thread_trace.ptr = ws->buffer_map(device->thread_trace.bo); in radv_thread_trace_init_bo()
417 if (!device->thread_trace.ptr) in radv_thread_trace_init_bo()
424 radv_thread_trace_finish_bo(struct radv_device *device) in radv_thread_trace_finish_bo() argument
426 struct radeon_winsys *ws = device->ws; in radv_thread_trace_finish_bo()
428 if (unlikely(device->thread_trace.bo)) { in radv_thread_trace_finish_bo()
429 ws->buffer_make_resident(ws, device->thread_trace.bo, false); in radv_thread_trace_finish_bo()
430 ws->buffer_destroy(ws, device->thread_trace.bo); in radv_thread_trace_finish_bo()
435 radv_thread_trace_init(struct radv_device *device) in radv_thread_trace_init() argument
437 struct ac_thread_trace_data *thread_trace_data = &device->thread_trace; in radv_thread_trace_init()
440 device->thread_trace.buffer_size = in radv_thread_trace_init()
442 device->thread_trace.start_frame = radv_get_int_debug_option("RADV_THREAD_TRACE", -1); in radv_thread_trace_init()
446 device->thread_trace.trigger_file = strdup(trigger_file); in radv_thread_trace_init()
448 if (!radv_thread_trace_init_bo(device)) in radv_thread_trace_init()
464 radv_thread_trace_finish(struct radv_device *device) in radv_thread_trace_finish() argument
466 struct ac_thread_trace_data *thread_trace_data = &device->thread_trace; in radv_thread_trace_finish()
467 struct radeon_winsys *ws = device->ws; in radv_thread_trace_finish()
469 radv_thread_trace_finish_bo(device); in radv_thread_trace_finish()
472 if (device->thread_trace.start_cs[i]) in radv_thread_trace_finish()
473 ws->cs_destroy(device->thread_trace.start_cs[i]); in radv_thread_trace_finish()
474 if (device->thread_trace.stop_cs[i]) in radv_thread_trace_finish()
475 ws->cs_destroy(device->thread_trace.stop_cs[i]); in radv_thread_trace_finish()
489 radv_thread_trace_resize_bo(struct radv_device *device) in radv_thread_trace_resize_bo() argument
492 radv_thread_trace_finish_bo(device); in radv_thread_trace_resize_bo()
495 device->thread_trace.buffer_size *= 2; in radv_thread_trace_resize_bo()
500 device->thread_trace.buffer_size / 1024); in radv_thread_trace_resize_bo()
503 return radv_thread_trace_init_bo(device); in radv_thread_trace_resize_bo()
509 struct radv_device *device = queue->device; in radv_begin_thread_trace() local
511 struct radeon_winsys *ws = device->ws; in radv_begin_thread_trace()
516 if (device->thread_trace.start_cs[family]) { in radv_begin_thread_trace()
517 ws->cs_destroy(device->thread_trace.start_cs[family]); in radv_begin_thread_trace()
518 device->thread_trace.start_cs[family] = NULL; in radv_begin_thread_trace()
537 radv_cs_add_buffer(ws, cs, device->thread_trace.bo); in radv_begin_thread_trace()
540 radv_emit_wait_for_idle(device, cs, family); in radv_begin_thread_trace()
543 radv_emit_inhibit_clockgating(device, cs, true); in radv_begin_thread_trace()
546 radv_emit_spi_config_cntl(device, cs, true); in radv_begin_thread_trace()
549 radv_emit_thread_trace_start(device, cs, family); in radv_begin_thread_trace()
557 device->thread_trace.start_cs[family] = cs; in radv_begin_thread_trace()
565 struct radv_device *device = queue->device; in radv_end_thread_trace() local
567 struct radeon_winsys *ws = device->ws; in radv_end_thread_trace()
572 if (queue->device->thread_trace.stop_cs[family]) { in radv_end_thread_trace()
573 ws->cs_destroy(device->thread_trace.stop_cs[family]); in radv_end_thread_trace()
574 device->thread_trace.stop_cs[family] = NULL; in radv_end_thread_trace()
593 radv_cs_add_buffer(ws, cs, device->thread_trace.bo); in radv_end_thread_trace()
596 radv_emit_wait_for_idle(device, cs, family); in radv_end_thread_trace()
599 radv_emit_thread_trace_stop(device, cs, family); in radv_end_thread_trace()
602 radv_emit_spi_config_cntl(device, cs, false); in radv_end_thread_trace()
605 radv_emit_inhibit_clockgating(device, cs, false); in radv_end_thread_trace()
613 device->thread_trace.stop_cs[family] = cs; in radv_end_thread_trace()
621 struct radv_device *device = queue->device; in radv_get_thread_trace() local
622 struct radeon_info *rad_info = &device->physical_device->rad_info; in radv_get_thread_trace()
624 void *thread_trace_ptr = device->thread_trace.ptr; in radv_get_thread_trace()
630 uint64_t data_offset = ac_thread_trace_get_data_offset(rad_info, &device->thread_trace, se); in radv_get_thread_trace()
635 int first_active_cu = ffs(device->physical_device->rad_info.cu_mask[se][0]); in radv_get_thread_trace()
637 if (radv_se_is_disabled(device, se)) in radv_get_thread_trace()
640 if (!ac_is_thread_trace_complete(&device->physical_device->rad_info, &device->thread_trace, in radv_get_thread_trace()
642 if (!radv_thread_trace_resize_bo(device)) { in radv_get_thread_trace()
655 thread_trace_se.compute_unit = device->physical_device->rad_info.chip_class >= GFX10 in radv_get_thread_trace()
663 thread_trace->data = &device->thread_trace; in radv_get_thread_trace()