Bug 97516

Summary: GLX_OML_swap_method not fully supported
Product: Mesa Reporter: Fabian Maurer <dark.shadow4>
Component: GLXAssignee: mesa-dev
Status: RESOLVED MOVED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: dark.shadow4, sa, t_arceri
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Example code how I did the check, code taken from wine

Description Fabian Maurer 2016-08-28 14:52:09 UTC
Created attachment 126086 [details]
Example code how I did the check, code taken from wine

According to a check for extensions (glxinfo) the driver supports "GLX_OML_swap_method", but no pixelformat supports the values "GLX_SWAP_EXCHANGE_OML" or "GLX_SWAP_COPY_OML".
This means pglXChooseFBConfig too fails if it is requested.

Attached a snipped from the wine code to show how I checked for the support. Tell me if you need more information.

Systeminfo:
-Arch 64bit
-Radeon R9 285 using amdgpu and opensource driver
-OpenGL core profile version string: 4.3 (Core Profile) Mesa 12.1.0-devel
-OpenGL version string: 3.0 Mesa 12.1.0-devel
-mesa-git and mesa-libgl-git (84367.fb89551), libdrm-git (5912.b214b05)
Comment 1 Sven Arvidsson 2018-09-01 18:22:58 UTC
*** Bug 107687 has been marked as a duplicate of this bug. ***
Comment 2 Timothy Arceri 2018-09-05 23:42:55 UTC
GLX_SWAP_COPY_OML should be working Thomas Hellstrom added support for it towards the end of 2017. Partial support was also added for GLX_SWAP_EXCHANGE_OML below is a direct copy of Thomas's reply when I asked him what remained to properly expose GLX_SWAP_EXCHANGE_OML [1].

"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 
extra work.

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 
back_buffer_modes[]."

[1] https://lists.freedesktop.org/archives/mesa-dev/2018-September/204407.html
Comment 3 Sven Arvidsson 2018-09-14 14:16:14 UTC
As a temporary workaround to get the game Brink running I disabled the GLX_OML_swap_method. Wine has a check, and will ignore the attribute if the extension is missing.

Brink starts and runs, though I'm not sure what the possible side effects are?
Comment 4 Sven Arvidsson 2018-09-14 20:32:40 UTC
I tried the suggested hack of adding _DRI_ATTRIB_SWAP_EXCHANGE to back_buffer_modes[]. In the case of Brink, it allows me to launch the game, but in fullscreen mode it stops updating the screen, so only a single frame is shown. Running the game windowed seems to work fine.

It could be a problem on my end, though I did rebuild system Mesa (32- and 64bit) so the server side should be picking up the changes too.
Comment 5 GitLab Migration User 2019-09-18 17:45:27 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/106.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.