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 31840
Build 29400: arc lint + arc unit

Event Timeline

jbeich requested review of this revision.May 27 2020, 7:44 AM
jbeich created this revision.
manu added a subscriber: manu.May 27 2020, 8:01 AM
manu added inline comments.
graphics/mesa-libs/pkg-plist
1–3

Missing file ? or is it generated when building mesa ?

jbeich marked an inline comment as done.May 27 2020, 8:07 AM
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.

jbeich updated this revision to Diff 72307.May 27 2020, 9:04 AM
  • Unbreak x11/nvidia-driver build. Slave ports weren't affected
jbeich marked an inline comment as done.May 27 2020, 9:13 AM
jbeich added inline comments.
x11/nvidia-driver/pkg-plist
21

Examples why this file cannot be installed:

jbeich edited the test plan for this revision. (Show Details)May 27 2020, 9:24 AM
jbeich updated this revision to Diff 72312.EditedMay 27 2020, 10:12 AM
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
jbeich updated this revision to Diff 72315.May 27 2020, 10:28 AM
  • What used to conflict with mesa-libs still does but now with libglvnd instead
jbeich updated this revision to Diff 72318.May 27 2020, 12:08 PM
  • Allow misc/raspberrypi-userland for USE_GL += egl glesv2 (partially fixes bug 225053)
jbeich edited the test plan for this revision. (Show Details)May 27 2020, 8:13 PM
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
26–35

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
jbeich marked an inline comment as done.May 28 2020, 2:38 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

jbeich edited the test plan for this revision. (Show Details)May 28 2020, 2:44 PM
graphics/libglvnd/Makefile
7

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

graphics/mesa-libs/pkg-plist
26–35

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

26–35

(finds the _mesa ones)

jbeich updated this revision to Diff 72368.EditedMay 28 2020, 6:43 PM
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
jbeich updated this revision to Diff 72370.May 28 2020, 7:04 PM
  • Reword comment as only X11 server and libglvnd itself use GLX_EXT_libglvnd
jbeich marked 5 inline comments as done.May 28 2020, 7:17 PM
jbeich added inline comments.
graphics/mesa-libs/pkg-plist
26–35

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 marked an inline comment as done.May 28 2020, 7:18 PM
jbeich edited the summary of this revision. (Show Details)May 29 2020, 6:56 AM
jbeich updated this revision to Diff 72400.May 29 2020, 8:46 AM
jbeich edited the summary of this revision. (Show Details)
  • x11-servers/xwayland-devel: drop pkg-message in favor of rP536952
jbeich updated this revision to Diff 72470.EditedMay 31 2020, 9:33 AM

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.

jbeich added a comment.EditedJun 1 2020, 9:21 PM

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.

jbeich updated this revision to Diff 72553.Jun 2 2020, 12:14 AM
jbeich updated this revision to Diff 72756.Jun 5 2020, 11:52 PM
jbeich updated this revision to Diff 72844.Jun 9 2020, 1:12 AM
jbeich updated this revision to Diff 72887.Jun 9 2020, 8:13 PM
jbeich updated this revision to Diff 73010.Jun 12 2020, 7:51 AM
  • Add DEFAULT_VERSIONS support
  • Rebase after rP538571
jbeich updated this revision to Diff 73390.Jun 20 2020, 10:33 AM
arrowd added a subscriber: arrowd.Jun 23 2020, 2:35 PM