On Tue, Aug 18, 2009 at 3:52 AM, Thomas Hellström<tho...@shipmail.org> wrote:
> Kristian Høgsberg wrote:
>> By sending an event back on the file descriptor we allow users of the
>> API to wait on the flip to finish in a standard poll or select
>> mainloop, where it can handle input from other sources while waiting.
>> If you rely on fences, the application will block when it tries to
>> access the buffers protected by the fence, and is unable to handle
>> input from other sources while it's blocking.
>>
>
> Yes. you're right. How is the flip_finished event typically used by user
> space?
> Is it mostly for convenience or is it a must have?

In the server we use the event to wake up the client who calls
glXSwapBuffer().  We block the client (SuspendClient) if it tries to
draw before the swap is complete and wake it up again when we get the
event from drm.  See the dri2-swapbuffers branch in xorg/xserver git
for details.

>> Even with the vsync barrier in the command stream (which intel hw also
>> supports) you do need to keep the current front buffer pinned for the
>> remainder of the frame, and then you need notification when the swap
>> has happened so that you can unpin the old buffer.
>
> That would be taken care of by fences (see previous mail), but that's merely
> a terminology thing. The big difference is that the driver would handle that
> synchronization as part of command submission.

Right, but you'll still need an interrupt inside the drm driver to let
you know that the vblank barrier has been processed so you can clear
the fence.

>> I'm sure Unichrome
>> has a command to send an interrupt, which can be queued after the
>> vsync barrier to run the workqueue and trigger this cleanup as well as
>> sending the userspace notification.
>>
>
> Actually it hasn't (stupid hardware), so a medium frequency polling scheme
> needs to be used for most GPU waiting.
> So the user-space notification would require some additional thoughts but
> nothing
> that can't be implemented when the need for it arises.

Yikes. Is there a way to at least get a timestamp from the hw at the
time the swap happens?

cheers,
Kristian

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to