/* Only catch the first event, or when manually re-armed */ if (!panfrost_dump_core) return;
panfrost_dump_core = false;
/* At least, we dump registers and end marker */
n_obj = 2;
n_bomap_pages = 0;
file_size = ARRAY_SIZE(panfrost_dump_registers) * sizeof(struct panfrost_dump_registers);
/* Add in the active buffer objects */ for (i = 0; i < job->bo_count; i++) { /* * Even though the CPU could be configured to use 16K or 64K pages, this * is a very unusual situation for most kernel setups on SoCs that have * a Panfrost device. Also many places across the driver make the somewhat * arbitrary assumption that Panfrost's MMU page size is the same as the CPU's, * so let's have a sanity check to ensure that's always the case
*/
dbo = job->bos[i];
WARN_ON(!IS_ALIGNED(dbo->size, PAGE_SIZE));
/* If we have any buffer objects, add a bomap object */ if (n_bomap_pages) {
file_size += n_bomap_pages * sizeof(*bomap);
n_obj++;
}
/* Add the size of the headers */
file_size += sizeof(*iter.hdr) * n_obj;
/* * Allocate the file in vmalloc memory, it's likely to be big. * The reason behind these GFP flags is that we don't want to trigger the * OOM killer in the event that not enough memory could be found for our * dump file. We also don't want the allocator to do any error reporting, * as the right behaviour is failing gracefully if a big enough buffer * could not be allocated.
*/
iter.start = __vmalloc(file_size, GFP_KERNEL | __GFP_NOWARN |
__GFP_NORETRY); if (!iter.start) {
dev_warn(pfdev->dev, "failed to allocate devcoredump file\n"); return;
}
/* Point the data member after the headers */
iter.hdr = iter.start;
iter.data = &iter.hdr[n_obj];
memset(iter.hdr, 0, iter.data - iter.start);
/* * For now, we write the job identifier in the register dump header, * so that we can decode the entire dump later with pandecode
*/
iter.hdr->reghdr.jc = job->jc;
iter.hdr->reghdr.major = PANFROSTDUMP_MAJOR;
iter.hdr->reghdr.minor = PANFROSTDUMP_MINOR;
iter.hdr->reghdr.gpu_id = pfdev->features.id;
iter.hdr->reghdr.nbos = job->bo_count;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.