Commit 9a1fdae5 authored by Lucas Stach's avatar Lucas Stach

drm/etnaviv: dump only failing submit

Due to the tracking provided by the scheduler we know exactly which
submit is failing. Only dump this single submit and the required
auxiliary information. This cuts down the size of the devcoredumps
by only including relevant information.
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
parent 15ff4a7b
...@@ -110,16 +110,15 @@ static void etnaviv_core_dump_mem(struct core_dump_iterator *iter, u32 type, ...@@ -110,16 +110,15 @@ static void etnaviv_core_dump_mem(struct core_dump_iterator *iter, u32 type,
etnaviv_core_dump_header(iter, type, iter->data + size); etnaviv_core_dump_header(iter, type, iter->data + size);
} }
void etnaviv_core_dump(struct etnaviv_gpu *gpu) void etnaviv_core_dump(struct etnaviv_gem_submit *submit)
{ {
struct etnaviv_gpu *gpu = submit->gpu;
struct core_dump_iterator iter; struct core_dump_iterator iter;
struct etnaviv_vram_mapping *vram;
struct etnaviv_gem_object *obj; struct etnaviv_gem_object *obj;
struct etnaviv_gem_submit *submit;
struct drm_sched_job *s_job;
unsigned int n_obj, n_bomap_pages; unsigned int n_obj, n_bomap_pages;
size_t file_size, mmu_size; size_t file_size, mmu_size;
__le64 *bomap, *bomap_start; __le64 *bomap, *bomap_start;
int i;
/* Only catch the first event, or when manually re-armed */ /* Only catch the first event, or when manually re-armed */
if (!etnaviv_dump_core) if (!etnaviv_dump_core)
...@@ -130,26 +129,16 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu) ...@@ -130,26 +129,16 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
mmu_size = etnaviv_iommu_dump_size(gpu->mmu); mmu_size = etnaviv_iommu_dump_size(gpu->mmu);
/* We always dump registers, mmu, ring and end marker */ /* We always dump registers, mmu, ring, hanging cmdbuf and end marker */
n_obj = 4; n_obj = 5;
n_bomap_pages = 0; n_bomap_pages = 0;
file_size = ARRAY_SIZE(etnaviv_dump_registers) * file_size = ARRAY_SIZE(etnaviv_dump_registers) *
sizeof(struct etnaviv_dump_registers) + sizeof(struct etnaviv_dump_registers) +
mmu_size + gpu->buffer.size; mmu_size + gpu->buffer.size + submit->cmdbuf.size;
/* Add in the active command buffers */
list_for_each_entry(s_job, &gpu->sched.ring_mirror_list, node) {
submit = to_etnaviv_submit(s_job);
file_size += submit->cmdbuf.size;
n_obj++;
}
/* Add in the active buffer objects */ /* Add in the active buffer objects */
list_for_each_entry(vram, &gpu->mmu->mappings, mmu_node) { for (i = 0; i < submit->nr_bos; i++) {
if (!vram->use) obj = submit->bos[i].obj;
continue;
obj = vram->object;
file_size += obj->base.size; file_size += obj->base.size;
n_bomap_pages += obj->base.size >> PAGE_SHIFT; n_bomap_pages += obj->base.size >> PAGE_SHIFT;
n_obj++; n_obj++;
...@@ -185,12 +174,9 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu) ...@@ -185,12 +174,9 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
gpu->buffer.size, gpu->buffer.size,
etnaviv_cmdbuf_get_va(&gpu->buffer)); etnaviv_cmdbuf_get_va(&gpu->buffer));
list_for_each_entry(s_job, &gpu->sched.ring_mirror_list, node) { etnaviv_core_dump_mem(&iter, ETDUMP_BUF_CMD,
submit = to_etnaviv_submit(s_job); submit->cmdbuf.vaddr, submit->cmdbuf.size,
etnaviv_core_dump_mem(&iter, ETDUMP_BUF_CMD, etnaviv_cmdbuf_get_va(&submit->cmdbuf));
submit->cmdbuf.vaddr, submit->cmdbuf.size,
etnaviv_cmdbuf_get_va(&submit->cmdbuf));
}
/* Reserve space for the bomap */ /* Reserve space for the bomap */
if (n_bomap_pages) { if (n_bomap_pages) {
...@@ -203,14 +189,13 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu) ...@@ -203,14 +189,13 @@ void etnaviv_core_dump(struct etnaviv_gpu *gpu)
bomap_start = bomap = NULL; bomap_start = bomap = NULL;
} }
list_for_each_entry(vram, &gpu->mmu->mappings, mmu_node) { for (i = 0; i < submit->nr_bos; i++) {
struct etnaviv_vram_mapping *vram;
struct page **pages; struct page **pages;
void *vaddr; void *vaddr;
if (vram->use == 0) obj = submit->bos[i].obj;
continue; vram = submit->bos[i].mapping;
obj = vram->object;
mutex_lock(&obj->lock); mutex_lock(&obj->lock);
pages = etnaviv_gem_get_pages(obj); pages = etnaviv_gem_get_pages(obj);
......
...@@ -115,7 +115,7 @@ static void etnaviv_sched_timedout_job(struct drm_sched_job *sched_job) ...@@ -115,7 +115,7 @@ static void etnaviv_sched_timedout_job(struct drm_sched_job *sched_job)
drm_sched_increase_karma(sched_job); drm_sched_increase_karma(sched_job);
/* get the GPU back into the init state */ /* get the GPU back into the init state */
etnaviv_core_dump(gpu); etnaviv_core_dump(submit);
etnaviv_gpu_recover_hang(gpu); etnaviv_gpu_recover_hang(gpu);
drm_sched_resubmit_jobs(&gpu->sched); drm_sched_resubmit_jobs(&gpu->sched);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment