dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@freedesktop.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 79223] extra vsync when reading back pixels in xbmc
Date: Tue, 03 Jun 2014 06:34:49 +0000	[thread overview]
Message-ID: <bug-79223-502-FzN2yVSP1U@http.bugs.freedesktop.org/> (raw)
In-Reply-To: <bug-79223-502@http.bugs.freedesktop.org/>


[-- Attachment #1.1: Type: text/plain, Size: 2234 bytes --]

https://bugs.freedesktop.org/show_bug.cgi?id=79223

--- Comment #17 from Michel Dänzer <michel@daenzer.net> ---
(In reply to comment #14)
> (In reply to comment #13)
> > (In reply to comment #12)
> > > Down to dri2_drawable_get_buffers() now. I assume I'll be hitting a point
> > > where I'll have to switch over to looking in the X server soon...
> > 
> > Yep, it's waiting for DRI2 buffer information from the X server, which is
> > delayed until the previous buffer swap actually finishes.
> 
> Is that expected behaviour? I.e. am I chasing an already known limitation?

Yes, it's a limitation of DRI2 (at least without triple buffering, which is
hard to do with DRI2).

> The xbmc code seems to assume that those gl command will execute
> asynchronously as it is using querires to determine when the rendering and
> glReadPixels() is done.

glReadPixels is currently always synchronous with all Gallium based drivers, as
there's no hardware acceleration for PBOs yet.


> > FWIW, you might get somewhat less confusing timings if you call glFinish()
> > before glXSwapBuffers().
> 
> I'll play around with it. But that doesn't sound like a good solution
> upstream as I guess it will remove parallelism for the drivers that can do
> all of this in the background?

Of course, this wasn't intended as a solution but just as a debugging aid to
try and make your timings correspond better to where the time is actually spent
in the driver / hardware.

That said, in the scenarios you described, there would need to be at least a
glFlush() call before waiting for vblank, otherwise the driver / hardware may
not even start actually rendering the frame before the glXSwapBuffers call.


(In reply to comment #16)
> I guess the behaviour that xbmc is expecting is that the only time it will
> wait for a vblank, is that explicit vblank waiting in step 2.?
> 
> Now is that an unreasonable expectation?

I'm afraid so. It would be better to use something like GLX_OML_sync_control's
glXSwapBuffersMscOML() for timing buffer swaps, instead of explicitly waiting
for vblank and then calling glXSwapBuffers().

-- 
You are receiving this mail because:
You are the assignee for the bug.

[-- Attachment #1.2: Type: text/html, Size: 3387 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2014-06-03  6:34 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-25 19:10 [Bug 79223] New: extra vsync when reading back pixels in xbmc bugzilla-daemon
2014-05-25 19:10 ` [Bug 79223] " bugzilla-daemon
2014-05-25 20:20 ` bugzilla-daemon
2014-05-28  3:09 ` bugzilla-daemon
2014-05-28  5:46 ` bugzilla-daemon
2014-05-28  7:03 ` bugzilla-daemon
2014-05-30 13:15 ` bugzilla-daemon
2014-05-30 13:21 ` bugzilla-daemon
2014-05-30 13:35 ` bugzilla-daemon
2014-05-30 13:47 ` bugzilla-daemon
2014-05-30 20:04 ` bugzilla-daemon
2014-05-30 21:23 ` bugzilla-daemon
2014-06-01 18:21 ` bugzilla-daemon
2014-06-02  7:07 ` bugzilla-daemon
2014-06-02 15:48 ` bugzilla-daemon
2014-06-02 19:24 ` bugzilla-daemon
2014-06-02 19:26 ` bugzilla-daemon
2014-06-03  6:34 ` bugzilla-daemon [this message]
2014-06-03 15:07 ` bugzilla-daemon
2019-11-19  8:49 ` bugzilla-daemon

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=bug-79223-502-FzN2yVSP1U@http.bugs.freedesktop.org/ \
    --to=bugzilla-daemon@freedesktop.org \
    --cc=dri-devel@lists.freedesktop.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