Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 866425 - media-libs/mesa-amber-21.3.9 install broken
Summary: media-libs/mesa-amber-21.3.9 install broken
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-24 22:20 UTC by acmondor
Modified: 2023-01-15 23:23 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for missing __driDriverGetExtensions_i915c symbol (driDriverGetExtensions_i915c.patch,1.94 KB, patch)
2022-08-24 22:20 UTC, acmondor
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description acmondor 2022-08-24 22:20:11 UTC
Created attachment 800902 [details, diff]
Patch for missing __driDriverGetExtensions_i915c symbol

I've been trying to get media-libs/mesa-amber working on an older laptop and ran into a few issues. First of all, it seems the only way to get a system to actually use the installed libraries of the media-libs/mesa-amber package is with a couple environment variables:

    __GLX_VENDOR_LIBRARY_NAME
    MESA_LOADER_DRIVER_OVERRIDE

The first one, __GLX_VENDOR_LIBRARY_NAME, doesn't seem to have any official documentation other than the libglvnd code that actually uses it[1] and various
forum posts[2].

1) https://gitlab.freedesktop.org/glvnd/libglvnd/-/blob/master/src/GLX/libglx.c
2) https://forums.gentoo.org/viewtopic-t-1152344.html,
   https://bbs.archlinux.org/viewtopic.php?id=275808

The second, MESA_LOADER_DRIVER_OVERRIDE, is documented on the mesa website[1].

1) https://docs.mesa3d.org/envvars.html

For my laptop I'm using the following:

    __GLX_VENDOR_LIBRARY_NAME="amber"
    MESA_LOADER_DRIVER_OVERRIDE="i915c"

The above are set via a new file called /etc/env.d/99mesa-amber-env.

The first, __GLX_VENDOR_LIBRARY_NAME, does force the system to use libGLX from the amber package (eg /usr/lib/libGLX_amber.so.0.0.0). However, I had to patch media-libs/mesa-amber to get the second one, MESA_LOADER_DRIVER_OVERRIDE, to work. A patch is required because the existing media-libs/mesa-amber ebuild renames /usr/lib/dri/i915_dri.so to /usr/lib/dri/i915c_dri.so, which breaks the file and symbol naming convention expected by the mesa driver loader code.

When MESA_LOADER_DRIVER_OVERRIDE="i915c" is used without my patch, the driver cannot be loaded. By adding the additional environment variable LIBGL_DEBUG="verbose" the following info is reported:

  MESA-LOADER: dlopen(/usr/lib/dri/i915c_dri.so)
  MESA-LOADER: driver does not expose __driDriverGetExtensions_i915c(): /usr/lib/dri/i915c_dri.so: undefined symbol: __driDriverGetExtensions_i915c
  MESA-LOADER: dlopen(/usr/lib/dri/swrast_dri.so)

What that says is that mesa is expecting to find a symbol in the driver file that matches its name, __driDriverGetExtensions_i915c, and when it doesn't it aborts the loading of that file and defaults to swrast_dri.so. I managed to address this by creating a patch which adds that missing symbol, __driDriverGetExtensions_i915c, see attached.

The patch just clones the code for the _driDriverGetExtensions_i915 symbol. The patch would have been simpler had I just renamed _driDriverGetExtensions_i915 to _driDriverGetExtensions_i915c, but I wasn't sure if there would be any implications to that.

Might it make sense to create an ebuild to includes the above mentioned work arounds?
Comment 1 Matt Turner gentoo-dev 2022-08-25 00:55:14 UTC
Interesting, thanks for testing. You appear to be the first person to have tried it :)
Comment 2 jannis 2023-01-15 23:23:21 UTC
I was bit by this as well. Thanks for investigating and fixing!

In the end, I returned to llvmpipe since the i915 only supports OpenGL 1.3 and some software just doesn't work with that :/