drm/msm: fix rd dumping for split-IB1
authorRob Clark <robdclark@chromium.org>
Mon, 7 Oct 2019 20:31:07 +0000 (13:31 -0700)
committerRob Clark <robdclark@chromium.org>
Sat, 2 Nov 2019 16:43:24 +0000 (09:43 -0700)
When IB1 is split into multiple cmd buffers, we'd emit multiple
RD_CMDSTREAM_ADDR per submit.  But after this packet is handled
by the cffdump parser, it resets it's known buffers on the next
GPUADDR packet, so subsequent RD_CMDSTREAM_ADDR packets from the
same submit would not find their buffers.

Re-work the loop to snapshot all buffers before RD_CMDSTREAM_ADDR
to avoid this problem.

Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/msm_rd.c

index c7832a9..39a5832 100644 (file)
@@ -385,7 +385,6 @@ void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit,
                        snapshot_buf(rd, submit, i, 0, 0);
 
        for (i = 0; i < submit->nr_cmds; i++) {
-               uint64_t iova = submit->cmd[i].iova;
                uint32_t szd  = submit->cmd[i].size; /* in dwords */
 
                /* snapshot cmdstream bo's (if we haven't already): */
@@ -393,6 +392,11 @@ void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit,
                        snapshot_buf(rd, submit, submit->cmd[i].idx,
                                        submit->cmd[i].iova, szd * 4);
                }
+       }
+
+       for (i = 0; i < submit->nr_cmds; i++) {
+               uint64_t iova = submit->cmd[i].iova;
+               uint32_t szd  = submit->cmd[i].size; /* in dwords */
 
                switch (submit->cmd[i].type) {
                case MSM_SUBMIT_CMD_IB_TARGET_BUF: