FS#30224 - [mesa] Add drm to egl-platforms

Attached to Project: Arch Linux
Opened by David Rheinsberg (dvdhrm) - Saturday, 09 June 2012, 19:38 GMT
Last edited by Andreas Radke (AndyRTR) - Thursday, 30 August 2012, 20:47 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 7
Private No

Details

Mesa provides an EGL implementation that is already used by Archlinux with X11. However, there are several other EGL native-backends that are useful for applications providing graphics output without X11. This includes mplayer, wayland, plymouth, kmscon and others.

The drm EGL backend is available for a long time now and other distributions include it (like fedora), which is probably no argument to consider it stable but just for a reference: http://pkgs.fedoraproject.org/gitweb/?p=mesa.git;a=blob;f=mesa.spec;hb=HEAD

It would be nice to see --with-egl-platforms=x11,drm in Arch mesa build. In fact, the code that is built with this line is pretty short and only a glue layer. It does simplify the API for programmers heavily, though, and allows building new technology like wayland without requiring separate mesa builds.

Please keep the suggested order "x11,drm" instead of "drm,x11" to not break existing binaries. That is, x11 is the default EGL platform. Applications should set EGL_PLATFORM="<xy>" anyway, but just to be safe we should keep backwards compatibility.

Thanks and regards
David

Btw. --enable-shared-dricore is not used anymore and can be removed from the build-script.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Thursday, 30 August 2012, 20:47 GMT
Reason for closing:  Implemented
Comment by David Rheinsberg (dvdhrm) - Monday, 23 July 2012, 14:30 GMT
It would be nice if someone could comment on that. Something like "currently no time", "not tested enough yet", "still working on it", etc. would also be nice. But being left alone is a little bit frustrating. Anyway, I've looked out a bit more and the following distros also enable it:

Debian (see EGL_DISPLAYS+=drm; they even include wayland as backend):
http://anonscm.debian.org/gitweb/?p=pkg-xorg/lib/mesa.git;a=blob;f=debian/rules;hb=HEAD

Ubuntu (see EGL_DISPLAYS+=drm; they even include wayland as backend):
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/quantal/mesa/quantal/view/head:/debian/rules

Fedora (see --with-egl-platforms=x11,drm; they even include wayland as backend):
http://pkgs.fedoraproject.org/gitweb/?p=mesa.git;a=blob;f=mesa.spec;hb=HEAD

Gentoo (see --with-egl-platforms with "gbm" USE-flag):
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-libs/mesa/mesa-8.0.4.ebuild?view=markup

In fact, I am really looking hard to find a distro _not_ enabling it. This currently includes FreeBSD (but only because EGL did not build on BSD for a long time. They even consider adding it now):
http://www.freebsd.org/cgi/cvsweb.cgi/ports/graphics/libGL/bsd.mesalib.mk?rev=1.20;content-type=text%2Fplain

OpenSuse: build.opensuse.org is down for maintenance since several hours so I haven't found the build instructions, yet.

Mageia/Mandriva: Where the hell do they keep their build-files? Haven't found them, yet.


If you need more background information: using --with-egl-platforms=drm adds DRM as platform-driver for the EGL implementation of mesa. The EGL API is a Khronos API that replaces GLX with a platform-independent approach. Only the backends are platform dependent now. The X11 EGL backend is similar to GLX. The drm backend, though, provides EGL contexts based on linux DRM so we can directly render to framebuffers via OpenGL without the need of a window-system. This can even be used _with_ an existing window system in full-screen mode so we have zero-copy fullscreen apps (by passing the gbm buffer ID to the window-manager instead of blitting the whole window buffer into the frame-buffer; xorg doesn't support this, though).

A short list of other apps whose performance can be increase a _lot_ by using drm as egl-backend (that is, 3D rendering support): mplayer, wayland, kmscon, plymouth, ...5


There is actually no downside when enabling it. No additional dependencies, no other libraries/apps are affected (as long as drm is the second backend after x11, even though I don't know of any app using egl+x11), no performance drops, nothing. Hence, please consider adding it.


As a bonus adding wayland as EGL backend would be nice, too (as I said above, many other distros include it, too). However, this requires libwayland-client/server as dependencies and do not have a stable release, yet. So we have to wait some time for this. However, Kristian (Hoegsberg) announced that the protocol will see a stable release in August so this might be added in the near future, too.

Thanks!
David
Comment by Andreas Radke (AndyRTR) - Saturday, 18 August 2012, 14:22 GMT
I'll probably add it to the next mesa update. Meanwhile abs may be your friend.

for Mageia see:
http://svnweb.mageia.org/packages/cauldron/mesa/current/SPECS/mesa.spec?view=markup&pathrev=270724
Comment by Andreas Radke (AndyRTR) - Sunday, 19 August 2012, 08:51 GMT
Please check mesa 8.0.4-3 that will soon go into testing. I hope I've placed the new files into proper packages and location. Dependencies have changed a bit.
Comment by David Rheinsberg (dvdhrm) - Monday, 20 August 2012, 22:24 GMT
Thanks! Works like a charm.
Comment by Laurent Carlier (lordheavy) - Monday, 20 August 2012, 23:05 GMT
i've tried to clean up a bit mesa meta package (for 9.0 release), you can find it here : http://pkgbuild.com/~lcarlier/mesa-git/sources/mesa-git/

++

Loading...