[Mesa-dev] [PATCH 09/10] Float fbconfigs frontend patch [2/3] Creation of dummy X pixmap associated with float buffer.

Ian Romanick idr at freedesktop.org
Thu Jul 18 16:07:21 PDT 2013


On 07/17/2013 04:49 AM, Tomasz Lis wrote:
> From: Tomasz Lis <tomasz.lis at intel.com>
>
> glx: Creation of dummy X pixmap associated with float buffer.
>
> This change addresses the fact that float configs can be only used for pbuffers,
> and that 2D driver may not allow creation of an associated pixmap.
> It wouldn't be needed if 2D driver could always support 128 bpp buffers,
> but even then, there wouldn't be any point in allocating full-size associated
> pixmap which can never be used.

I'm not sure this is correct.  I want to do some more research and play 
around with some other implementations.  I've pushed all of the series 
(with some changes) except this patch.  Since this would qualify as a 
bug fix, this can get cherry picked to the 9.2 branch.

> Signed-off-by: Tomasz Lis <listom at gmail.com>
> ---
>   src/glx/glx_pbuffer.c |   19 +++++++++++++++++--
>   1 file changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c
> index f11305a..67776c4 100644
> --- a/src/glx/glx_pbuffer.c
> +++ b/src/glx/glx_pbuffer.c
> @@ -554,8 +554,23 @@ CreatePbuffer(Display * dpy, struct glx_config *config,
>      UnlockDisplay(dpy);
>      SyncHandle();
>
> -   pixmap = XCreatePixmap(dpy, RootWindow(dpy, config->screen),
> -			  width, height, config->rgbBits);
> +   /* From SGIX_pbuffer spec:
> +    * GLXPbuffers are equivalent to GLXPixmaps with the following exceptions:
> +    * There is no associated X pixmap. Also, since a GLXPbuffer is a GLX
> +    * resource, it may not be possible to render to it using X or an
> +    * X extension other than GLX.
> +    */
> +   if (config->floatMode) {
> +       /* There are no float X pixmaps - create a dummy one, with 1 BPP.
> +        * The 1 BPP is a special value which disables BPP verification
> +        * in XServer. */
> +       pixmap = XCreatePixmap(dpy, RootWindow(dpy, config->screen),
> +                  width, height, 1);
> +   } else {
> +       /* If it is possible to associate an X pixmap, do it. */
> +       pixmap = XCreatePixmap(dpy, RootWindow(dpy, config->screen),
> +                  width, height, config->rgbBits);
> +   }
>
>      if (!CreateDRIDrawable(dpy, config, pixmap, id, attrib_list, i)) {
>         CARD32 o = glx_1_3 ? X_GLXDestroyPbuffer : X_GLXvop_DestroyGLXPbufferSGIX;
>



More information about the mesa-dev mailing list