Lines Matching +full:p +full:- +full:tile
1 // SPDX-License-Identifier: MIT
8 #include <linux/fault-inject.h>
47 * +-------------------------------+ 32B in guc_log_size()
49 * +-------------------------------+ 64B in guc_log_size()
51 * +-------------------------------+ 96B in guc_log_size()
82 snapshot->size = xe_bo_size(log->bo); in xe_guc_log_snapshot_alloc()
83 snapshot->num_chunks = DIV_ROUND_UP(snapshot->size, GUC_LOG_CHUNK_SIZE); in xe_guc_log_snapshot_alloc()
85 snapshot->copy = kcalloc(snapshot->num_chunks, sizeof(*snapshot->copy), in xe_guc_log_snapshot_alloc()
87 if (!snapshot->copy) in xe_guc_log_snapshot_alloc()
90 remain = snapshot->size; in xe_guc_log_snapshot_alloc()
91 for (i = 0; i < snapshot->num_chunks; i++) { in xe_guc_log_snapshot_alloc()
94 snapshot->copy[i] = kmalloc(size, atomic ? GFP_ATOMIC : GFP_KERNEL); in xe_guc_log_snapshot_alloc()
95 if (!snapshot->copy[i]) in xe_guc_log_snapshot_alloc()
97 remain -= size; in xe_guc_log_snapshot_alloc()
103 for (i = 0; i < snapshot->num_chunks; i++) in xe_guc_log_snapshot_alloc()
104 kfree(snapshot->copy[i]); in xe_guc_log_snapshot_alloc()
105 kfree(snapshot->copy); in xe_guc_log_snapshot_alloc()
112 * xe_guc_log_snapshot_free - free a previously captured GuC log snapshot
125 if (snapshot->copy) { in xe_guc_log_snapshot_free()
126 for (i = 0; i < snapshot->num_chunks; i++) in xe_guc_log_snapshot_free()
127 kfree(snapshot->copy[i]); in xe_guc_log_snapshot_free()
128 kfree(snapshot->copy); in xe_guc_log_snapshot_free()
135 * xe_guc_log_snapshot_capture - create a new snapshot copy the GuC log for later dumping
152 if (!log->bo) in xe_guc_log_snapshot_capture()
159 remain = snapshot->size; in xe_guc_log_snapshot_capture()
160 for (i = 0; i < snapshot->num_chunks; i++) { in xe_guc_log_snapshot_capture()
163 xe_map_memcpy_from(xe, snapshot->copy[i], &log->bo->vmap, in xe_guc_log_snapshot_capture()
165 remain -= size; in xe_guc_log_snapshot_capture()
170 snapshot->stamp = ~0ULL; in xe_guc_log_snapshot_capture()
172 snapshot->stamp = xe_mmio_read64_2x32(>->mmio, GUC_PMTIMESTAMP_LO); in xe_guc_log_snapshot_capture()
175 snapshot->ktime = ktime_get_boottime_ns(); in xe_guc_log_snapshot_capture()
176 snapshot->level = log->level; in xe_guc_log_snapshot_capture()
177 snapshot->ver_found = guc->fw.versions.found[XE_UC_FW_VER_RELEASE]; in xe_guc_log_snapshot_capture()
178 snapshot->ver_want = guc->fw.versions.wanted; in xe_guc_log_snapshot_capture()
179 snapshot->path = guc->fw.path; in xe_guc_log_snapshot_capture()
185 * xe_guc_log_snapshot_print - dump a previously saved copy of the GuC log to some useful location
187 * @p: the printer object to output to
189 void xe_guc_log_snapshot_print(struct xe_guc_log_snapshot *snapshot, struct drm_printer *p) in xe_guc_log_snapshot_print() argument
195 drm_printf(p, "GuC log snapshot not allocated!\n"); in xe_guc_log_snapshot_print()
199 drm_printf(p, "GuC firmware: %s\n", snapshot->path); in xe_guc_log_snapshot_print()
200 drm_printf(p, "GuC version: %u.%u.%u (wanted %u.%u.%u)\n", in xe_guc_log_snapshot_print()
201 snapshot->ver_found.major, snapshot->ver_found.minor, snapshot->ver_found.patch, in xe_guc_log_snapshot_print()
202 snapshot->ver_want.major, snapshot->ver_want.minor, snapshot->ver_want.patch); in xe_guc_log_snapshot_print()
203 drm_printf(p, "Kernel timestamp: 0x%08llX [%llu]\n", snapshot->ktime, snapshot->ktime); in xe_guc_log_snapshot_print()
204 drm_printf(p, "GuC timestamp: 0x%08llX [%llu]\n", snapshot->stamp, snapshot->stamp); in xe_guc_log_snapshot_print()
205 drm_printf(p, "Log level: %u\n", snapshot->level); in xe_guc_log_snapshot_print()
207 drm_printf(p, "[LOG].length: 0x%zx\n", snapshot->size); in xe_guc_log_snapshot_print()
208 remain = snapshot->size; in xe_guc_log_snapshot_print()
209 for (i = 0; i < snapshot->num_chunks; i++) { in xe_guc_log_snapshot_print()
212 char suffix = i == snapshot->num_chunks - 1 ? '\n' : 0; in xe_guc_log_snapshot_print()
214 xe_print_blob_ascii85(p, prefix, suffix, snapshot->copy[i], 0, size); in xe_guc_log_snapshot_print()
215 remain -= size; in xe_guc_log_snapshot_print()
220 * xe_guc_log_print_dmesg - dump a copy of the GuC log to dmesg
238 * xe_guc_log_print - dump a copy of the GuC log to some useful location
240 * @p: the printer object to output to
242 void xe_guc_log_print(struct xe_guc_log *log, struct drm_printer *p) in xe_guc_log_print() argument
246 drm_printf(p, "**** GuC Log ****\n"); in xe_guc_log_print()
249 drm_printf(p, "CS reference clock: %u\n", log_to_gt(log)->info.reference_clock); in xe_guc_log_print()
250 xe_guc_log_snapshot_print(snapshot, p); in xe_guc_log_print()
257 struct xe_tile *tile = gt_to_tile(log_to_gt(log)); in xe_guc_log_init() local
260 bo = xe_managed_bo_create_pin_map(xe, tile, guc_log_size(), in xe_guc_log_init()
268 xe_map_memset(xe, &bo->vmap, 0, 0, guc_log_size()); in xe_guc_log_init()
269 log->bo = bo; in xe_guc_log_init()
270 log->level = xe_modparam.guc_log_level; in xe_guc_log_init()
288 * xe_guc_log_section_size_capture - Get capture buffer size within log sections.
301 * xe_guc_get_log_buffer_size - Get log buffer size for a type.
321 * xe_guc_get_log_buffer_offset - Get offset in log buffer for a type.
343 * xe_guc_check_log_buf_overflow - Check if log buffer overflowed
358 unsigned int prev_full_cnt = log->stats[type].sampled_overflow; in xe_guc_check_log_buf_overflow()
364 log->stats[type].overflow = full_cnt; in xe_guc_check_log_buf_overflow()
365 log->stats[type].sampled_overflow += full_cnt - prev_full_cnt; in xe_guc_check_log_buf_overflow()
369 log->stats[type].sampled_overflow += 16; in xe_guc_check_log_buf_overflow()