diff options
author | Jesse Barnes <[email protected]> | 2011-05-06 10:31:24 -0700 |
---|---|---|
committer | Jesse Barnes <[email protected]> | 2011-07-08 12:38:20 -0700 |
commit | 4df137691ee29bb812347fa2c5f19095243ede22 (patch) | |
tree | d8785b7099a772d4993b3855e65173d0b090868d /src/glx/glx_pbuffer.c | |
parent | 1e39fc784bc3d0d5ad01d9c147529ac0e10f1262 (diff) |
GLX/DRI2: handle swap event swap count wrapping
Create a new GLX drawable struct to track client related info, and add a
wrap counter to it drawable and track it as we receive events. This
allows us to support the full 64 bits of the event structure we pass to
the client even though the server only gives us a 32 bit count.
Reviewed-by: Michel Dänzer <[email protected]>
Reviewed-by: Jeremy Huddleston <[email protected]>
Signed-off-by: Jesse Barnes <[email protected]>
Diffstat (limited to 'src/glx/glx_pbuffer.c')
-rw-r--r-- | src/glx/glx_pbuffer.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glx/glx_pbuffer.c b/src/glx/glx_pbuffer.c index 0e74e7ccd0e..6738252a31d 100644 --- a/src/glx/glx_pbuffer.c +++ b/src/glx/glx_pbuffer.c @@ -396,6 +396,7 @@ CreateDrawable(Display *dpy, struct glx_config *config, Drawable drawable, const int *attrib_list, CARD8 glxCode) { xGLXCreateWindowReq *req; + struct glx_drawable *glxDraw; CARD32 *data; unsigned int i; CARD8 opcode; @@ -411,6 +412,10 @@ CreateDrawable(Display *dpy, struct glx_config *config, if (!opcode) return None; + glxDraw = Xmalloc(sizeof(*glxDraw)); + if (!glxDraw) + return None; + LockDisplay(dpy); GetReqExtra(GLXCreateWindow, 8 * i, req); data = (CARD32 *) (req + 1); @@ -429,6 +434,11 @@ CreateDrawable(Display *dpy, struct glx_config *config, UnlockDisplay(dpy); SyncHandle(); + if (InitGLXDrawable(dpy, glxDraw, drawable, xid)) { + free(glxDraw); + return None; + } + if (!CreateDRIDrawable(dpy, config, drawable, xid, attrib_list, i)) { if (glxCode == X_GLXCreatePixmap) glxCode = X_GLXDestroyPixmap; @@ -454,6 +464,7 @@ DestroyDrawable(Display * dpy, GLXDrawable drawable, CARD32 glxCode) protocolDestroyDrawable(dpy, drawable, glxCode); + DestroyGLXDrawable(dpy, drawable); DestroyDRIDrawable(dpy, drawable, GL_FALSE); return; |