freedreno: slight reordering
authorRob Clark <robclark@freedesktop.org>
Mon, 23 Jul 2018 14:23:50 +0000 (10:23 -0400)
committerRob Clark <robclark@freedesktop.org>
Mon, 30 Jul 2018 16:18:58 +0000 (12:18 -0400)
Splitting code-motion out from next patch.  Once we add stateobj rb's
this loop could add new entries to bos table, so it needs to be before
we set req.bos/req.nr_bos.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/msm/msm_ringbuffer.c

index a5f9861..156c23c 100644 (file)
@@ -391,12 +391,6 @@ static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start
 
        finalize_current_cmd(ring, last_start);
 
-       /* needs to be after get_cmd() as that could create bos/cmds table: */
-       req.bos = VOID2U64(msm_ring->submit.bos),
-       req.nr_bos = msm_ring->submit.nr_bos;
-       req.cmds = VOID2U64(msm_ring->submit.cmds),
-       req.nr_cmds = msm_ring->submit.nr_cmds;
-
        /* for each of the cmd's fix up their reloc's: */
        for (i = 0; i < msm_ring->submit.nr_cmds; i++) {
                struct drm_msm_gem_submit_cmd *cmd = &msm_ring->submit.cmds[i];
@@ -407,6 +401,12 @@ static int msm_ringbuffer_flush(struct fd_ringbuffer *ring, uint32_t *last_start
                cmd->nr_relocs = (b > a) ? b - a : 0;
        }
 
+       /* needs to be after get_cmd() as that could create bos/cmds table: */
+       req.bos = VOID2U64(msm_ring->submit.bos),
+       req.nr_bos = msm_ring->submit.nr_bos;
+       req.cmds = VOID2U64(msm_ring->submit.cmds),
+       req.nr_cmds = msm_ring->submit.nr_cmds;
+
        DEBUG_MSG("nr_cmds=%u, nr_bos=%u", req.nr_cmds, req.nr_bos);
 
        ret = drmCommandWriteRead(ring->pipe->dev->fd, DRM_MSM_GEM_SUBMIT,