Commit 896a248a authored by Jordan Crouse's avatar Jordan Crouse Committed by Rob Clark

drm/msm/gpu: Only store local command buffers in the GPU state

Instead of trying to store all the tagged buffers from a hanging
submit only store the command buffers that were not imported.
This cuts down on the amount of data stored in the GPU state to
the base minimum of useful information.

The downside is that this will make it more difficult to
successfully replay a hang with just the GPU state but there
isn't any reason why that functionality can't be added back
in later once we've figured out how to better communicate
such massive amounts of data.
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 4241db42
...@@ -316,28 +316,28 @@ static void msm_gpu_crashstate_get_bo(struct msm_gpu_state *state, ...@@ -316,28 +316,28 @@ static void msm_gpu_crashstate_get_bo(struct msm_gpu_state *state,
struct msm_gpu_state_bo *state_bo = &state->bos[state->nr_bos]; struct msm_gpu_state_bo *state_bo = &state->bos[state->nr_bos];
/* Don't record write only objects */ /* Don't record write only objects */
state_bo->size = obj->base.size; state_bo->size = obj->base.size;
state_bo->iova = iova; state_bo->iova = iova;
/* Only store the data for buffer objects marked for read */ /* Only store data for non imported buffer objects marked for read */
if ((flags & MSM_SUBMIT_BO_READ)) { if ((flags & MSM_SUBMIT_BO_READ) && !obj->base.import_attach) {
void *ptr; void *ptr;
state_bo->data = kvmalloc(obj->base.size, GFP_KERNEL); state_bo->data = kvmalloc(obj->base.size, GFP_KERNEL);
if (!state_bo->data) if (!state_bo->data)
return; goto out;
ptr = msm_gem_get_vaddr_active(&obj->base); ptr = msm_gem_get_vaddr_active(&obj->base);
if (IS_ERR(ptr)) { if (IS_ERR(ptr)) {
kvfree(state_bo->data); kvfree(state_bo->data);
return; state_bo->data = NULL;
goto out;
} }
memcpy(state_bo->data, ptr, obj->base.size); memcpy(state_bo->data, ptr, obj->base.size);
msm_gem_put_vaddr(&obj->base); msm_gem_put_vaddr(&obj->base);
} }
out:
state->nr_bos++; state->nr_bos++;
} }
...@@ -361,12 +361,15 @@ static void msm_gpu_crashstate_capture(struct msm_gpu *gpu, ...@@ -361,12 +361,15 @@ static void msm_gpu_crashstate_capture(struct msm_gpu *gpu,
if (submit) { if (submit) {
int i; int i;
state->bos = kcalloc(submit->nr_bos, state->bos = kcalloc(submit->nr_cmds,
sizeof(struct msm_gpu_state_bo), GFP_KERNEL); sizeof(struct msm_gpu_state_bo), GFP_KERNEL);
for (i = 0; state->bos && i < submit->nr_bos; i++) for (i = 0; state->bos && i < submit->nr_cmds; i++) {
msm_gpu_crashstate_get_bo(state, submit->bos[i].obj, int idx = submit->cmd[i].idx;
submit->bos[i].iova, submit->bos[i].flags);
msm_gpu_crashstate_get_bo(state, submit->bos[idx].obj,
submit->bos[idx].iova, submit->bos[idx].flags);
}
} }
/* Set the active crash state to be dumped on failure */ /* Set the active crash state to be dumped on failure */
......
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