freedreno/msm: drop return from get_cmd()

Not actually needed.  It just needs to ensure that there is a
corresponding entry in the submit's cmds table.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
main
Rob Clark 2016-06-18 09:08:53 -04:00
parent 892141a321
commit 0d61529130
1 changed files with 16 additions and 20 deletions

View File

@ -176,12 +176,15 @@ static int check_cmd_bo(struct fd_ringbuffer *ring,
return msm_ring->submit.bos[cmd->submit_idx].handle == bo->handle; return msm_ring->submit.bos[cmd->submit_idx].handle == bo->handle;
} }
static struct drm_msm_gem_submit_cmd * get_cmd(struct fd_ringbuffer *ring, /* Ensure that submit has corresponding entry in cmds table for the
* target cmdstream buffer:
*/
static void get_cmd(struct fd_ringbuffer *ring,
struct fd_ringbuffer *target_ring, struct fd_bo *target_bo, struct fd_ringbuffer *target_ring, struct fd_bo *target_bo,
uint32_t submit_offset, uint32_t size, uint32_t type) uint32_t submit_offset, uint32_t size, uint32_t type)
{ {
struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
struct drm_msm_gem_submit_cmd *cmd = NULL; struct drm_msm_gem_submit_cmd *cmd;
uint32_t i; uint32_t i;
/* figure out if we already have a cmd buf: */ /* figure out if we already have a cmd buf: */
@ -191,24 +194,19 @@ static struct drm_msm_gem_submit_cmd * get_cmd(struct fd_ringbuffer *ring,
(cmd->size == size) && (cmd->size == size) &&
(cmd->type == type) && (cmd->type == type) &&
check_cmd_bo(ring, cmd, target_bo)) check_cmd_bo(ring, cmd, target_bo))
break; return;
cmd = NULL;
} }
/* create cmd buf if not: */ /* create cmd buf if not: */
if (!cmd) { i = APPEND(&msm_ring->submit, cmds);
uint32_t idx = APPEND(&msm_ring->submit, cmds); APPEND(msm_ring, rings);
APPEND(msm_ring, rings); msm_ring->rings[i] = target_ring;
msm_ring->rings[idx] = target_ring; cmd = &msm_ring->submit.cmds[i];
cmd = &msm_ring->submit.cmds[idx]; cmd->type = type;
cmd->type = type; cmd->submit_idx = bo2idx(ring, target_bo, FD_RELOC_READ);
cmd->submit_idx = bo2idx(ring, target_bo, FD_RELOC_READ); cmd->submit_offset = submit_offset;
cmd->submit_offset = submit_offset; cmd->size = size;
cmd->size = size; cmd->pad = 0;
cmd->pad = 0;
}
return cmd;
} }
static void * msm_ringbuffer_hostptr(struct fd_ringbuffer *ring) static void * msm_ringbuffer_hostptr(struct fd_ringbuffer *ring)
@ -360,11 +358,9 @@ static void msm_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
uint32_t submit_offset, uint32_t size) uint32_t submit_offset, uint32_t size)
{ {
struct fd_bo *target_bo = to_msm_ringbuffer(target)->ring_bo; struct fd_bo *target_bo = to_msm_ringbuffer(target)->ring_bo;
struct drm_msm_gem_submit_cmd *cmd;
cmd = get_cmd(ring, target, target_bo, submit_offset, size, get_cmd(ring, target, target_bo, submit_offset, size,
MSM_SUBMIT_CMD_IB_TARGET_BUF); MSM_SUBMIT_CMD_IB_TARGET_BUF);
assert(cmd);
msm_ringbuffer_emit_reloc(ring, &(struct fd_reloc){ msm_ringbuffer_emit_reloc(ring, &(struct fd_reloc){
.bo = target_bo, .bo = target_bo,