Page MenuHomeFreeBSD

graphics/mesa-libs: enable libglvnd support
Needs ReviewPublic

Authored by jbeich on May 27 2020, 7:44 AM.

Details

Reviewers
danfe
greg_unrelenting.technology
zeising
Group Reviewers
x11
Summary

See architecture

  • mesa-dri can be used together with nvidia-driver
  • Consumers can depend on the latest GLX/EGL headers
  • Less rebuilds due to changes in dependencies
Test Plan
  • i915kms on Skylake GT2 (0x1912)
  • Firefox (on 11.3 i386) works fine with Sway+Xwayland (on 13.0 amd64)
  • nvidia-driver doesn't break Wayland via GBM
  • exp-run progress is in bug 246767

Diff Detail

Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 33680
Build 30918: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
manu added inline comments.
graphics/mesa-libs/pkg-plist
1–3

Missing file ? or is it generated when building mesa ?

jbeich added inline comments.
graphics/mesa-libs/pkg-plist
1–3

Scroll up. See post-install in Makefile. I wanted to keep all glvnd references in one file (except pkg-plist), so it's easy to rename libGLX_mesa to libGLX_mesa-legacy.

  • Unbreak x11/nvidia-driver build. Slave ports weren't affected
jbeich added inline comments.
x11/nvidia-driver/pkg-plist
19

Examples why this file cannot be installed:

jbeich edited the test plan for this revision. (Show Details)
  • graphics/mesa-libs: drop runtime dependency on libglvnd to catch incomplete USE_GL in consumers
  • x11/nvidia-driver: add missing dependencies to pacify check-plist in poudriere
  • What used to conflict with mesa-libs still does but now with libglvnd instead
  • Allow misc/raspberrypi-userland for USE_GL += egl glesv2 (partially fixes bug 225053)
zeising requested changes to this revision.May 28 2020, 2:00 PM
zeising added a subscriber: zeising.

Hi!
This review requires some work to get going, and in our opinion we must get it right, since breaking this will break the whole graphics stack.

Apart from the comments inline in the review, we also need to figure out how to handle mesa. Currently, the patch adds a build dependency in mesa-libs on libglvnd, and other ports depend on libglvnd through Uses/gl.mk. However, libglvnd will need mesa (or another OpenGL provider) to be installed. With the suggested patch this is only pulled in by accident by the dependency on libgbm.so in a few ports. This means that simple installs might not have all the packages needed to work. This needs to be fixed, most likely by an explicit runtime dependency on mesa in libglvnd, or through Uses/gl.mk. This will mean that users of nVidia drivers will have two OpenGL implementations, but that is already the case today. If/when the ports tree gains a requires/provides, this can be revisited.

Over all, there are several things that need to be fixed in order for this to be accepted, and it has to be thoroughly tested as well, since it is a very large change to how the graphics stack is working.

graphics/libglvnd/Makefile
7

Since libglvnd will be an integral part to the graphics stack, we feel that it should be maintained by x11@. This ensures that updates and releases can be coordinated to try to avoid breakage. This also ensures that any issues and PRs will be easily noticed since they are also sent to the mailing list.

16–19

What is the reason behind using a git commit hash instead of a release tarball for libglvnd?

graphics/mesa-libs/pkg-plist
30–42

Can you explain what is happening with the various libraries in mesa? I can see that libEGL is renamed to libEGL_mesa, but for instance libGLESv2 and libGL seems to be removed completely from the port. Are they simply replaced by libGLX_mesa, and libglvnd understands this, or is this an oversight?

This revision now requires changes to proceed.May 28 2020, 2:00 PM

libglvnd will need mesa (or another OpenGL provider) to be installed.

No difference from mesa-libs. xorg-server and wlroots still depend on mesa-dri and mesa-dri depends on mesa-libs (via libglapi).

Why one would want mesa-libs but not mesa-dri?

This will mean that users of nVidia drivers will have two OpenGL implementations

Assuming NVIDIA users don't want mesa-dri is a mistake. Barring bugs in kernel drivers it should be possible to use Intel/AMD and NVIDIA at the same time e.g., with multiple displays or one display connected to multiple GPUs.

Over all, there are several things that need to be fixed in order for this to be accepted,

What are these? I agree with maintainership, the rest is misunderstanding.

graphics/libglvnd/Makefile
7

Sure. @greg_unrelenting.technology, do you object?

16–19

GL_COMMIT is currently mandatory for USE_GITLAB ports.
See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242329

graphics/libglvnd/Makefile
7

I don't care who maintains ports, happy when it's not me :)

graphics/mesa-libs/pkg-plist
30–42

libGLESv2 libGL etc. are provided by glvnd. They *are* glvnd when it's used. glvnd finds them via share/glvnd/egl_vendor.d/50_mesa.json

30–42

(finds the _mesa ones)

jbeich marked an inline comment as done.
jbeich edited the summary of this revision. (Show Details)
  • graphics/libglvnd: change maintainer to x11@
  • x11-servers/xwayland-devel: document a quirk: still better than before when one had to override libmap.conf
  • Reword comment as only X11 server and libglvnd itself use GLX_EXT_libglvnd
jbeich added inline comments.
graphics/mesa-libs/pkg-plist
30–42

GLX and EGL dispatch are a bit different. I've linked libglvnd architecture in the summary. libGLX_indirect is documented as code comment instead.

libGL is a wrapper library to libGLdispatch and libGLX which is provided for backwards-compatibility with applications which link against the old ABI.

jbeich edited the summary of this revision. (Show Details)
  • x11-servers/xwayland-devel: drop pkg-message in favor of rP536952

Hi!
After discussing this on the Graphics Team meeting today we all agreed that since this is a big update, and we are getting close to both the 11.4 release and the new quarterly ports branch, this has to wait until after the ports tree branch.
This does not mean this is an approval to commit this after the branch, but gives you a timeline of when at the earliest it can go in.

since this is a big update

Based on the amount of QA required, big would be Xorg update, medium would be Mesa update and small are libglvnd, libX11, libwayland, etc. libglvnd offloads updates risk due to API changes away from Mesa. For example, Mesa has Intel/AMD, X11/Wayland/Vulkan and drm-kmod (legacy, 4.1[16], 5.*) but in Xorg has CSM/UEFI, UMS/KMS, non-x86, many DDX, nvidia-driver versions, legacy/devd/libinput, slave/consumer ports.

In short, as you go up the graphics stack the implicit QA via consumers diminishes.

getting close to both the 11.4 release

11.4 packages use rP536699 instead of /quarterly but updates use /quarterly which is a moving target (i.e., can be fixed/reverted).

and the new quarterly ports branch

Makes sense given only 1 month is left while exp-run hasn't even started (antoine@ doesn't scale).

This does not mean this is an approval to commit this after the branch, but gives you a timeline of when at the earliest it can go in.

Review/test in advance then (EDIT: during the waiting period). I can't respect maintainer which doesn't respect me.
/quarterly only spans 3 months, so dragging the first one or two would repeat the situation.

  • Add DEFAULT_VERSIONS support
  • Rebase after rP538571
  • Restore PORTREVISION bump in graphics/mesa-libs

@zeising Is this review approved for an exp-run or not?