mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: "Sergey Senozhatsky" <senozhatsky@chromium.org>,
	"Christian König" <christian.koenig@amd.com>
Cc: Sumit Semwal <sumit.semwal@linaro.org>,
	Gustavo Padovan <gustavo@padovan.org>,
	Tomasz Figa <tfiga@chromium.org>,
	Ricardo Ribalda <ribalda@chromium.org>,
	Christoph Hellwig <hch@infradead.org>,
	linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [Linaro-mm-sig] Re: [PATCH] dma-fence: allow dma fence to have their own lock
Date: Wed, 1 Jun 2022 15:50:22 +0200	[thread overview]
Message-ID: <87724f19-7976-3a2c-96bc-8652a1cec9e8@gmail.com> (raw)
In-Reply-To: <YpTmhixkV7+yh6wo@google.com>



Am 30.05.22 um 17:45 schrieb Sergey Senozhatsky:
> On (22/05/30 16:55), Christian König wrote:
>> If you just want to create a single dma_fence which is also only bound to a
>> single context you can embed the lock into the fence without much problem.
>>
>> See how the dma_fence_array does that for example: https://elixir.bootlin.com/linux/latest/source/include/linux/dma-fence-array.h#L37
> Christian, I'm not sure I'm following you on the "embed the lock into the
> fence without much problem" part. If I understand it correctly this should
> be something like:
>
> 	fences = kmalloc_array(1, sizeof(*fences), GFP_KERNEL);
> 	for_each_fence(...) {
>
> 		// what spinlock should I use here?
>
> 		dma_fence_init(&fences[i], .. &lock ..);
> 		dma_fence_get(&fences[i]);
> 	}
> 	fence_array = dma_fence_array_create(1, fences, ....);
> 	sync_file_create(&fence_array->base);

Well no, that's the high level usage of the dma_fence_array.

What I meant was this here:

struct dma_fence_array {
     struct dma_fence base;

     spinlock_t lock;
...
};

Regards,
Christian.

> _______________________________________________
> Linaro-mm-sig mailing list -- linaro-mm-sig@lists.linaro.org
> To unsubscribe send an email to linaro-mm-sig-leave@lists.linaro.org


  reply	other threads:[~2022-06-01 13:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-30 14:22 Sergey Senozhatsky
2022-05-30 14:55 ` Christian König
2022-05-30 15:09   ` Sergey Senozhatsky
2022-05-30 15:45   ` Sergey Senozhatsky
2022-06-01 13:50     ` Christian König [this message]
2022-05-31  2:51   ` Sergey Senozhatsky
2022-06-01 12:45     ` [Linaro-mm-sig] " Christian König
2022-06-01 13:22       ` Daniel Vetter
2022-06-01 13:52         ` Christian König
2022-06-01 14:27       ` Sergey Senozhatsky
2022-06-01 14:38         ` Christian König
2022-06-01 14:52           ` Sergey Senozhatsky
2022-06-01 15:06             ` 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=87724f19-7976-3a2c-96bc-8652a1cec9e8@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=hch@infradead.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=ribalda@chromium.org \
    --cc=senozhatsky@chromium.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tfiga@chromium.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

all inboxes | Powered by JetHome®