dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Michel Dänzer" <michel@daenzer.net>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/5] drm/radeon: rework page flip handling
Date: Mon, 5 May 2014 16:23:29 +0200	[thread overview]
Message-ID: <20140505142329.GP20800@phenom.ffwll.local> (raw)
In-Reply-To: <53675975.1060809@daenzer.net>

On Mon, May 05, 2014 at 06:27:17PM +0900, Michel Dänzer wrote:
> On 02.05.2014 22:29, Christian König wrote:
> > Am 02.05.2014 09:25, schrieb Michel Dänzer:
> >> On 29.04.2014 23:29, Christian König wrote:
> >>>
> >>> +static void radeon_flip_work_func(struct work_struct *__work)
> >>>   {
> >> [...]
> >>> +    if (radeon_crtc->flip_work) {
> >>> +        DRM_DEBUG_DRIVER("flip queue: crtc already busy\n");
> >>> +        spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
> >>> +        goto pflip_cleanup1;
> >>> +    }
> >> I'm a little worried about this case. AFAICT this would drop the flip if
> >> a previous one is still pending? I'm not sure current userspace can
> >> actually hit this
> > Yeah, that concerned me as well. The old code dropped the the new flip
> > as well, so I'm pretty sure that the new handling is right and userspace
> > won't hit that.
> > 
> > The only difference to the old code is that I've offloaded it to a
> > separate thread and so can't return -EBUSY any more.
> 
> That's an important difference though: Userspace can react to the -EBUSY
> appropriately, but if flips get dropped silently, bad things will
> happen, such as the wrong buffer being scanned out.
> 
> Keep in mind that we don't control all userspace, e.g. I expect there
> will be an increasing number of Wayland compositors using this
> functionality.

Rules on i915 are that if the pageflip confirmation event hasn't been sent
out yet the driver returns -EBUSY. The locking for that is done using
irq-save spinlocks, so should be doable to check this synchronously before
latching some kinda of async worker.

I didnt read one line of radeon code to check this though ;-)

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-05-05 14:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-29 14:29 [PATCH 1/5] drm/radeon: remove (pre|post)_page_flip callbacks Christian König
2014-04-29 14:29 ` [PATCH 2/5] drm/radeon: split page flip and pending callback Christian König
2014-04-29 14:29 ` [PATCH 3/5] drm/radeon: separate vblank and pflip crtc handling Christian König
2014-04-29 14:29 ` [PATCH 4/5] drm/radeon: rework page flip handling Christian König
2014-05-02  7:25   ` Michel Dänzer
2014-05-02 13:29     ` Christian König
2014-05-05  9:27       ` Michel Dänzer
2014-05-05 14:23         ` Daniel Vetter [this message]
2014-05-14  8:02         ` Michel Dänzer
2014-04-29 14:29 ` [PATCH 5/5] drm/radeon: stop using vblank irq on EG+ Christian König

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=20140505142329.GP20800@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=michel@daenzer.net \
    /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