Re: [Mesa3d-dev] [xserver patch v5 3/5] glx: Enforce a 1:1 correspondence between GLX and X11 windows.

2010-03-22 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kristian Høgsberg wrote:
 2010/2/8 Francisco Jerez curroje...@riseup.net:
 The spec says (regarding glXCreateWindow): If there is already a
 GLXFBConfig associated with win (as a result of a previous
 glXCreateWindow call), then a BadAlloc error is generated.. It will
 also come useful to implement DRI2InvalidateBuffers for the indirect
 case.

 Signed-off-by: Francisco Jerez curroje...@riseup.net

I've put this version of this patch (with krh's R-b) in my GLX-fixes
tree.  Are the all the rest in Kristian's dri2-invalidate tree?

 Looks good,
 
 Reviewed-by: Kristian Høgsberg k...@bitplanet.net
 
 ---
 v5: Simplification as suggested by Kristian.

  glx/glxcmds.c   |   24 +++-
  glx/glxserver.h |1 +
  2 files changed, 24 insertions(+), 1 deletions(-)

 diff --git a/glx/glxcmds.c b/glx/glxcmds.c
 index 77afbf4..cac30e6 100644
 --- a/glx/glxcmds.c
 +++ b/glx/glxcmds.c
 @@ -51,6 +51,15 @@
  #include indirect_table.h
  #include indirect_util.h

 +static int glxWindowPrivateKeyIndex;
 +static DevPrivateKey glxWindowPrivateKey = glxWindowPrivateKeyIndex;
 +
 +__GLXdrawable *
 +glxGetDrawableFromWindow(WindowPtr pWin)
 +{
 +   return dixLookupPrivate(pWin-devPrivates, glxWindowPrivateKey);
 +}
 +
  static int
  validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int 
 *err)
  {
 @@ -519,6 +528,9 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, 
 ClientPtr client,
return NULL;
 }

 +dixSetPrivate(((WindowPtr)pDraw)-devPrivates, glxWindowPrivateKey,
 + pGlxDraw);
 +
 return pGlxDraw;
  }

 @@ -1107,7 +1119,7 @@ __glXDrawableRelease(__GLXdrawable *drawable)
 }
  }

 -static int
 +static int
  DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig 
 *config,
DrawablePtr pDraw, XID glxDrawableId, int type)
  {
 @@ -1128,6 +1140,10 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen 
 *pGlxScreen, __GLXconfig *conf
return BadAlloc;
 }

 +if (type == GLX_DRAWABLE_WINDOW)
 +   dixSetPrivate(((WindowPtr)pDraw)-devPrivates,
 + glxWindowPrivateKey, pGlxDraw);
 +
 return Success;
  }

 @@ -1422,6 +1438,12 @@ int __glXDisp_CreateWindow(__GLXclientState *cl, 
 GLbyte *pc)
return BadWindow;
 }

 +/* Make sure there're no already associated GLX drawables. */
 +if (glxGetDrawableFromWindow((WindowPtr)pDraw)) {
 +   client-errorValue = req-window;
 +   return BadAlloc;
 +}
 +
 if (!validGlxFBConfigForWindow(client, config, pDraw, err))
return err;

 diff --git a/glx/glxserver.h b/glx/glxserver.h
 index 1daf977..3c49b5e 100644
 --- a/glx/glxserver.h
 +++ b/glx/glxserver.h
 @@ -80,6 +80,7 @@ typedef struct __GLXcontext __GLXcontext;

  extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
  extern __GLXclientState *glxGetClient(ClientPtr pClient);
 +extern __GLXdrawable *glxGetDrawableFromWindow(WindowPtr pWin);

  //

 --
 1.6.4.4

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

iEYEARECAAYFAkuny3IACgkQX1gOwKyEAw8s7wCdHFT2LwWBMvANCHW3vAfCbRLv
S/4An3U/kZH+Q4OxUJD3q6YlrFiG2RW4
=g9WK
-END PGP SIGNATURE-

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [xserver patch v5 3/5] glx: Enforce a 1:1 correspondence between GLX and X11 windows.

2010-03-22 Thread Ian Romanick
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kristian Høgsberg wrote:
 2010/3/22 Ian Romanick i...@freedesktop.org:
 Kristian Høgsberg wrote:
 2010/2/8 Francisco Jerez curroje...@riseup.net:
 The spec says (regarding glXCreateWindow): If there is already a
 GLXFBConfig associated with win (as a result of a previous
 glXCreateWindow call), then a BadAlloc error is generated.. It will
 also come useful to implement DRI2InvalidateBuffers for the indirect
 case.

 Signed-off-by: Francisco Jerez curroje...@riseup.net
 I've put this version of this patch (with krh's R-b) in my GLX-fixes
 tree.  Are the all the rest in Kristian's dri2-invalidate tree?
 
 We dropped this one, and the rest is in my dri2-invalidate tree.

Why was it dropped?  I believe that it enforced correct behavior.  If
this really does need to be removed, any suggestions how to fix my tree?
:(  git-revert seems the only way, but that makes for ugly history in a
tree like this.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkuoEBcACgkQX1gOwKyEAw+iWgCePAg8e40Lj+kYXt3xT+ZiQG+g
r6sAnRf0ez7NGhXarxYEw3oPk5E0xBi7
=CVLf
-END PGP SIGNATURE-

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev


Re: [Mesa3d-dev] [xserver patch v5 3/5] glx: Enforce a 1:1 correspondence between GLX and X11 windows.

2010-02-08 Thread Kristian Høgsberg
2010/2/8 Francisco Jerez curroje...@riseup.net:
 The spec says (regarding glXCreateWindow): If there is already a
 GLXFBConfig associated with win (as a result of a previous
 glXCreateWindow call), then a BadAlloc error is generated.. It will
 also come useful to implement DRI2InvalidateBuffers for the indirect
 case.

 Signed-off-by: Francisco Jerez curroje...@riseup.net

Looks good,

Reviewed-by: Kristian Høgsberg k...@bitplanet.net

 ---
 v5: Simplification as suggested by Kristian.

  glx/glxcmds.c   |   24 +++-
  glx/glxserver.h |    1 +
  2 files changed, 24 insertions(+), 1 deletions(-)

 diff --git a/glx/glxcmds.c b/glx/glxcmds.c
 index 77afbf4..cac30e6 100644
 --- a/glx/glxcmds.c
 +++ b/glx/glxcmds.c
 @@ -51,6 +51,15 @@
  #include indirect_table.h
  #include indirect_util.h

 +static int glxWindowPrivateKeyIndex;
 +static DevPrivateKey glxWindowPrivateKey = glxWindowPrivateKeyIndex;
 +
 +__GLXdrawable *
 +glxGetDrawableFromWindow(WindowPtr pWin)
 +{
 +       return dixLookupPrivate(pWin-devPrivates, glxWindowPrivateKey);
 +}
 +
  static int
  validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int 
 *err)
  {
 @@ -519,6 +528,9 @@ __glXGetDrawable(__GLXcontext *glxc, GLXDrawable drawId, 
 ClientPtr client,
        return NULL;
     }

 +    dixSetPrivate(((WindowPtr)pDraw)-devPrivates, glxWindowPrivateKey,
 +                 pGlxDraw);
 +
     return pGlxDraw;
  }

 @@ -1107,7 +1119,7 @@ __glXDrawableRelease(__GLXdrawable *drawable)
     }
  }

 -static int
 +static int
  DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen, __GLXconfig 
 *config,
                    DrawablePtr pDraw, XID glxDrawableId, int type)
  {
 @@ -1128,6 +1140,10 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen 
 *pGlxScreen, __GLXconfig *conf
        return BadAlloc;
     }

 +    if (type == GLX_DRAWABLE_WINDOW)
 +           dixSetPrivate(((WindowPtr)pDraw)-devPrivates,
 +                         glxWindowPrivateKey, pGlxDraw);
 +
     return Success;
  }

 @@ -1422,6 +1438,12 @@ int __glXDisp_CreateWindow(__GLXclientState *cl, 
 GLbyte *pc)
        return BadWindow;
     }

 +    /* Make sure there're no already associated GLX drawables. */
 +    if (glxGetDrawableFromWindow((WindowPtr)pDraw)) {
 +       client-errorValue = req-window;
 +       return BadAlloc;
 +    }
 +
     if (!validGlxFBConfigForWindow(client, config, pDraw, err))
        return err;

 diff --git a/glx/glxserver.h b/glx/glxserver.h
 index 1daf977..3c49b5e 100644
 --- a/glx/glxserver.h
 +++ b/glx/glxserver.h
 @@ -80,6 +80,7 @@ typedef struct __GLXcontext __GLXcontext;

  extern __GLXscreen *glxGetScreen(ScreenPtr pScreen);
  extern __GLXclientState *glxGetClient(ClientPtr pClient);
 +extern __GLXdrawable *glxGetDrawableFromWindow(WindowPtr pWin);

  //

 --
 1.6.4.4



--
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
___
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev