diff options
author | marha <marha@users.sourceforge.net> | 2013-12-22 13:12:15 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-12-22 13:16:58 +0100 |
commit | 1d03b6f684ab1ea6772f00058605a9ebb2910628 (patch) | |
tree | 8b393bd59900eba6aa9010cab9e714922cac2536 /xorg-server/glx/glxcmds.c | |
parent | 5567cf1befbda64f2dc6fae1d337567cd984b46e (diff) | |
parent | c81020559f329a516191927222b3698ba7370aca (diff) | |
download | vcxsrv-1d03b6f684ab1ea6772f00058605a9ebb2910628.tar.gz vcxsrv-1d03b6f684ab1ea6772f00058605a9ebb2910628.tar.bz2 vcxsrv-1d03b6f684ab1ea6772f00058605a9ebb2910628.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
libxtrans fontconfig glproto libX11 libxcb xcbproto mesa xserver pixman xkeyboard-config git update 22 Dec 2013
Conflicts:
mesalib/include/GL/glext.h
mesalib/src/mesa/drivers/dri/common/dri_util.c
mesalib/src/mesa/drivers/dri/swrast/swrast.c
xorg-server/damageext/damageext.c
xorg-server/dix/dispatch.c
xorg-server/glx/glxdriswrast.c
xorg-server/glx/indirect_dispatch.c
xorg-server/glx/indirect_dispatch_swap.c
xorg-server/glx/indirect_program.c
xorg-server/glx/render2.c
xorg-server/glx/render2swap.c
xorg-server/hw/xwin/glx/gen_gl_wrappers.py
xorg-server/hw/xwin/glx/glthunk.c
xorg-server/hw/xwin/glx/indirect.c
xorg-server/include/os.h
xorg-server/present/present_request.c
Diffstat (limited to 'xorg-server/glx/glxcmds.c')
-rw-r--r-- | xorg-server/glx/glxcmds.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/xorg-server/glx/glxcmds.c b/xorg-server/glx/glxcmds.c index fc2bb35bd..34343bde6 100644 --- a/xorg-server/glx/glxcmds.c +++ b/xorg-server/glx/glxcmds.c @@ -2471,3 +2471,64 @@ __glXDisp_ClientInfo(__GLXclientState * cl, GLbyte * pc) return Success; } + +#include <GL/glxtokens.h> + +void +__glXsendSwapEvent(__GLXdrawable *drawable, int type, CARD64 ust, + CARD64 msc, CARD32 sbc) +{ + ClientPtr client = clients[CLIENT_ID(drawable->drawId)]; + + xGLXBufferSwapComplete2 wire = { + .type = __glXEventBase + GLX_BufferSwapComplete + }; + + if (!client) + return; + + if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK)) + return; + + wire.event_type = type; + wire.drawable = drawable->drawId; + wire.ust_hi = ust >> 32; + wire.ust_lo = ust & 0xffffffff; + wire.msc_hi = msc >> 32; + wire.msc_lo = msc & 0xffffffff; + wire.sbc = sbc; + + WriteEventsToClient(client, 1, (xEvent *) &wire); +} + +#if PRESENT +static void +__glXpresentCompleteNotify(WindowPtr window, CARD8 present_mode, CARD32 serial, + uint64_t ust, uint64_t msc) +{ + __GLXdrawable *drawable; + int glx_type; + int rc; + + rc = dixLookupResourceByType((pointer *) &drawable, window->drawable.id, + __glXDrawableRes, serverClient, DixGetAttrAccess); + + if (rc != Success) + return; + + if (present_mode == PresentCompleteModeFlip) + glx_type = GLX_FLIP_COMPLETE_INTEL; + else + glx_type = GLX_BLIT_COMPLETE_INTEL; + + __glXsendSwapEvent(drawable, glx_type, ust, msc, serial); +} + +#include <present.h> + +void +__glXregisterPresentCompleteNotify(void) +{ + present_register_complete_notify(__glXpresentCompleteNotify); +} +#endif |