dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rob Clark <robdclark@gmail.com>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [RFC] drm: add flip-work helper
Date: Mon, 5 Aug 2013 10:00:31 +0200	[thread overview]
Message-ID: <20130805080031.GC22035@phenom.ffwll.local> (raw)
In-Reply-To: <CAF6AEGsi-9fKXHqgB3GMqaBvzs73h9GR_=ShD2YSx-J0HiiELw@mail.gmail.com>

On Sun, Aug 04, 2013 at 10:20:54PM -0400, Rob Clark wrote:
> On Sun, Aug 4, 2013 at 1:34 PM, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Thu, Aug 1, 2013 at 1:23 AM, Rob Clark <robdclark@gmail.com> wrote:
> >> A small helper to queue up work to do, from workqueue context, after a
> >> flip.  Typically useful to defer unreffing buffers that may be read by
> >> the display controller until vblank.
> >>
> >> Signed-off-by: Rob Clark <robdclark@gmail.com>
> >> ---
> >> I've re-inventing the same wheel three times in as many drivers (omapdrm,
> >> tilcdc, and in upcoming msm driver I need two of 'em).  I guess it is
> >> time to helper-up.
> >>
> >> I'll update omapdrm and tilcdc to use this as well, but I figured I'd
> >> send an RFC first in case anyone wants to get their bikeshed on.  If
> >> there are other drivers that could use this, and are straightforward
> >> to convert over, let me know and I can update them as well.
> >
> >
> > One thing drm/i915 needs is to be able to flush the workqueue (to make
> > sure we don't pile up giant amounts of buffers waiting to be unpinned
> > and so temporarily leak a bit of memory). So some way to synchronously
> > flush out flip functions would be required (and make sure all that
> > have been queued up to that point are really completed). But at that
> > point a separate workqueue sounds simpler, so I wonder a bit what this
> > gains us? At roughly 50Hz flip work functions aren't really that
> > performance critical imo ...
> 
> you could of course do separate or same workqueue from your main
> render-complete workqueue, or flush the workqueue at whatever point
> you want..  I suppose if you are queuing from a context that is safe
> to sleep you could have a blocking-queue function.  I haven't really
> needed anything like that so far, but feel free to extend the
> flip-work helper however you need to be useful for i915.  (Or point me
> at the bits in i915 that do something similar and I'll have a think
> about how to convert that)

queue_work in do_intel_finish_page_flip and flush_work in
intel_crtc_page_flip is the relevant code. The former is called from irq
context.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2013-08-05  8:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-31 23:23 [RFC] drm: add flip-work helper Rob Clark
2013-08-04 17:34 ` Daniel Vetter
2013-08-05  2:20   ` Rob Clark
2013-08-05  8:00     ` Daniel Vetter [this message]
2013-08-05 16:55       ` 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=20130805080031.GC22035@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robdclark@gmail.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