Bug 101681

Summary: How to find which DRI version is used by Wayland, and what is the method to change DRI version on Wayland?
Product: Wayland Reporter: _nobody_ <nobodyless>
Component: waylandAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED WONTFIX QA Contact:
Severity: major    
Priority: high CC: nobodyless
Version: 1.4.0   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description _nobody_ 2017-07-03 19:30:00 UTC
How to find which DRI version is used by/beneath Wayland, and what is the method to change DRI version on Wayland (if any)?

Short description of the problem: We have GNOME using Wayland, which uses DRIlib beneath protocol and compositor, and DRI connects to the DRM (generic/transparent for various DRIs), which is wrapper around GFX kernel drivers for the specific integrated GPUs and/or GPUs on the PCIe cards.

I assume Xorg server has both implementations for DRIs (DRI2 and DRI3) beneath X11 protocol. If DRM hooks up GFX kernel driver which uses DRI2 I/F, it'll connect to DRI2lib. If DRI3 I/F, DRM will hook to DRI3lib.

[1] How does this architecture work for Wayland? Does Wayland support both DRI2 and DRI3 (e,g. had both DRI2lib and DRI3lib APIs integrated within Wayland server)?

[2] Could this be changes/enforced the same way as for Xorg server (in /etc/X11/xorg.conf?

[3] Does this (what I wrote here) make any sense??? ;-)

Thank you,
_nobody_
Comment 1 Daniel Stone 2017-07-03 22:51:39 UTC
DRI3 is X11-specific; you cannot 'use DRI2' or 'use DRI3' under Wayland. Mesa implements something which internally looks a bit like DRI3, and other drivers can do their own entirely different things. But I assume there's some other reason you're trying to find this out: what is that reason? Can we help solve your real problem?
Comment 2 samuel.rakitnican 2017-07-04 07:36:24 UTC
My issue with Wayland is that I can't use certain games because of "looks a bit like DRI3", the workaround that I am using on Xorg is that I choose DRI2 for my Intel driver, with Wayland there is no other option. I know the right thing would be to fix the real issue here, but there seems to be no interest by anyone in doing so. So, what then about those users?

https://bugs.freedesktop.org/show_bug.cgi?id=98013
Comment 3 Daniel Stone 2017-07-04 08:08:49 UTC
Ah, I see. In that case, what happens is that Xwayland (which allows X11 clients to run under Wayland compositors) forces those X11 clients to use DRI3. There is no option for DRI2, and will not be; I'm afraid you'd have to wait until bug #98013 gets resolved. Sorry to disappoint.
Comment 4 _nobody_ 2017-07-04 08:52:18 UTC
Hello Daniel,

I would like to thank you for very fast answer.

The primary reason I posted this Bugzilla was to help Sam. But I had aside agenda as well. To better understand the whole Xorg server and Wayland server  architectures, which you greatly contributed to it/understanding! :-)

And here is what I got from your explanation.

[1] Regarding X11 clients and Xorg server I am correct, as I see;
[2] For Wayland clients, the following picture shows correct relations between Wayland clients and Mesa, which beneath has something lookalike DRI3 implementation for the 3D applications:
https://upload.wikimedia.org/wikipedia/commons/a/a7/Wayland_display_server_protocol.svg
[3] I missed point where X11 client has to connect to Wayland server, if Wayland is chosen as server. in such a case, Wayland will continue to support legacy Xorg server architecture, but ONLY for DRI3. In other words, backward compatibility for X11 clients on Wayland server is supported, but ONLY for DRI3.
_______

One more question for you, Daniel, if you allow: do you guys, allow Wayland clients to run with Xorg server? I assume the answer is NO (forward compatibility for Wayland clients on Xorg server is not supported)?

Thank you,
_nobody_
Comment 5 Daniel Stone 2017-07-04 09:12:23 UTC
(In reply to _nobody_ from comment #4)
> The primary reason I posted this Bugzilla was to help Sam. But I had aside
> agenda as well. To better understand the whole Xorg server and Wayland
> server  architectures, which you greatly contributed to it/understanding! :-)

Glad to hear it. :)

> And here is what I got from your explanation.
> 
> [1] Regarding X11 clients and Xorg server I am correct, as I see;
> [2] For Wayland clients, the following picture shows correct relations
> between Wayland clients and Mesa, which beneath has something lookalike DRI3
> implementation for the 3D applications:
> https://upload.wikimedia.org/wikipedia/commons/a/a7/
> Wayland_display_server_protocol.svg

Indeed.

> [3] I missed point where X11 client has to connect to Wayland server, if
> Wayland is chosen as server. in such a case, Wayland will continue to
> support legacy Xorg server architecture, but ONLY for DRI3. In other words,
> backward compatibility for X11 clients on Wayland server is supported, but
> ONLY for DRI3.

In that case, the Wayland server starts a separate process, called Xwayland. Xwayland is an X11 server and a Wayland client: X11 clients connect to Xwayland (sending buffers over DRI3), and Xwayland then forwards those buffers to the Wayland server. So X11 clients do not know the difference (they connect to a real X11 server), and all the translation between X11/Wayland is done inside this server.

It is _in theory_ possible for Xwayland to implement DRI2 for X11 clients, but this is much more work than just fixing DRI3 for you; also fixing DRI3 has a larger benefit for everyone.

> One more question for you, Daniel, if you allow: do you guys, allow Wayland
> clients to run with Xorg server? I assume the answer is NO (forward
> compatibility for Wayland clients on Xorg server is not supported)?

Right, so far there is no kind of reverse-Xwayland. The closest equivalent is running Weston/Mutter/etc under X11, but this is not seamless in the same way that Xwayland is (i.e. showing the clients as part of your regular desktop). I probably wouldn't expect there to be either.
Comment 6 _nobody_ 2017-07-04 10:42:08 UTC
Hello Daniel,

> In that case, the Wayland server starts a separate process, called Xwayland.
> Xwayland is an X11 server and a Wayland client: X11 clients connect to
> Xwayland (sending buffers over DRI3), and Xwayland then forwards those
> buffers to the Wayland server. So X11 clients do not know the difference
> (they connect to a real X11 server), and all the translation between
> X11/Wayland is done inside this server.

I see: here are the pointers explaining this what you wrote above:
https://wayland.freedesktop.org/xserver.html
https://wayland.freedesktop.org/x-on-wayland.png

Once again, thank you very much for the answers!
_nobody_

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.