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:
The first one, __GLX_VENDOR_LIBRARY_NAME, doesn't seem to have any official documentation other than the libglvnd code that actually uses it and various
The second, MESA_LOADER_DRIVER_OVERRIDE, is documented on the mesa website.
For my laptop I'm using the following:
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: driver does not expose __driDriverGetExtensions_i915c(): /usr/lib/dri/i915c_dri.so: undefined symbol: __driDriverGetExtensions_i915c
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?
Interesting, thanks for testing. You appear to be the first person to have tried it :)
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 :/