Adam Jackson <[email protected]> writes:

> For the dri2 backend, we depend on xfree86 already, so we can walk the
> options for the screen looking for a vendor string from xorg.conf.  For
> the swrast backend we don't have that luxury, so just say mesa.  This
> extension isn't really meaningful on Windows or OSX yet (since libglvnd
> isn't really functional there yet), so on those platforms we don't say
> anything and return BadValue for the token from QueryServerString.
>
> Signed-off-by: Adam Jackson <[email protected]>


> diff --git a/glx/glxdri2.c b/glx/glxdri2.c
> index 15253d1..a3ea273 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,19 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
>                                                 GLX_PIXMAP_BIT |
>                                                 GLX_PBUFFER_BIT);
>  
> +    options = malloc(sizeof(GLXOptions));
> +    if (options) {
> +        memcpy(options, GLXOptions, sizeof(GLXOptions));
> +        xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options);
> +        glvnd = xf86GetOptValString(options, GLXOPT_VENDOR_LIBRARY);
> +        if (glvnd)
> +            screen->base.glvnd = strdup(glvnd);
> +        free(options);

I think you want s/strdup/xnfstrdup/g in this patch.  Other than
(optionally) that, this series looks really good to me.  Patch 12/13
made me particularly happy, so this is all:

Reviewed-by: Eric Anholt <[email protected]>

Attachment: signature.asc
Description: PGP signature

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to