[Mesa-dev] [PATCH 1/2] radv/winsys: use alloca() for semaphore dependencies
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Tue Jul 17 08:51:05 UTC 2018
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
On Thu, Jul 12, 2018 at 4:26 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c | 8 ++------
> 1 file 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 5824a29b9e..c94c0f339f 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;
> --
> 2.18.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list