Re: [Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.

2018-09-06 Thread Michel Dänzer
On 2018-09-06 1:20 p.m., Timothy Arceri wrote:
> On 06/09/18 04:57, Thomas Hellstrom wrote:
>> On 09/05/2018 04:30 PM, Timothy Arceri wrote:
>>> On 05/09/18 23:36, Thomas Hellstrom wrote:
 On 09/05/2018 02:36 PM, Timothy Arceri wrote:
> On 05/09/18 22:09, Thomas Hellstrom wrote:
>>
>> 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.
>
> I did try this already with radeonsi but it didn't seem to work. I
> even restarted my PC to make sure the correct driver was selected.

 How did you test? I'll give it a test on vmwgfx + piglit.
 /Thomas
>>>
>>> I just tried running the glx-swap-exchange piglit test. I was still
>>> getting:
>>>
>>> Couldn't get a GLX_SWAP_EXCHANGE_OML, RGBA, double-buffered fbconfig
>>> PIGLIT: {"result": "skip" }
>>
>> It works fine here, piglit test is passing. Didn't work at first, but
>> I got the dri driver installation directory wrong, once that was
>> resolved and the X server really picked up the correct driver it
>> worked fine. What distro are you on?
> 
> I'm using Fedora 28. lsof /opt/xorg/lib/dri/radeonsi_dri.so shows
> 
> Xorg 1952 tarceri mem REG 253,0 78109952 1967931
> /opt/xorg/lib/dri/radeonsi_dri.so

Note that this could be the one glamor uses, whereas the glx module
might use another one. Try something like

 lsof | grep Xorg.*radeonsi


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.

2018-09-06 Thread Timothy Arceri



On 06/09/18 04:57, Thomas Hellstrom wrote:

On 09/05/2018 04:30 PM, Timothy Arceri wrote:

On 05/09/18 23:36, Thomas Hellstrom wrote:

On 09/05/2018 02:36 PM, Timothy Arceri wrote:

On 05/09/18 22:09, Thomas Hellstrom wrote:

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 for
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.


v2:
- 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.
v3:
- 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 list.
That test required modifying the dri2 state tracke to advertise 
unconditional

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 generally?


It seems this is required for a few games running on wine [1].

[1] 
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D97516data=02%7C01%7Cthellstrom%40vmware.com%7Cbf80baf0e82c4d4339e708d6133c25d7%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636717546404445044sdata=RhyyM9A45NftarY5SsJbUz8pMaRTnIbx%2Fp4P2ZRcS64%3Dreserved=0 






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.


Hmm ... thanks for the info. I should at least add some of this to 
the bug report.




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.


I did try this already with radeonsi but it didn't seem to work. I 
even restarted my PC to make sure the correct driver was selected.


How did you test? I'll give it a test on vmwgfx + piglit.
/Thomas


I just tried running the glx-swap-exchange piglit test. I was still 
getting:


Couldn't get a GLX_SWAP_EXCHANGE_OML, RGBA, double-buffered fbconfig
PIGLIT: {"result": "skip" }


It works fine here, piglit test is passing. Didn't work at first, but I 
got the dri driver installation directory wrong, once that was resolved 
and the X server really picked up the correct driver it worked fine. 
What distro are you on?


I'm using Fedora 28. lsof /opt/xorg/lib/dri/radeonsi_dri.so shows

Xorg 1952 tarceri mem REG 253,0 78109952 1967931 
/opt/xorg/lib/dri/radeonsi_dri.so




/Thomas


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.

2018-09-05 Thread Thomas Hellstrom

On 09/05/2018 04:30 PM, Timothy Arceri wrote:

On 05/09/18 23:36, Thomas Hellstrom wrote:

On 09/05/2018 02:36 PM, Timothy Arceri wrote:

On 05/09/18 22:09, Thomas Hellstrom wrote:

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 for
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.


v2:
- 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.
v3:
- 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 list.
That test required modifying the dri2 state tracke to advertise 
unconditional

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 generally?


It seems this is required for a few games running on wine [1].

[1] 
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D97516data=02%7C01%7Cthellstrom%40vmware.com%7Cbf80baf0e82c4d4339e708d6133c25d7%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636717546404445044sdata=RhyyM9A45NftarY5SsJbUz8pMaRTnIbx%2Fp4P2ZRcS64%3Dreserved=0 






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.


Hmm ... thanks for the info. I should at least add some of this to 
the bug report.




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.


I did try this already with radeonsi but it didn't seem to work. I 
even restarted my PC to make sure the correct driver was selected.


How did you test? I'll give it a test on vmwgfx + piglit.
/Thomas


I just tried running the glx-swap-exchange piglit test. I was still 
getting:


Couldn't get a GLX_SWAP_EXCHANGE_OML, RGBA, double-buffered fbconfig
PIGLIT: {"result": "skip" }


It works fine here, piglit test is passing. Didn't work at first, but I 
got the dri driver installation directory wrong, once that was resolved 
and the X server really picked up the correct driver it worked fine. 
What distro are you on?


/Thomas

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.

2018-09-05 Thread Timothy Arceri

On 05/09/18 23:36, Thomas Hellstrom wrote:

On 09/05/2018 02:36 PM, Timothy Arceri wrote:

On 05/09/18 22:09, Thomas Hellstrom wrote:

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 for
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.


v2:
- 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.
v3:
- 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 
list.
That test required modifying the dri2 state tracke to advertise 
unconditional

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 generally?


It seems this is required for a few games running on wine [1].

[1] 
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D97516data=02%7C01%7Cthellstrom%40vmware.com%7Cc71a9d949e56467614c108d6132c3212%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636717488813233512sdata=%2FmIsVYyD7Uvg2DwynXKJS3Am%2FEKiyBVz1d%2BSwjIq2Jw%3Dreserved=0 






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.


Hmm ... thanks for the info. I should at least add some of this to the 
bug report.




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.


I did try this already with radeonsi but it didn't seem to work. I 
even restarted my PC to make sure the correct driver was selected.


How did you test? I'll give it a test on vmwgfx + piglit.
/Thomas


I just tried running the glx-swap-exchange piglit test. I was still getting:

Couldn't get a GLX_SWAP_EXCHANGE_OML, RGBA, double-buffered fbconfig
PIGLIT: {"result": "skip" }









For the other dri drivers there should be a similar way to set the 
back_buffer_modes[].


Thanks,
Thomas


A piglit glx-swap-copy test derived from the glx-swap-exchange test.
Not posted yet.


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fmesa-devdata=02%7C01%7Cthellstrom%40vmware.com%7Cc71a9d949e56467614c108d6132c3212%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636717488813243551sdata=iG47YiO49K4vh1C0aV5SiSX%2BlthujiFPXro5DiDNInY%3Dreserved=0 








___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.

2018-09-05 Thread Thomas Hellstrom

On 09/05/2018 02:36 PM, Timothy Arceri wrote:

On 05/09/18 22:09, Thomas Hellstrom wrote:

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 for
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.


v2:
- 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.
v3:
- 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 
list.
That test required modifying the dri2 state tracke to advertise 
unconditional

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 generally?


It seems this is required for a few games running on wine [1].

[1] 
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D97516data=02%7C01%7Cthellstrom%40vmware.com%7Cc71a9d949e56467614c108d6132c3212%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636717488813233512sdata=%2FmIsVYyD7Uvg2DwynXKJS3Am%2FEKiyBVz1d%2BSwjIq2Jw%3Dreserved=0 






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.


Hmm ... thanks for the info. I should at least add some of this to the 
bug report.




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.


I did try this already with radeonsi but it didn't seem to work. I 
even restarted my PC to make sure the correct driver was selected.


How did you test? I'll give it a test on vmwgfx + piglit.
/Thomas






For the other dri drivers there should be a similar way to set the 
back_buffer_modes[].


Thanks,
Thomas


A piglit glx-swap-copy test derived from the glx-swap-exchange test.
Not posted yet.


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fmesa-devdata=02%7C01%7Cthellstrom%40vmware.com%7Cc71a9d949e56467614c108d6132c3212%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636717488813243551sdata=iG47YiO49K4vh1C0aV5SiSX%2BlthujiFPXro5DiDNInY%3Dreserved=0 







___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.

2018-09-05 Thread Timothy Arceri

On 05/09/18 22:09, Thomas Hellstrom wrote:

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 
for
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.


v2:
- 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.
v3:
- 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 
list.
That test required modifying the dri2 state tracke to advertise 
unconditional

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 
generally?


It seems this is required for a few games running on wine [1].

[1] 
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D97516data=02%7C01%7Cthellstrom%40vmware.com%7Ce4a72f032d3f4912556608d6132507df%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636717447117422764sdata=wFjbtCf59vWLBdSziwUfqVFVYAHEoDcorDx%2FcZxJBr0%3Dreserved=0 






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.


Hmm ... thanks for the info. I should at least add some of this to the 
bug report.




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.


I did try this already with radeonsi but it didn't seem to work. I even 
restarted my PC to make sure the correct driver was selected.




For the other dri drivers there should be a similar way to set the 
back_buffer_modes[].


Thanks,
Thomas


A piglit glx-swap-copy test derived from the glx-swap-exchange test.
Not posted yet.


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fmesa-devdata=02%7C01%7Cthellstrom%40vmware.com%7Ce4a72f032d3f4912556608d6132507df%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636717447117422764sdata=Y4n8dYa33hRjHN2KJlw9gZEQbuWGGz0oWR5FRj0ygd8%3Dreserved=0 






___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.

2018-09-05 Thread Thomas Hellstrom

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 
for
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.


v2:
- 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.
v3:
- 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 
list.
That test required modifying the dri2 state tracke to advertise 
unconditional

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 
generally?


It seems this is required for a few games running on wine [1].

[1] 
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.freedesktop.org%2Fshow_bug.cgi%3Fid%3D97516data=02%7C01%7Cthellstrom%40vmware.com%7Ce4a72f032d3f4912556608d6132507df%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636717447117422764sdata=wFjbtCf59vWLBdSziwUfqVFVYAHEoDcorDx%2FcZxJBr0%3Dreserved=0





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


Thanks,
Thomas


A piglit glx-swap-copy test derived from the glx-swap-exchange test.
Not posted yet.


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fmesa-devdata=02%7C01%7Cthellstrom%40vmware.com%7Ce4a72f032d3f4912556608d6132507df%7Cb39138ca3cee4b4aa4d6cd83d9dd62f0%7C1%7C0%7C636717447117422764sdata=Y4n8dYa33hRjHN2KJlw9gZEQbuWGGz0oWR5FRj0ygd8%3Dreserved=0 





___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.

2018-09-05 Thread Timothy Arceri



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 for
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.

v2:
- 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.
v3:
- 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 list.
That test required modifying the dri2 state tracke to advertise unconditional
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 
generally?


It seems this is required for a few games running on wine [1].

[1] https://bugs.freedesktop.org/show_bug.cgi?id=97516



A piglit glx-swap-copy test derived from the glx-swap-exchange test.
Not posted yet.


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.

2017-08-15 Thread Michel Dänzer
On 16/08/17 03:31 AM, 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 for
> 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.
> 
> v2:
> - 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.
> v3:
> - squash three patches related to the same change.
> - Address review comments by Michel Dänzer.

The series is

Reviewed-by: Michel Dänzer 


-- 
Earthling Michel Dänzer   |   http://www.amd.com
Libre software enthusiast | Mesa and X developer
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 0/9] dri2: Swapbuffer update v3.

2017-08-15 Thread Thomas Hellstrom
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 for
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.

v2:
- 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.
v3:
- 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 list.
That test required modifying the dri2 state tracke to advertise unconditional
support for GLX_SWAP_EXCHANGE_OML
A piglit glx-swap-copy test derived from the glx-swap-exchange test.
Not posted yet.


___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev