[PATCH] glx: Fix fbconfigs with no corresponding visual

Ian Romanick idr at freedesktop.org
Tue Apr 12 16:41:03 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/11/2011 08:29 AM, Adam Jackson wrote:
> There are, in general, more fbconfig depths than visual depths.
> fbconfigs need not support Window rendering, however any that do must
> have an associated visual ID (which we got right), and any that do not
> must not claim GLX_WINDOW_BIT in GLX_DRAWABLE_TYPE (which we got wrong).

So... it may be technically legal to expose an fbconfig with
GLX_PIXMAP_BIT and no visual ID, but I have two questions:

1. Is it ever useful?

2. Does any other implementation do it?

The bug (mentioned below) and the piglit test came about because an app
did the wrong thing with GLX_WINDOW_BIT.  If there's no utility in
leaving GLX_PIXMAP_BIT, do we want to take the chance on other apps
doing the wrong thing?  I'll admit that it's a pretty freakin' small
exposure, but I suspect it's still larger than epsilon.

> Fixes piglit/glx-fbconfig-sanity, assuming you have a sufficiently
> recent piglit, as that test formerly wrongly required pixmap-capable
> fbconfigs to have a visual.
> 
> Signed-off-by: Adam Jackson <ajax at redhat.com>

References: https://bugs.freedesktop.org/show_bug.cgi?id=34265

> ---
>  glx/glxscreens.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/glx/glxscreens.c b/glx/glxscreens.c
> index 496cf9e..1969aa3 100644
> --- a/glx/glxscreens.c
> +++ b/glx/glxscreens.c
> @@ -395,8 +395,13 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
>  	    if (depth == pScreen->visuals[i].nplanes)
>  		break;
>  	}
> -	if (i == pScreen->numVisuals)
> +	/* If it can't, fix up the fbconfig to not advertise window support
> +	 * XXX should really do this when creating the fbconfig
> +	 */
> +	if (i == pScreen->numVisuals) {
> +	    config->drawableType &= ~(GLX_WINDOW_BIT);
>  	    continue;
> +	}
>  
>  	/* Create a new X visual for our FBconfig. */
>  	visual = AddScreenVisuals(pScreen, 1, depth);

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2k4w8ACgkQX1gOwKyEAw+BdgCbBzsbxlf5FBDvy9o13qffpq/i
sQEAnigkQuphE9i+yYQmbzcV4Uc7mv/l
=oYO6
-----END PGP SIGNATURE-----


More information about the xorg-devel mailing list