[Mesa-dev] RFC - libglvnd and GLXVND vendor enumeration to facilitate GLX multi-vendor PRIME GPU offload

Andy Ritger aritger at nvidia.com
Mon Feb 11 16:18:44 UTC 2019

On Mon, Feb 11, 2019 at 12:09:26PM +0100, Michel Dänzer wrote:
> On 2019-02-08 11:43 p.m., Kyle Brenneman wrote:
> > 
> > Also, is Mesa the only client-side vendor library that works with the
> > Xorg GLX module? I vaguely remember that there was at least one other
> > driver that did, but I don't remember the details anymore.
> AFAIK, the amdgpu-pro OpenGL driver can work with the Xorg GLX module
> (or its own forked version of it).

Maybe the amdgpu-pro OpenGL driver uses a fork of the Xorg GLX module
(or sets the "GlxVendorLibrary" X configuration option?), but it doesn't
look to me like the in-tree Xorg GLX module could report anything other
than "mesa" for GLX_VENDOR_NAMES_EXT, without custom user configuration.

GLX_VENDOR_NAMES_EXT, which client-side glvnd uses to pick the
libGLX_${vendor}.so to load, is implemented in the Xorg GLX module
with this:


        if (pGlxScreen->glvnd) {
            ptr = pGlxScreen->glvnd;

pGlxScreen->glvnd appears to be assigned here, defaulting to "mesa", 
though allowing an xorg.conf override via the "GlxVendorLibrary" option:


    xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
    glvnd = xf86GetOptValString(options, GLXOPT_VENDOR_LIBRARY);
    if (glvnd)
        screen->base.glvnd = xnfstrdup(glvnd);

    if (!screen->base.glvnd)
        screen->base.glvnd = strdup("mesa");

And swrast unconditionally sets pGlxScreen->glvnd to "mesa":


    screen->base.glvnd = strdup("mesa");

Is there more to this that I'm missing?

> -- 
> Earthling Michel Dänzer               |               http://www.amd.com
> Libre software enthusiast             |             Mesa and X developer

More information about the xorg-devel mailing list