From 04190a912eebdbf4ff7ca45115ee21b1e4a0edd2 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 23 Jul 2018 10:23:50 -0400 Subject: [PATCH] freedreno: slight reordering 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 --- freedreno/msm/msm_ringbuffer.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c index a5f9861c..156c23c6 100644 --- a/freedreno/msm/msm_ringbuffer.c +++ b/freedreno/msm/msm_ringbuffer.c @@ -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,