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

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


On Sat, Nov 17, 2012 at 10:28 PM, Dave Airlie <airlied at gmail.com> wrote:
>> 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).
>
> Could we backpatch the relocations if we haven't emitted any CS
> packets since the last frame, if we get an invalidate in the middle?

I'm not sure. It would be possible if the new resource had the same
width, height, and format. Can't we split DRI2SwapBuffers into two
events: 1) check if anything should be invalidated before we start
rendering the next frame, and 2) just swap buffers (blit the
backbuffer, etc.).

Then (1) would be done in glXSwapBuffers and (2) would be done in the
driver thread some time later. Is that feasible?

Marek


More information about the mesa-dev mailing list