From: Daniel Vetter <daniel@ffwll.ch>
To: Gustavo Padovan <gustavo@padovan.org>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
Daniel Stone <daniels@collabora.com>,
Rob Clark <robdclark@gmail.com>,
Greg Hackmann <ghackmann@google.com>,
John Harrison <John.C.Harrison@Intel.com>,
laurent.pinchart@ideasonboard.com, seanpaul@google.com,
marcheu@google.com, m.chehab@samsung.com,
Sumit Semwal <sumit.semwal@linaro.org>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Brian Starkey <brian.starkey@arm.com>,
Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: Re: [PATCH v7 3/3] drm/fence: add out-fences support
Date: Wed, 9 Nov 2016 11:18:14 +0100 [thread overview]
Message-ID: <20161109101814.g5bqvpm46zz2xesg@phenom.ffwll.local> (raw)
In-Reply-To: <20161109023911.GO3327@joana>
On Wed, Nov 09, 2016 at 11:39:11AM +0900, Gustavo Padovan wrote:
> > On Tue, Nov 08, 2016 at 03:54:50PM +0900, Gustavo Padovan wrote:
> > > + if (!access_ok(VERIFY_WRITE, fence_ptr, sizeof(*fence_ptr)))
> > > + return -EFAULT;
> >
> > Same comment about igt coverage I made for patch 1, but with
> > s/in-fence/out-fence/, and s/~0ULL/8/. I picked 8 as an invalid address !=
> > NULL.
> >
> > And the testcase need to cover all possible combinations of output event
> > generation, i.e. out-fence, event and out-fence+event. So 3x3=9 testcases
> > for this I think.
>
> out-fence and event. so 2x2=4 ;)
3 different igt modes I've counted:
- wrong prop after correct fence prop (early failure)
- atomic_check fails (late failure)
- success
With 3 kinds of events:
- fence only
- event only
- both - which might show up some bug if you bail out after e.g. handling
fences, but before handling events and then leak.
Hence 3x3 ;-) But if some of these aren't reasonable I'm ok with leaving
them out, too.
> > > +static void unprepare_crtc_signaling(struct drm_device *dev,
> > > + struct drm_atomic_state *state,
> > > + struct drm_out_fence_state *fence_state)
> > > +{
> > > + struct drm_crtc *crtc;
> > > + struct drm_crtc_state *crtc_state;
> > > + int i;
> > > +
> > > + for_each_crtc_in_state(state, crtc, crtc_state, i) {
> > > + /*
> > > + * TEST_ONLY and PAGE_FLIP_EVENT are mutually
> > > + * exclusive, if they weren't, this code should be
> > > + * called on success for TEST_ONLY too.
> > > + */
> > > + if (crtc_state->event)
> > > + drm_event_cancel_free(dev,
> > > + &crtc_state->event->base);
> > > + }
> > > +
> > > + for (i = 0; fence_state[i].out_fence_ptr; i++) {
> >
> > This goes boom if you have fences set for every crtc, because then this
> > check will walk past the end of the array and do something undefined. You
> > need to manually count how many of these slots are set (and might want to
> > switch to a krealloc pattern while at it). Sounds like it needs an igt.
>
> On the fd_install loop I was also checking for i <
> dev->mode_config.num_crtcs but forgot to add that here. However having a
> num_fences is a better solution, I'll add that.
And adding num_fence will be a good prep for writeback fences from Brian,
too.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
next prev parent reply other threads:[~2016-11-09 10:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 6:54 [PATCH v7 0/3] drm: add explict fencing Gustavo Padovan
2016-11-08 6:54 ` [PATCH v7 1/3] drm/fence: add in-fences support Gustavo Padovan
2016-11-08 11:06 ` Daniel Vetter
2016-11-08 15:27 ` Brian Starkey
2016-11-08 16:11 ` Daniel Vetter
2016-11-08 6:54 ` [PATCH v7 2/3] drm/fence: add fence timeline to drm_crtc Gustavo Padovan
2016-11-08 6:54 ` [PATCH v7 3/3] drm/fence: add out-fences support Gustavo Padovan
2016-11-08 13:15 ` Daniel Vetter
2016-11-09 2:39 ` Gustavo Padovan
2016-11-09 10:18 ` Daniel Vetter [this message]
2016-11-08 15:36 ` Brian Starkey
2016-11-08 10:35 ` [PATCH v7 0/3] drm: add explict fencing Chris Wilson
2016-11-08 11:32 ` Daniel Vetter
2016-11-08 11:45 ` Chris Wilson
2016-11-08 12:43 ` Daniel Vetter
2016-11-08 12:52 ` Chris Wilson
2016-11-08 12:44 ` Christian König
2016-11-08 12:52 ` Daniel Vetter
2016-11-08 13:18 ` Daniel Vetter
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=20161109101814.g5bqvpm46zz2xesg@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=John.C.Harrison@Intel.com \
--cc=brian.starkey@arm.com \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ghackmann@google.com \
--cc=gustavo.padovan@collabora.co.uk \
--cc=gustavo@padovan.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marcheu@google.com \
--cc=robdclark@gmail.com \
--cc=seanpaul@google.com \
--cc=sumit.semwal@linaro.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).