[Mesa-dev] [PATCH 0/2] First attempt at asynchronous SwapBuffers

Marek Olšák maraeo at gmail.com
Sat Nov 17 13:02:24 PST 2012


On Sat, Nov 17, 2012 at 5:25 PM, Mathias Fröhlich
<Mathias.Froehlich at gmx.net> wrote:
>
> Hi,
>
> On Thursday, November 15, 2012 19:04:51 Marek Olšák wrote:
>> Yes, that's what I am looking for, though I'd like to have a solution
>> that works with current DRI2 as well.
>>
>> The triple flush is unrelated to DRI2, it's actually an internal issue
>> with libGL and can be fixed easily.
> So may be you attack this one at first, independent of the synchronous buffer
> swap problem?

Ok.

>
> I think the round trip on buffer swap is a problem. And I am not exactly sure
> if the XDC solution is the best solution we can get there, but to me the XDC
> discussed solution feels much more like attacking the real source of the
> problem than introducing a new thread for the buffer swap possibly requiring a
> different X connection like one of your sketches contained. Inventing a thread
> seems like papering over the real problem.
> Just my two cent ...

Not really. The real problem is the flushing overhead of the radeon
driver and the fact the swap must be performed after the enqueued hw
commands in the Mesa driver are flushed (which is offloaded as well).
It's not about hiding some other problem at all, it's really about the
ability to offload *the flush before SwapBuffers*. And in order to do
that, I must offload SwapBuffers as well. Clear?

The thread offloading has been implemented in the radeon driver for
more than a year. We just can't fully use it because of what I've
written above. I'm not inventing anything here.

I wasn't at XDC and I don't really know much about the protocol and
why there are roundtrips. All I want is a SwapBuffers DRI command
which:
- can swap buffers in the fire-and-forget fashion
- doesn't return values, doesn't generate events
- can be invoked with a different X connection than the main one

The main thread can be halfway through enqueuing new hw commands for
the next frame and I want SwapBuffers to work in that situation (at
least DRI buffers shouldn't change).

Also I think Keith doesn't read mesa-dev.

Marek


More information about the mesa-dev mailing list