[Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.
thellstrom at vmware.com
Wed Sep 5 12:09:36 UTC 2018
On 09/05/2018 01:45 PM, Timothy Arceri wrote:
> On 16/08/17 04:31, Thomas Hellstrom wrote:
>> Implement back-to-fake-front flips,
>> Fix EGL_BUFFER_PRESERVED path.
>> Implement dri3 support for GLX_SWAP_EXCHANGE_OML and GLX_SWAP_COPY_OML.
>> The back-to-fake-front flips will save a full buffer copy in the case
>> of a
>> fake front being enabled and GLX_SWAP_UNDEFINED_OML.
>> Support for EGL_BUFFER_PRESERVED and GLX_SWAP_X_OML are mostly useful
>> things like glretrace if traces are capured with applications relying
>> on a
>> specific swapbuffer behavior.
>> The EGL_BUFFER_PRESERVED path previously made sure the present was
>> done as
>> a copy, but there was nothing making sure that after the present,
>> the same back buffer was chosen.
>> This has now been changed so that if the previous back buffer is
>> idle, we reuse it. Otherwise we grab a new and copy the contents and
>> buffer age from the previous back buffer. Server side flips are allowed.
>> GLX_SWAP_COPY_OML will behave like EGL_BUFFER_PRESERVED.
>> GLX_SWAP_EXCHANGE_OML will behave similarly, except that we try to
>> reuse the
>> previous fake front as the new back buffer if it's idle. If not, we grab
>> a new back buffer and copy the contents and buffer age from the old
>> fake front.
>> - Split the original patch,
>> - Make sure we have a context for blitImage even if we don't have a
>> current context.
>> - Make sure the delayed backbuffer allocation is performed before
>> glXSwapBuffers, glXCopyBuffers and querying buffer age.
>> - squash three patches related to the same change.
>> - Address review comments by Michel Dänzer.
>> Testing done:
>> piglit tests/quick without regressions on svga.
>> A modified piglit glx-swap-exchange posted for review on the piglit
>> That test required modifying the dri2 state tracke to advertise
>> support for GLX_SWAP_EXCHANGE_OML
> What exactly do I need to do to force this to be advertised? A bigger
> question is what more is required to expose GLX_SWAP_EXCHANGE_OML more
> It seems this is required for a few games running on wine .
You need to get the X server AIGLX to advertize it, because the
available features are the intersection of the X server AIGLX features
and the dri driver features, even if this is purely implemented in the
dri client. The reason GLX works this way is that after you've choosen
your config you can either choose to select a direct or indirect
context. That was a poor design.
Now the problem is that AIGLX isn't able to support it, because it uses
the dri driver dri2 path rather than the dri3 path, and I never got to
modifying AIGLX to use the dri3 path. Didn't think it was worth the
In any case, you can hack-enable GLX_SWAP_EXCHANGE_OML if the client is
using dri3 by adding __DRI_ATTRIB_SWAP_EXCHANGE to back_buffer_modes
in src/gallium/state_trackers/dri/dri_screen.c, recompile and make sure
the X server also picks up the recompiled driver. That is if you have a
gallium driver. This worked fine with vmwgfx at the time I pushed the
patch as tested by the corresponding piglit test.
For the other dri drivers there should be a similar way to set the
>> A piglit glx-swap-copy test derived from the glx-swap-exchange test.
>> Not posted yet.
>> mesa-dev mailing list
>> mesa-dev at lists.freedesktop.org
More information about the mesa-dev