diff options
Diffstat (limited to 'glx/glxdri2.c')
-rw-r--r-- | glx/glxdri2.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/glx/glxdri2.c b/glx/glxdri2.c index 15253d19d..d1fc3f9fa 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -934,12 +934,23 @@ initializeExtensions(__GLXscreen * screen) /* white lie */ extern glx_func_ptr glXGetProcAddressARB(const char *); +enum { + GLXOPT_VENDOR_LIBRARY, +}; + +static const OptionInfoRec GLXOptions[] = { + { GLXOPT_VENDOR_LIBRARY, "GlxVendorLibrary", OPTV_STRING, {0}, FALSE }, + { -1, NULL, OPTV_NONE, {0}, FALSE }, +}; + static __GLXscreen * __glXDRIscreenProbe(ScreenPtr pScreen) { const char *driverName, *deviceName; __GLXDRIscreen *screen; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + const char *glvnd = NULL; + OptionInfoPtr options; screen = calloc(1, sizeof *screen); if (screen == NULL) @@ -985,6 +996,17 @@ __glXDRIscreenProbe(ScreenPtr pScreen) GLX_PIXMAP_BIT | GLX_PBUFFER_BIT); + options = xnfalloc(sizeof(GLXOptions)); + memcpy(options, GLXOptions, sizeof(GLXOptions)); + 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"); + __glXScreenInit(&screen->base, pScreen); screen->enterVT = pScrn->EnterVT; |