All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Anholt <eric-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
To: christian.koenig-5C7GfCeVMHo@public.gmane.org,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 1/3] dma-buf: add dma_fence_get_stub
Date: Mon, 03 Dec 2018 09:01:19 -0800	[thread overview]
Message-ID: <87bm62h7ds.fsf@anholt.net> (raw)
In-Reply-To: <bd9e0b64-4fb0-400b-ce27-439bc54bf315-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 1825 bytes --]

Christian König <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> Am 03.12.18 um 17:08 schrieb Eric Anholt:
>> Christian König <ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>>> Extract of useful code from the timeline work. This provides a function
>>> to return a stub or dummy fence which is always signaled.
>>>
>>> Signed-off-by: Christian König <christian.koenig-5C7GfCeVMHo@public.gmane.org>
>>> ---
>>>   drivers/dma-buf/dma-fence.c | 36 +++++++++++++++++++++++++++++++++++-
>>>   include/linux/dma-fence.h   |  1 +
>>>   2 files changed, 36 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
>>> index 1551ca7df394..136ec04d683f 100644
>>> --- a/drivers/dma-buf/dma-fence.c
>>> +++ b/drivers/dma-buf/dma-fence.c
>>>   /*
>>>    * fence context counter: each execution context should have its own
>>>    * fence context, this allows checking if fences belong to the same
>>>    * context or not. One device can have multiple separate contexts,
>>>    * and they're used if some engine can run independently of another.
>>>    */
>>> -static atomic64_t dma_fence_context_counter = ATOMIC64_INIT(0);
>>> +static atomic64_t dma_fence_context_counter = ATOMIC64_INIT(1);
>> What's this change for?  I don't see a context allocation in patch #2
>> where the stub fence is being moved from, so this seems out of place.
>
> The stub fence is using context 0 and seqno 0, but since it is always 
> signaled this actually shouldn't matter.
>
> So this is just to be on the extra clean side I made sure that nobody 
> else is using context 0.
>
> Alternatively we could also just allocate one when we initialize it for 
> the first time.

I like the allocate at init idea.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

  parent reply	other threads:[~2018-12-03 17:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 13:07 [PATCH 1/3] dma-buf: add dma_fence_get_stub Christian König
2018-12-03 13:07 ` [PATCH 2/3] drm/syncobj: use dma_fence_get_stub Christian König
     [not found]   ` <20181203130759.10226-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-12-03 16:05     ` Chris Wilson
2018-12-03 13:07 ` [PATCH 3/3] drm/amdgpu: fix NULL fence handling in amdgpu_cs_fence_to_handle_ioctl Christian König
2018-12-03 13:33 ` [PATCH 1/3] dma-buf: add dma_fence_get_stub Chunming Zhou
2018-12-03 13:40   ` Christian König
2018-12-03 15:53     ` Alex Deucher
2018-12-03 16:07       ` Chris Wilson
     [not found] ` <20181203130759.10226-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-12-03 16:04   ` Chris Wilson
2018-12-03 16:08   ` Eric Anholt
2018-12-03 16:12     ` Christian König
     [not found]       ` <bd9e0b64-4fb0-400b-ce27-439bc54bf315-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-12-03 17:01         ` Eric Anholt [this message]
2018-12-03 17:06         ` Chris Wilson
2018-12-03 18:35           ` Christian König
     [not found]     ` <878t16fv93.fsf-WhKQ6XTQaPysTnJN9+BGXg@public.gmane.org>
2018-12-03 16:12       ` Chris Wilson

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=87bm62h7ds.fsf@anholt.net \
    --to=eric-whkq6xtqapystnjn9+bgxg@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=christian.koenig-5C7GfCeVMHo@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.