[PATCH] glx: Fix fbconfigs with no corresponding visual
Eric Anholt
eric at anholt.net
Mon Apr 11 15:51:52 PDT 2011
On Mon, 11 Apr 2011 11:29:48 -0400, Adam Jackson <ajax at redhat.com> 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).
>
> 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>
> ---
> 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);
I think that this place (matching fbconfigs with visuals if possible) is
the also right place to also mask off drawabletype for this requirement.
I'd drop XXX comment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110411/e1b0883c/attachment.pgp>
More information about the xorg-devel
mailing list