aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark2016-06-18 08:08:53 -0500
committerRob Clark2016-07-20 18:42:21 -0500
commit0d6152913098d739be07f9085cdf44c9cc68d096 (patch)
tree04a617269f57511628ea510504ddf4db6affdbd7 /freedreno
parent892141a321c7acd32000e145916217eda2da14bb (diff)
downloadexternal-libgbm-0d6152913098d739be07f9085cdf44c9cc68d096.tar.gz
external-libgbm-0d6152913098d739be07f9085cdf44c9cc68d096.tar.xz
external-libgbm-0d6152913098d739be07f9085cdf44c9cc68d096.zip
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>
Diffstat (limited to 'freedreno')
-rw-r--r--freedreno/msm/msm_ringbuffer.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/freedreno/msm/msm_ringbuffer.c b/freedreno/msm/msm_ringbuffer.c
index 66ae1463..4b46c202 100644
--- a/freedreno/msm/msm_ringbuffer.c
+++ b/freedreno/msm/msm_ringbuffer.c
@@ -176,12 +176,15 @@ static int check_cmd_bo(struct fd_ringbuffer *ring,
176 return msm_ring->submit.bos[cmd->submit_idx].handle == bo->handle; 176 return msm_ring->submit.bos[cmd->submit_idx].handle == bo->handle;
177} 177}
178 178
179static struct drm_msm_gem_submit_cmd * get_cmd(struct fd_ringbuffer *ring, 179/* Ensure that submit has corresponding entry in cmds table for the
180 * target cmdstream buffer:
181 */
182static void get_cmd(struct fd_ringbuffer *ring,
180 struct fd_ringbuffer *target_ring, struct fd_bo *target_bo, 183 struct fd_ringbuffer *target_ring, struct fd_bo *target_bo,
181 uint32_t submit_offset, uint32_t size, uint32_t type) 184 uint32_t submit_offset, uint32_t size, uint32_t type)
182{ 185{
183 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring); 186 struct msm_ringbuffer *msm_ring = to_msm_ringbuffer(ring);
184 struct drm_msm_gem_submit_cmd *cmd = NULL; 187 struct drm_msm_gem_submit_cmd *cmd;
185 uint32_t i; 188 uint32_t i;
186 189
187 /* figure out if we already have a cmd buf: */ 190 /* 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,
191 (cmd->size == size) && 194 (cmd->size == size) &&
192 (cmd->type == type) && 195 (cmd->type == type) &&
193 check_cmd_bo(ring, cmd, target_bo)) 196 check_cmd_bo(ring, cmd, target_bo))
194 break; 197 return;
195 cmd = NULL;
196 } 198 }
197 199
198 /* create cmd buf if not: */ 200 /* create cmd buf if not: */
199 if (!cmd) { 201 i = APPEND(&msm_ring->submit, cmds);
200 uint32_t idx = APPEND(&msm_ring->submit, cmds); 202 APPEND(msm_ring, rings);
201 APPEND(msm_ring, rings); 203 msm_ring->rings[i] = target_ring;
202 msm_ring->rings[idx] = target_ring; 204 cmd = &msm_ring->submit.cmds[i];
203 cmd = &msm_ring->submit.cmds[idx]; 205 cmd->type = type;
204 cmd->type = type; 206 cmd->submit_idx = bo2idx(ring, target_bo, FD_RELOC_READ);
205 cmd->submit_idx = bo2idx(ring, target_bo, FD_RELOC_READ); 207 cmd->submit_offset = submit_offset;
206 cmd->submit_offset = submit_offset; 208 cmd->size = size;
207 cmd->size = size; 209 cmd->pad = 0;
208 cmd->pad = 0;
209 }
210
211 return cmd;
212} 210}
213 211
214static void * msm_ringbuffer_hostptr(struct fd_ringbuffer *ring) 212static void * msm_ringbuffer_hostptr(struct fd_ringbuffer *ring)
@@ -360,11 +358,9 @@ static void msm_ringbuffer_emit_reloc_ring(struct fd_ringbuffer *ring,
360 uint32_t submit_offset, uint32_t size) 358 uint32_t submit_offset, uint32_t size)
361{ 359{
362 struct fd_bo *target_bo = to_msm_ringbuffer(target)->ring_bo; 360 struct fd_bo *target_bo = to_msm_ringbuffer(target)->ring_bo;
363 struct drm_msm_gem_submit_cmd *cmd;
364 361
365 cmd = get_cmd(ring, target, target_bo, submit_offset, size, 362 get_cmd(ring, target, target_bo, submit_offset, size,
366 MSM_SUBMIT_CMD_IB_TARGET_BUF); 363 MSM_SUBMIT_CMD_IB_TARGET_BUF);
367 assert(cmd);
368 364
369 msm_ringbuffer_emit_reloc(ring, &(struct fd_reloc){ 365 msm_ringbuffer_emit_reloc(ring, &(struct fd_reloc){
370 .bo = target_bo, 366 .bo = target_bo,