intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo.padovan@collabora.com>
To: Robert Foss <robert.foss@collabora.com>
Cc: Daniel Stone <daniels@collabora.com>,
	intel-gfx@lists.freedesktop.org,
	Eric Engestrom <eric@engestrom.ch>,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: Re: [PATCH i-g-t v4 01/13] lib/sw_sync: Add helper functions for managing synchronization primitives
Date: Thu, 15 Sep 2016 16:36:46 -0300	[thread overview]
Message-ID: <20160915193646.GD13282@joana> (raw)
In-Reply-To: <894736ff-1736-261f-a26b-75833d2fbd1e@collabora.com>

2016-09-15 Robert Foss <robert.foss@collabora.com>:

> 
> 
> On 2016-09-15 02:35 PM, Robert Foss wrote:
> > 
> > 
> > On 2016-09-15 02:46 AM, Chris Wilson wrote:
> > > On Wed, Sep 14, 2016 at 11:04:30AM -0400, robert.foss@collabora.com
> > > wrote:
> > > > +void sw_sync_timeline_inc(int fd, uint32_t count)
> > > > +{
> > > > +    uint32_t arg = count;
> > > > +
> > > > +    if (fd == 0)
> > > > +        return;
> > > 
> > > But fd = 0 is a valid fd, and might be a timeline somewhere.
> > > 
> > > Did you mean count == 0 ?
> > > 
> > > And even then (unless it is defined as an error condition in the kernel
> > > ABI, and it should not be...) we should pass it through to the kernel.
> > 
> > You're right, I'll change it in v5.
> > 
> > > 
> > > > +    do_ioctl(fd, SW_SYNC_IOC_INC, &arg);
> > > > +}
> > > > +
> > > 
> > > > +int sw_sync_wait(int fence, int timeout)
> > > > +{
> > > > +    struct pollfd fds;
> > > > +    int ret;
> > > > +
> > > > +    fds.fd = fence;
> > > > +    fds.events = POLLIN | POLLERR;
> > > 
> > > POLLERR is always implied and doesn't need to be specified (it is
> > > meaningless in .events).
> > > 
> > > int sw_sync_wait(int fence, int timeout)
> > > {
> > > #if BEING_FANCY
> > >     return poll(&(struct pollfd){fd, POLLIN}, 1, timeout);
> > > #else
> > >     struct pollfd pfd = { fd, POLLIN };
> > >     return poll(&pfd, 1, timeout);
> > > #endif
> > > }
> > > 
> > > Indentation has gone wrong, double check the whitespace.
> > 
> > That is definitely nicer looking. I'll drop it in for v5.
> > 
> > > 
> > > 
> > > How do fences operate after their timeline is closed? (Are they
> > > automatically signaled, or do they persist and are signaled normally?) Is
> > > there a test for using fences from a closed timeline (I was looking but
> > > didn't notice one).
> > 
> > I did some quick tests just to confirm, closing the timeline signals all
> > of its fences.
> 
> Actually, my quick test was wrong. A fence is _not_ signaled on when its
> timeline has been closed.
> 
> So you would like to see a test that confirms that a fence on closed
> timeline is not signaled?

Yes, please. Add this test and maybe another the signals the fence
before closing the timeline and the check if the fence is indeed
signaled.

Gustavo

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

  reply	other threads:[~2016-09-15 19:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 15:04 [PATCH i-g-t v4 00/13] Implement sw_sync test robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 01/13] lib/sw_sync: Add helper functions for managing synchronization primitives robert.foss
2016-09-15  6:46   ` Chris Wilson
2016-09-15 18:35     ` Robert Foss
2016-09-15 19:28       ` Robert Foss
2016-09-15 19:36         ` Gustavo Padovan [this message]
2016-09-14 15:04 ` [PATCH i-g-t v4 02/13] tests/sw_sync: Add sw_sync test robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 03/13] tests/sw_sync: Add subtest test_alloc_fence robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 04/13] tests/sw_sync: Add subtest test_alloc_fence_invalid_timeline robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 05/13] tests/sw_sync: Add subtest test_alloc_merge_fence robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 06/13] tests/sw_sync: Add subtest test_sync_wait robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 07/13] tests/sw_sync: Add subtest test_sync_merge robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 08/13] tests/sw_sync: Add subtest test_sync_merge_same robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 09/13] tests/sw_sync: Add subtest test_sync_multi_consumer robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 10/13] tests/sw_sync: Add subtest test_sync_multi_consumer_producer robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 11/13] tests/sw_sync: Add subtest test_sync_random_merge robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 12/13] tests/sw_sync: Add subtest test_sync_multi_timeline_wait robert.foss
2016-09-14 15:04 ` [PATCH i-g-t v4 13/13] tests/sw_sync: Add subtest test_sync_multi_producer_single_consumer robert.foss

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=20160915193646.GD13282@joana \
    --to=gustavo.padovan@collabora.com \
    --cc=daniels@collabora.com \
    --cc=eric@engestrom.ch \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=robert.foss@collabora.com \
    /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).