diff options
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/iris/iris_fence.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/lima/lima_draw.c | 6 | ||||
-rw-r--r-- | src/gallium/drivers/lima/lima_submit.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c | 2 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_state.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/nouveau/nvc0/nvc0_state.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/midgard_emit.c | 4 |
7 files changed, 14 insertions, 16 deletions
diff --git a/src/gallium/drivers/iris/iris_fence.c b/src/gallium/drivers/iris/iris_fence.c index 06452f70966..145b3e48dd1 100644 --- a/src/gallium/drivers/iris/iris_fence.c +++ b/src/gallium/drivers/iris/iris_fence.c @@ -93,7 +93,7 @@ iris_batch_add_syncpt(struct iris_batch *batch, unsigned flags) { struct drm_i915_gem_exec_fence *fence = - util_dynarray_grow(&batch->exec_fences, sizeof(*fence)); + util_dynarray_grow(&batch->exec_fences, struct drm_i915_gem_exec_fence, 1); *fence = (struct drm_i915_gem_exec_fence) { .handle = syncpt->handle, @@ -101,7 +101,7 @@ iris_batch_add_syncpt(struct iris_batch *batch, }; struct iris_syncpt **store = - util_dynarray_grow(&batch->syncpts, sizeof(*store)); + util_dynarray_grow(&batch->syncpts, struct iris_syncpt *, 1); *store = NULL; iris_syncpt_reference(batch->screen, store, syncpt); diff --git a/src/gallium/drivers/lima/lima_draw.c b/src/gallium/drivers/lima/lima_draw.c index c97258c592f..c87542d24bb 100644 --- a/src/gallium/drivers/lima/lima_draw.c +++ b/src/gallium/drivers/lima/lima_draw.c @@ -123,7 +123,7 @@ struct lima_render_state { /* plbu commands */ #define PLBU_CMD_BEGIN(max) { \ int i = 0, max_n = max; \ - uint32_t *plbu_cmd = util_dynarray_grow_cap(&ctx->plbu_cmd_array, max_n * 4); + uint32_t *plbu_cmd = util_dynarray_ensure_cap(&ctx->plbu_cmd_array, ctx->plbu_cmd_array.size + max_n * 4); #define PLBU_CMD_END() \ assert(i <= max_n); \ @@ -172,7 +172,7 @@ struct lima_render_state { /* vs commands */ #define VS_CMD_BEGIN(max) { \ int i = 0, max_n = max; \ - uint32_t *vs_cmd = util_dynarray_grow_cap(&ctx->vs_cmd_array, max_n * 4); + uint32_t *vs_cmd = util_dynarray_ensure_cap(&ctx->vs_cmd_array, ctx->vs_cmd_array.size + max_n * 4); #define VS_CMD_END() \ assert(i <= max_n); \ @@ -1425,7 +1425,7 @@ static void lima_finish_plbu_cmd(struct lima_context *ctx) { int i = 0; - uint32_t *plbu_cmd = util_dynarray_grow_cap(&ctx->plbu_cmd_array, 2 * 4); + uint32_t *plbu_cmd = util_dynarray_ensure_cap(&ctx->plbu_cmd_array, ctx->plbu_cmd_array.size + 2 * 4); plbu_cmd[i++] = 0x00000000; plbu_cmd[i++] = 0x50000000; /* END */ diff --git a/src/gallium/drivers/lima/lima_submit.c b/src/gallium/drivers/lima/lima_submit.c index 83c78bf82da..c54289d1470 100644 --- a/src/gallium/drivers/lima/lima_submit.c +++ b/src/gallium/drivers/lima/lima_submit.c @@ -106,11 +106,11 @@ bool lima_submit_add_bo(struct lima_submit *submit, struct lima_bo *bo, uint32_t } struct drm_lima_gem_submit_bo *submit_bo = - util_dynarray_grow(&submit->gem_bos, sizeof(*submit_bo)); + util_dynarray_grow(&submit->gem_bos, struct drm_lima_gem_submit_bo, 1); submit_bo->handle = bo->handle; submit_bo->flags = flags; - struct lima_bo **jbo = util_dynarray_grow(&submit->bos, sizeof(*jbo)); + struct lima_bo **jbo = util_dynarray_grow(&submit->bos, struct lima_bo, 1); *jbo = bo; /* prevent bo from being freed when submit start */ diff --git a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c index 86e3599325e..2bcb62b97d8 100644 --- a/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c +++ b/src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c @@ -73,7 +73,7 @@ nvfx_fp_imm(struct nvfx_fpc *fpc, float a, float b, float c, float d) float v[4] = {a, b, c, d}; int idx = fpc->imm_data.size >> 4; - memcpy(util_dynarray_grow(&fpc->imm_data, sizeof(float) * 4), v, 4 * sizeof(float)); + memcpy(util_dynarray_grow(&fpc->imm_data, float, 4), v, 4 * sizeof(float)); return nvfx_reg(NVFXSR_IMM, idx); } diff --git a/src/gallium/drivers/nouveau/nv50/nv50_state.c b/src/gallium/drivers/nouveau/nv50/nv50_state.c index 55167a27c09..228feced5d1 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_state.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_state.c @@ -1263,10 +1263,9 @@ nv50_set_global_bindings(struct pipe_context *pipe, if (nv50->global_residents.size <= (end * sizeof(struct pipe_resource *))) { const unsigned old_size = nv50->global_residents.size; - const unsigned req_size = end * sizeof(struct pipe_resource *); - util_dynarray_resize(&nv50->global_residents, req_size); + util_dynarray_resize(&nv50->global_residents, struct pipe_resource *, end); memset((uint8_t *)nv50->global_residents.data + old_size, 0, - req_size - old_size); + nv50->global_residents.size - old_size); } if (resources) { diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c index 12e21862ee0..2ab51c8529e 100644 --- a/src/gallium/drivers/nouveau/nvc0/nvc0_state.c +++ b/src/gallium/drivers/nouveau/nvc0/nvc0_state.c @@ -1370,10 +1370,9 @@ nvc0_set_global_bindings(struct pipe_context *pipe, if (nvc0->global_residents.size <= (end * sizeof(struct pipe_resource *))) { const unsigned old_size = nvc0->global_residents.size; - const unsigned req_size = end * sizeof(struct pipe_resource *); - util_dynarray_resize(&nvc0->global_residents, req_size); + util_dynarray_resize(&nvc0->global_residents, struct pipe_resource *, end); memset((uint8_t *)nvc0->global_residents.data + old_size, 0, - req_size - old_size); + nvc0->global_residents.size - old_size); } if (resources) { diff --git a/src/gallium/drivers/panfrost/midgard/midgard_emit.c b/src/gallium/drivers/panfrost/midgard/midgard_emit.c index bf6ee4508f5..3c331551dd8 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard_emit.c +++ b/src/gallium/drivers/panfrost/midgard/midgard_emit.c @@ -147,11 +147,11 @@ emit_alu_bundle(compiler_context *ctx, source = &scalarized; } - memcpy(util_dynarray_grow(emission, size), source, size); + memcpy(util_dynarray_grow_bytes(emission, 1, size), source, size); } /* Emit padding (all zero) */ - memset(util_dynarray_grow(emission, bundle->padding), 0, bundle->padding); + memset(util_dynarray_grow_bytes(emission, 1, bundle->padding), 0, bundle->padding); /* Tack on constants */ |