Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Daniel Stone <daniel@fooishbar.org>
Cc: Gustavo Padovan <gustavo@padovan.org>,
	linux-samsung-soc <linux-samsung-soc@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/6] drm/exynos: track vblank events on a per crtc basis
Date: Tue, 27 Jan 2015 14:02:48 +0100	[thread overview]
Message-ID: <20150127130248.GA4764@phenom.ffwll.local> (raw)
In-Reply-To: <CAPj87rNsVBAYxOA-Ob3poeqZFDTU2GVJh74+89frb8YSBN8Zzg@mail.gmail.com>

On Tue, Jan 27, 2015 at 12:59:15PM +0000, Daniel Stone wrote:
> Hi,
> 
> On 23 January 2015 at 12:42, Gustavo Padovan <gustavo@padovan.org> wrote:
> >  void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)
> >  {
> >         struct exynos_drm_private *dev_priv = dev->dev_private;
> > -       struct drm_pending_vblank_event *e, *t;
> >         struct drm_crtc *drm_crtc = dev_priv->crtc[pipe];
> >         struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
> > -       unsigned long flags;
> >
> > -       spin_lock_irqsave(&dev->event_lock, flags);
> > +       if (exynos_crtc->event) {
> >
> > -       list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
> > -                       base.link) {
> > -               /* if event's pipe isn't same as crtc then ignore it. */
> > -               if (pipe != e->pipe)
> > -                       continue;
> > -
> > -               list_del(&e->base.link);
> > -               drm_send_vblank_event(dev, -1, e);
> > +               spin_lock_irq(&dev->event_lock);
> > +               drm_send_vblank_event(dev, -1, exynos_crtc->event);
> >                 drm_vblank_put(dev, pipe);
> > -               atomic_set(&exynos_crtc->pending_flip, 0);
> >                 wake_up(&exynos_crtc->pending_flip_queue);
> > -       }
> > +               spin_unlock_irq(&dev->event_lock);
> >
> > -       spin_unlock_irqrestore(&dev->event_lock, flags);
> > +               exynos_crtc->event = NULL;
> > +       }
> >  }
> 
> Doesn't this need to hold the CRTC lock to not race with, e.g, the
> page_flip caller? This gets called from IRQ context though, so might
> need conversion to soft-IRQ to do so, or another per-CRTC spinlock
> just to protect the event.

dev->even_lock should be enough, but I suspect that lock also protects
exynos_crtc->event (at least that's the case in i915.ko). So would need to
be moved out of the if block again.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2015-01-27 13:03 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23 12:42 [PATCH 1/6] drm/exynos: remove leftover code using event_list Gustavo Padovan
2015-01-23 12:42 ` [PATCH 2/6] drm/exynos: track vblank events on a per crtc basis Gustavo Padovan
2015-01-27 12:59   ` Daniel Stone
2015-01-27 13:02     ` Daniel Vetter [this message]
2015-01-29 17:10   ` [PATCH -v2] " Gustavo Padovan
2015-01-30  2:44     ` Joonyoung Shim
2015-01-30 14:30       ` Gustavo Padovan
2015-01-30 15:57         ` Daniel Stone
2015-01-30 16:08           ` Daniel Vetter
2015-01-30 17:17             ` Gustavo Padovan
2015-02-02  5:38               ` Joonyoung Shim
2015-01-23 12:42 ` [PATCH 3/6] drm/exynos: Remove exynos_plane_dpms() call with no effect Gustavo Padovan
2015-01-30  2:12   ` Joonyoung Shim
2015-01-30 14:36     ` Gustavo Padovan
2015-02-02  4:32       ` Joonyoung Shim
2015-01-23 12:42 ` [PATCH 4/6] drm/exynos: remove leftover functions declarations Gustavo Padovan
2015-01-30  2:48   ` Joonyoung Shim
2015-01-23 12:42 ` [PATCH 5/6] drm/exynos: remove struct *_win_data abstraction on planes Gustavo Padovan
2015-01-30  4:32   ` Joonyoung Shim
2015-01-30 14:42     ` Gustavo Padovan
2015-02-02  4:53       ` Joonyoung Shim
2015-01-23 12:43 ` [PATCH 6/6] drm/exynos: do not copy adjusted mode into mode during crtc mode_set Gustavo Padovan
2015-01-30  4:53   ` Joonyoung Shim
2015-01-30 14:44     ` Gustavo Padovan
2015-02-02  4:55       ` Joonyoung Shim
2015-02-03 14:16         ` Gustavo Padovan
2015-02-04  2:10           ` Joonyoung Shim
2015-01-30  2:21 ` [PATCH 1/6] drm/exynos: remove leftover code using event_list Joonyoung Shim
2015-01-30 13:37   ` Gustavo Padovan

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=20150127130248.GA4764@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gustavo@padovan.org \
    --cc=linux-samsung-soc@vger.kernel.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