dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Dave Airlie <airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Emil Velikov <emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: amd-gfx mailing list
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
	ML dri-devel
	<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH libdrm] drm/amdgpu: add new low overhead command submission API. (v2)
Date: Fri, 11 Aug 2017 05:43:42 +1000	[thread overview]
Message-ID: <CAPM=9tx0HMQ8oqzm4o1g0JLBjyCmWX4jyaHWYAPnS0fJzM9u6g@mail.gmail.com> (raw)
In-Reply-To: <CACvgo50nHR-L_ExwdvT48t9dHXrs50CGOmcR4j1SzFBVP6XHiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 10 August 2017 at 23:56, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> Hi Dave,
>
> On 18 July 2017 at 04:52, Dave Airlie <airlied@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?

The preexisting code for these ioctls used alloca so I just followed
the existing pattern.

I doubt we'd notice malloc/free, but we shouldn't also be sending more
than 5-10 chunks
even in the future, so stack alloc should be fine.

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

Possibly, I don't see random users of this API appearing though, but yeah could
change the if <= 0.

Dave.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2017-08-10 19:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18  3:52 [PATCH libdrm] drm/amdgpu: add new low overhead command submission API. (v2) Dave Airlie
2017-07-18 13:59 ` Christian König
2017-08-10 13:56 ` Emil Velikov
     [not found]   ` <CACvgo50nHR-L_ExwdvT48t9dHXrs50CGOmcR4j1SzFBVP6XHiA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-10 19:43     ` Dave Airlie [this message]
     [not found]       ` <CAPM=9tx0HMQ8oqzm4o1g0JLBjyCmWX4jyaHWYAPnS0fJzM9u6g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-08-11  7:41         ` Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPM=9tx0HMQ8oqzm4o1g0JLBjyCmWX4jyaHWYAPnS0fJzM9u6g@mail.gmail.com' \
    --to=airlied-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=emil.l.velikov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).