summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-07-12 16:26:34 +0200
committerSamuel Pitoiset <[email protected]>2018-07-17 10:53:45 +0200
commitf65bee7e85221ebbfa26168ca081ae20dc13a13b (patch)
treed1bbe15912c34bf0e9a69f29db35f77e22fc3062
parent88e56804a72e69ddc904731588d07680a3bf8019 (diff)
radv/winsys: use alloca() for semaphore dependencies
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r--src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
index 5824a29b9e4..c94c0f339fd 100644
--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
+++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
@@ -1376,12 +1376,9 @@ static int radv_amdgpu_cs_submit(struct radv_amdgpu_ctx *ctx,
}
if (sem_info->wait.sem_count && sem_info->cs_emit_wait) {
- sem_dependencies = malloc(sizeof(struct drm_amdgpu_cs_chunk_dep) * sem_info->wait.sem_count);
- if (!sem_dependencies) {
- r = -ENOMEM;
- goto error_out;
- }
+ sem_dependencies = alloca(sizeof(struct drm_amdgpu_cs_chunk_dep) * sem_info->wait.sem_count);
int sem_count = 0;
+
for (unsigned j = 0; j < sem_info->wait.sem_count; j++) {
sem = (struct amdgpu_cs_fence *)sem_info->wait.sem[j];
if (!sem->context)
@@ -1420,7 +1417,6 @@ static int radv_amdgpu_cs_submit(struct radv_amdgpu_ctx *ctx,
chunks,
&request->seq_no);
error_out:
- free(sem_dependencies);
free(wait_syncobj);
free(signal_syncobj);
return r;