[PATCH libdrm] drm/amdgpu: add new low overhead command submission API. (v2)

Emil Velikov emil.l.velikov at gmail.com
Thu Aug 10 13:56:41 UTC 2017


Hi Dave,

On 18 July 2017 at 04:52, Dave Airlie <airlied at gmail.com> wrote:

> +int amdgpu_cs_submit_raw(amdgpu_device_handle dev,
> +                        amdgpu_context_handle context,
> +                        amdgpu_bo_list_handle bo_list_handle,
> +                        int num_chunks,
> +                        struct drm_amdgpu_cs_chunk *chunks,
> +                        uint64_t *seq_no)
> +{
> +       union drm_amdgpu_cs cs = {0};
> +       uint64_t *chunk_array;
> +       int i, r;
> +       if (num_chunks == 0)
> +               return -EINVAL;
> +
> +       chunk_array = alloca(sizeof(uint64_t) * num_chunks);
Out of curiosity:
Does malloc/free produce noticeable overhead that lead you you alloca?

num_chunks is signed - should we bail on negative values, can we make
it unsigned?

Thanks
Emil


More information about the amd-gfx mailing list