[Mesa-dev] RFC - libglvnd and GLXVND vendor enumeration to facilitate GLX multi-vendor PRIME GPU offload
Kyle Brenneman
kbrenneman at nvidia.com
Wed Feb 13 19:15:02 UTC 2019
On 02/12/2019 01:58 AM, Michel Dänzer wrote:
> On 2019-02-11 5:18 p.m., Andy Ritger wrote:
>> 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:
>>
>> xserver/glx/glxcmds.c:__glXDisp_QueryServerString():
>>
>> case GLX_VENDOR_NAMES_EXT:
>> if (pGlxScreen->glvnd) {
>> ptr = pGlxScreen->glvnd;
>> break;
>> }
>>
>> pGlxScreen->glvnd appears to be assigned here, defaulting to "mesa",
>> though allowing an xorg.conf override via the "GlxVendorLibrary" option:
>>
>> xserver/glx/glxdri2.c:__glXDRIscreenProbe():
>>
>> xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
>> glvnd = xf86GetOptValString(options, GLXOPT_VENDOR_LIBRARY);
>> if (glvnd)
>> screen->base.glvnd = xnfstrdup(glvnd);
>> free(options);
>>
>> if (!screen->base.glvnd)
>> screen->base.glvnd = strdup("mesa");
>>
>> And swrast unconditionally sets pGlxScreen->glvnd to "mesa":
>>
>> xserver/glx/glxdriswrast.c:__glXDRIscreenProbe():
>>
>> screen->base.glvnd = strdup("mesa");
>>
>> Is there more to this that I'm missing?
> I don't think so, I suspect we were just assuming slightly different
> definitions of "works". :)
>
>
That should get fixed, but since that applies to the libglvnd's normal
vendor selection, I'd say it's orthogonal to GPU offloading. Off the top
of my head, the "GlxVendorLibrary" option ought to work regardless of
which __GLXprovider it finds. I think it would be possible to add a
function to let a driver override the GLX_VENDOR_NAMES_EXT string, too.
-Kyle
More information about the mesa-dev
mailing list