From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
Rob Clark <robdclark@chromium.org>,
Rob Clark <robdclark@gmail.com>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Sean Paul <sean@poorly.run>, David Airlie <airlied@linux.ie>,
Daniel Vetter <daniel@ffwll.ch>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 1/2] drm/msm/gpu: Capture all BO addr+size in devcore
Date: Wed, 29 Jun 2022 14:19:15 -0700 [thread overview]
Message-ID: <20220629211919.563585-2-robdclark@gmail.com> (raw)
In-Reply-To: <20220629211919.563585-1-robdclark@gmail.com>
From: Rob Clark <robdclark@chromium.org>
It is useful to know what buffers userspace thinks are associated with
the submit, even if we don't care to capture their content. This brings
things more inline with $debugfs/rd cmdstream dumping.
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
drivers/gpu/drm/msm/msm_gpu.c | 36 ++++++++---------------------------
1 file changed, 8 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c
index bdee6ea51b73..293f3380fafe 100644
--- a/drivers/gpu/drm/msm/msm_gpu.c
+++ b/drivers/gpu/drm/msm/msm_gpu.c
@@ -221,7 +221,7 @@ static void msm_gpu_devcoredump_free(void *data)
}
static void msm_gpu_crashstate_get_bo(struct msm_gpu_state *state,
- struct msm_gem_object *obj, u64 iova, u32 flags)
+ struct msm_gem_object *obj, u64 iova, bool full)
{
struct msm_gpu_state_bo *state_bo = &state->bos[state->nr_bos];
@@ -229,8 +229,7 @@ static void msm_gpu_crashstate_get_bo(struct msm_gpu_state *state,
state_bo->size = obj->base.size;
state_bo->iova = iova;
- /* Only store data for non imported buffer objects marked for read */
- if ((flags & MSM_SUBMIT_BO_READ) && !obj->base.import_attach) {
+ if (full) {
void *ptr;
state_bo->data = kvmalloc(obj->base.size, GFP_KERNEL);
@@ -276,34 +275,15 @@ static void msm_gpu_crashstate_capture(struct msm_gpu *gpu,
state->fault_info = gpu->fault_info;
if (submit) {
- int i, nr = 0;
-
- /* count # of buffers to dump: */
- for (i = 0; i < submit->nr_bos; i++)
- if (should_dump(submit, i))
- nr++;
- /* always dump cmd bo's, but don't double count them: */
- for (i = 0; i < submit->nr_cmds; i++)
- if (!should_dump(submit, submit->cmd[i].idx))
- nr++;
-
- state->bos = kcalloc(nr,
+ int i;
+
+ state->bos = kcalloc(submit->nr_bos,
sizeof(struct msm_gpu_state_bo), GFP_KERNEL);
for (i = 0; state->bos && i < submit->nr_bos; i++) {
- if (should_dump(submit, i)) {
- msm_gpu_crashstate_get_bo(state, submit->bos[i].obj,
- submit->bos[i].iova, submit->bos[i].flags);
- }
- }
-
- for (i = 0; state->bos && i < submit->nr_cmds; i++) {
- int idx = submit->cmd[i].idx;
-
- if (!should_dump(submit, submit->cmd[i].idx)) {
- msm_gpu_crashstate_get_bo(state, submit->bos[idx].obj,
- submit->bos[idx].iova, submit->bos[idx].flags);
- }
+ msm_gpu_crashstate_get_bo(state, submit->bos[i].obj,
+ submit->bos[i].iova,
+ should_dump(submit, i));
}
}
--
2.36.1
next prev parent reply other threads:[~2022-06-29 21:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-29 21:19 [PATCH 0/2] drm/msm: A couple GPU devcore enhancements Rob Clark
2022-06-29 21:19 ` Rob Clark [this message]
2022-06-29 21:19 ` [PATCH 2/2] drm/msm/gpu: Add GEM debug label to devcore Rob Clark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220629211919.563585-2-robdclark@gmail.com \
--to=robdclark@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@chromium.org \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox