All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <syrjala@sci.fi>
To: Rob Clark <rob.clark@linaro.org>
Cc: "Ben Widawsky" <ben@bwidawsk.net>,
	patches@linaro.org, daniel.vetter@ffwll.ch,
	"Kristian Høgsberg" <hoegsberg@gmail.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [RFC 0/9] nuclear pageflip
Date: Fri, 14 Sep 2012 21:23:05 +0300	[thread overview]
Message-ID: <20120914182304.GR6512@sci.fi> (raw)
In-Reply-To: <CAF6AEGt=hjpxXcYjqkiNUGKenmtLFKm=Zbh6cKnsoh-49ZUicw@mail.gmail.com>

On Fri, Sep 14, 2012 at 12:34:59PM -0500, Rob Clark wrote:
> On Fri, Sep 14, 2012 at 12:02 PM, Ville Syrjälä
> <ville.syrjala@linux.intel.com> wrote:
> > On Fri, Sep 14, 2012 at 11:29:04AM -0500, Rob Clark wrote:
> >> On Fri, Sep 14, 2012 at 10:48 AM, Ville Syrjälä
> >> <ville.syrjala@linux.intel.com> wrote:
> >> > On Fri, Sep 14, 2012 at 09:45:18AM -0500, Rob Clark wrote:
> >> >> On Fri, Sep 14, 2012 at 8:58 AM, Ville Syrjälä
> >> >> <ville.syrjala@linux.intel.com> wrote:
> >> >> > On Fri, Sep 14, 2012 at 08:25:53AM -0500, Rob Clark wrote:
> >> >> >> On Fri, Sep 14, 2012 at 7:50 AM, Ville Syrjälä
> >> >> >> <ville.syrjala@linux.intel.com> wrote:
> >> >> >> > On Thu, Sep 13, 2012 at 11:35:59AM -0500, Rob Clark wrote:
> >> >> >> >> On Thu, Sep 13, 2012 at 9:29 AM, Ville Syrjälä
> >> >> >> >> <ville.syrjala@linux.intel.com> wrote:
> >> >> >> >> > That's a bit of an open question. I was considering several options:
> >> >> >> >>
> >> >> >> >> the thing I like about one ioctl per crtc is that it avoids this whole
> >> >> >> >> question..
> >> >> >> >>
> >> >> >> >> And, I think as long as you have to update multiple different scanout
> >> >> >> >> address registers, there is always going to be a race in multi-crtc
> >> >> >> >> flipping.  Having a single ioctl does make the race smaller.  I'm not
> >> >> >> >> sure how important that point is.
> >> >> >> >
> >> >> >> > Which race?
> >> >> >>
> >> >> >> ie. if you set REG_CRTC1_ADDR just immediately before vblank and
> >> >> >> REG_CRTC2_ADDR just after
> >> >> >
> >> >> > Well, with unsynced crtcs I wouldn't call that any kind of meaningful race.
> >> >> > The same problem after all exists even with a single crtc. You either make
> >> >> > the deadline and write the register before vblank, or you don't make it
> >> >> > and end up with a repeated frame.
> >> >>
> >> >> I meant w/ sync'd crtc's, there is still no 100% guarantee that the
> >> >> two flip at the same time.
> >> >
> >> > Sure there is. That's what the vblank evade stuff gives you. I just
> >> > happen to need it even when using just one crtc because the hardware
> >> > doesn't have the necessary mechanism to flip several planes atomically.
> >>
> >> hmm, I guess I don't quite follow then.  But I guess I don't know the
> >> intel hw well enough.  It seemed like you weren't atomically updating
> >> scanout registers.
> >
> > I guarantee the atomicity by making sure I'm not too close to the start
> > of vblank when I write the registers. It's a very generic solution that
> > will work on any hardware with double buffered registers that get
> > flipped on vblank. Even if some of the registers would get flipped at
> > slightly different times (eg. plane A flips at vbl_start+1, plane B at
> > vbl_start+10) you could still use this method by extending the range of
> > scanlines to be avoided.
> 
> ahh, ok, double-buffered..  well, if they are double buffered you
> should be able to tolerate two ioctl() calls, because you have a
> relatively large window to update all the registers ;-)

Hey, if "should" would be good enough, there would be no need for an
atomic page flip ioctl.

And somehwat ironically, if I didn't have double buffered registers,
I'd just write the lot of them from the vblank irq handler, which would
be simpler in some sense. Well, to tell the truth, not all registers in
Intel HW are double buffered. Gamma tables/ramps for example are single
buffered, and if we actually start to care about accurate color
reproduction we may need to mix the two approaches. The other approach
would be to reject changes to features backed by single buffered registers
while the relevant piece of hardware is enabled.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/

  reply	other threads:[~2012-09-14 18:30 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-10  3:03 [RFC 0/9] nuclear pageflip Rob Clark
2012-09-10  3:03 ` [RFC 1/9] drm: add atomic fxns Rob Clark
2012-09-12 16:57   ` Jesse Barnes
2012-09-12 17:35     ` Rob Clark
2012-09-12 18:03       ` Ville Syrjälä
2012-09-12 18:34         ` Rob Clark
2012-09-12 19:05       ` Jesse Barnes
2012-09-12 19:57         ` Rob Clark
2012-09-10  3:03 ` [RFC 2/9] drm: add object property type Rob Clark
2012-09-10  3:03 ` [RFC 3/9] drm: add DRM_MODE_PROP_DYNAMIC property flag Rob Clark
2012-09-10  3:03 ` [RFC 4/9] drm: convert plane to properties Rob Clark
2012-09-10  3:03 ` [RFC 5/9] drm: add drm_plane_state Rob Clark
2012-09-10  3:03 ` [RFC 6/9] drm: convert page_flip to properties Rob Clark
2012-09-10  3:03 ` [RFC 7/9] drm: add drm_crtc_state Rob Clark
2012-09-10  3:03 ` [RFC 8/9] drm: nuclear pageflip Rob Clark
2012-09-10  3:03 ` [RFC 9/9] drm/omap: update for atomic age Rob Clark
2012-09-10  3:19 ` [RFC 0/9] nuclear pageflip Rob Clark
2012-09-11 21:15   ` Ben Widawsky
2012-09-11 22:07     ` Rob Clark
2012-09-12  8:59       ` Ville Syrjälä
2012-09-12 12:30         ` Rob Clark
2012-09-12 14:23           ` Ville Syrjälä
2012-09-12 14:28             ` Rob Clark
2012-09-12 14:34               ` Ville Syrjälä
2012-09-12 14:42                 ` Rob Clark
2012-09-12 15:12                   ` Ville Syrjälä
2012-09-12 15:23                     ` Rob Clark
2012-09-12 15:32                       ` Ville Syrjälä
2012-09-12 15:48                         ` Rob Clark
2012-09-12 17:27                           ` Ville Syrjälä
2012-09-12 18:00                             ` Clark, Rob
2012-09-12 18:58                               ` Ville Syrjälä
2012-09-12 19:40                                 ` Rob Clark
2012-09-13  8:40                                   ` Ville Syrjälä
2012-09-13 13:39                                     ` Rob Clark
2012-09-13 14:29                                       ` Ville Syrjälä
2012-09-13 16:35                                         ` Rob Clark
2012-09-14 12:50                                           ` Ville Syrjälä
2012-09-14 13:25                                             ` Rob Clark
2012-09-14 13:58                                               ` Ville Syrjälä
2012-09-14 14:45                                                 ` Rob Clark
2012-09-14 15:48                                                   ` Ville Syrjälä
2012-09-14 16:29                                                     ` Rob Clark
2012-09-14 17:02                                                       ` Ville Syrjälä
2012-09-14 17:34                                                         ` Rob Clark
2012-09-14 18:23                                                           ` Ville Syrjälä [this message]
2012-09-14 21:51                                                             ` Rob Clark
2012-09-15  2:12                                           ` Rob Clark
2012-09-15 14:56                                             ` Ville Syrjälä
2012-09-15 16:07                                               ` Rob Clark
2012-09-15 17:04                                                 ` Ville Syrjälä
2012-09-15 17:15                                                   ` Rob Clark
2012-09-15 19:08                                                     ` Ville Syrjälä
2012-09-15 20:16                                                       ` Rob Clark
2012-09-14 21:14                                 ` Jesse Barnes
2012-09-14 21:42                                   ` Rob Clark
2012-09-14 21:46                                   ` Kristian Høgsberg
2012-09-15 14:53                                     ` Ville Syrjälä
2012-09-15 16:05                                       ` Rob Clark
2012-09-15 18:00                                         ` Ville Syrjälä
2012-09-15 20:10                                           ` Rob Clark

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=20120914182304.GR6512@sci.fi \
    --to=syrjala@sci.fi \
    --cc=ben@bwidawsk.net \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hoegsberg@gmail.com \
    --cc=patches@linaro.org \
    --cc=rob.clark@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 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.