swap event handling fixes
I obviously failed to count the swap event structure size after adding and removing fields a few times, and didn't even account for padding. The end result is that clients today won't receive the sbc_lo field at all, and so will likely stuff junk into that field on the client side (or zero at best).
This patchset fixes up the structure definitions, bumps the proto levels, and adds server and client handling code for it all. It should be forward and backward compatible, but as always review and testing appreciated.
I think the event_type checking on the client side still needs work; the field is split now so I need to check the right one on old servers. I'll also add swap support for the new requests in case people ever want to run this stuff between big and little endian machines.
Thanks,
Jesse
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
A message that is not in the archive (sent off-list or not yet received): 1304022442-8070-1-git-send-email-jbarnes-Y1mF5jBUw70BENJcbMCuUQ@public.gmane.org
PATCH 1/1 Fix swap complete event size
XEvents are limited to 32 bytes, so use some creative stuffing to fit all the bits we'd like to supply.
--- configure.ac | 2 +- dri2proto.h | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-)
configure.ac +1 -1
@@ -1,5 +1,5 @@ AC_PREREQ([2.60]) -AC_INIT([DRI2Proto], [2.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) +AC_INIT([DRI2Proto], [2.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE
dri2proto.h +5 -4
@@ -35,7 +35,7 @@#define DRI2_NAME "DRI2"#define DRI2_MAJOR 1 -#define DRI2_MINOR 3 +#define DRI2_MINOR 4#define DRI2NumberErrors 0#define DRI2NumberEvents 2
@@ -287,16 +287,17 @@ typedef struct {typedef struct {CARD8 type; -CARD8 pad; +CARD8 sbc_lo0; CARD16 sequenceNumber B16; - CARD16 event_type B16; +CARD8 event_type; +CARD8 sbc_lo8; + CARD16 sbc_lo16 B16; CARD32 drawable B32; CARD32 ust_hi B32; CARD32 ust_lo B32; CARD32 msc_hi B32; CARD32 msc_lo B32; CARD32 sbc_hi B32; - CARD32 sbc_lo B32; }xDRI2BufferSwapComplete ;#define sz_xDRI2BufferSwapComplete 32
Signature · 6 lines
1.7.1 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Quoted 11 lines · On Thu, 28 Apr 2011 13:27:18 -0700 Jesse Barnes…
I obviously failed to count the swap event structure size after adding and removing fields a few times, and didn't even account for padding. The end result is that clients today won't receive the
sbc_lofield at all, and so will likely stuff junk into that field on the client side (or zero at best).This patchset fixes up the structure definitions, bumps the proto levels, and adds server and client handling code for it all. It should be forward and backward compatible, but as always review and testing appreciated.
Quoted 4 lines
I think the
event_typechecking on the client side still needs work; the field is split now so I need to check the right one on old servers. I'll also add swap support for the new requests in case people ever want to run this stuff between big and little endian machines.
Btw, I've been trying to test these fixes but I can't make the existing code break; I'm getting a nicely incrementing sbc count using the piglit event test (after adding some code to dump the swap event fields), so somehow the bits are getting through. I just don't know how yet...
Signature · 5 lines
Jesse Barnes, Intel Open Source Technology Center _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Quoted 19 lines · Jesse Barnes
Quoted 11 lines · On Thu, 28 Apr 2011 13:27:18 -0700 Jesse Barnes <[email protected]>…
I obviously failed to count the swap event structure size after adding and removing fields a few times, and didn't even account for padding. The end result is that clients today won't receive the
sbc_lofield at all, and so will likely stuff junk into that field on the client side (or zero at best).This patchset fixes up the structure definitions, bumps the proto levels, and adds server and client handling code for it all. It should be forward and backward compatible, but as always review and testing appreciated.
Quoted 4 lines
I think the
event_typechecking on the client side still needs work; the field is split now so I need to check the right one on old servers. I'll also add swap support for the new requests in case people ever want to run this stuff between big and little endian machines.
Quoted 6 lines
Btw, I've been trying to test these fixes but I can't make the existing code break; I'm getting a nicely incrementing sbc count using the piglit event test (after adding some code to dump the swap event fields), so somehow the bits are getting through. I just don't know how yet...
One thing you could try as another quick test is to use xtrace on a opengl app. I remember seeing weird results for the msc or ust fields (i believe) of decoded and printed DRI2SwapComplete events. I always thought part of my toolchain was just out of sync, but maybe it was just the result of the wrong size/padding.
-mario
Quoted 6 lines
Signature · 5 lines
Jesse Barnes, Intel Open Source Technology Center _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Quoted 36 lines · On Sat, 30 Apr 2011 01:10:27 +0200 Mario Kleiner…
Quoted 25 lines · Jesse Barnes
Quoted 15 lines · On Thu, 28 Apr 2011 13:27:18 -0700 Jesse Barnes <[email protected]>…
I obviously failed to count the swap event structure size after adding
and removing fields a few times, and didn't even account for padding. The
end result is that clients today won't receive thesbc_lofield at all,
and so will likely stuff junk into that field on the client side (or zero at best).This patchset fixes up the structure definitions, bumps the proto levels, and adds server and client handling code for it all. It should
be forward and backward compatible, but as always review and testing appreciated.Quoted 6 lines
I think the
event_typechecking on the client side still needs work; the field is split now so I need to check the right one on old servers.
I'll also add swap support for the new requests in case people ever want
to run this stuff between big and little endian machines.Quoted 7 lines
Btw, I've been trying to test these fixes but I can't make the existing
code break; I'm getting a nicely incrementing sbc count using the piglit event test (after adding some code to dump the swap event fields), so somehow the bits are getting through. I just don't know how yet...
Quoted 5 lines
One thing you could try as another quick test is to use xtrace on a opengl app. I remember seeing weird results for the msc or ust fields (i believe) of decoded and printed DRI2SwapComplete events. I always thought part of my toolchain was just out of sync, but maybe it was just the result of the wrong size/padding.
What I'm seeing is a result of whatever xlib sticks in that space I think. Now I'm seeing bogus values and am testing the fix.
However, for the GLX event, I will have to use a new generic event, since the GLX event types are larger than 8 bits due to the way GLX enumerates things. For DRI2 I can re-pack the existing structure. Will post updated patches soon.
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
PATCH 1/1 Pack swap complete bits into an XEvent
In reply to Jesse BarnesThe defintion of the swap complete event was wrong; XEvents are only 32 bytes long, and with padding the swap event was longer. So use some creative packing to get all the bits we want transmitted. Requires a proto version bump.
--- configure.ac | 2 +- glxproto.h | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-)
configure.ac +1 -1
@@ -1,5 +1,5 @@ AC_PREREQ([2.60]) -AC_INIT([GLProto], [1.4.12], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) +AC_INIT([GLProto], [1.4.13], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE
glxproto.h +9 -4
@@ -1370,18 +1370,23 @@ typedef struct { CARD32 unused2 B32; } xGLXPbufferClobberEvent; +/* Note, this struct is too large for an Xevent, I fail -- jbarnes +* So sbc_lo won't ever be sent. We can use a generic event though without +* size restrictions, thus xGLXBufferSwapComplete2. +*/ typedef struct {BYTE type; -BYTE pad; +BYTE sbc_lo0; CARD16 sequenceNumber B16; - CARD16 event_type B16; -CARD32 drawable; +CARD8 event_type; +CARD8 sbc_lo8; + CARD16 sbc_lo16 B16; + CARD32 drawable B32; CARD32 ust_hi B32; CARD32 ust_lo B32; CARD32 msc_hi B32; CARD32 msc_lo B32; CARD32 sbc_hi B32; - CARD32 sbc_lo B32; }xGLXBufferSwapComplete ;/************************************************************************/
Signature · 1 line
1.7.1
Re: [PATCH] Pack swap complete bits into an XEvent
Quoted 25 lines · Jesse Barnes
The defintion of the swap complete event was wrong; XEvents are only 32 bytes long, and with padding the swap event was longer. So use some creative packing to get all the bits we want transmitted. Requires a proto version bump.
--- configure.ac | 2 +- glxproto.h | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-)configure.ac +1
-1@@ -1,5 +1,5 @@ AC_PREREQ([2.60]) -AC_INIT([GLProto], [1.4.12], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) +AC_INIT([GLProto], [1.4.13], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODEglxproto.h +0
-0
glxproto.h typedef struct { · line 1376
Quoted 7 lines
glxproto.h +4
-0@@ -1370,18 +1370,23 @@ typedef struct { CARD32 unused2 B32; } xGLXPbufferClobberEvent; +/* Note, this struct is too large for an Xevent, I fail -- jbarnes +* So sbc_lo won't ever be sent. We can use a generic event though without +* size restrictions, thus xGLXBufferSwapComplete2. +*/
This comment doesn't seem to match the change.
Quoted 8 lines
glxproto.h +2
-3typedef struct { BYTE type; - BYTE pad; + BYTE sbc_lo0; CARD16 sequenceNumber B16; - CARD16 event_type B16; - CARD32 drawable; + CARD8 event_type;
glxproto.h typedef struct { · line 1390
Quoted 10 lines
glxproto.h +3
-1+CARD8 sbc_lo8; + CARD16 sbc_lo16 B16; + CARD32 drawable B32; CARD32 ust_hi B32; CARD32 ust_lo B32; CARD32 msc_hi B32; CARD32 msc_lo B32; CARD32 sbc_hi B32; - CARD32 sbc_lo B32; } xGLXBufferSwapComplete;
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [PATCH] Pack swap complete bits into an XEvent
Quoted 29 lines · On Thu, 28 Apr 2011 14:33:58 -0700 Eric Anholt…
Quoted 28 lines · Jesse Barnes
The defintion of the swap complete event was wrong; XEvents are only 32 bytes long, and with padding the swap event was longer. So use some creative packing to get all the bits we want transmitted. Requires a proto version bump.
--- configure.ac | 2 +- glxproto.h | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-)configure.ac +1
-1@@ -1,5 +1,5 @@ AC_PREREQ([2.60]) -AC_INIT([GLProto], [1.4.12], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) +AC_INIT([GLProto], [1.4.13], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODEglxproto.h +0
-0@@ -1370,18 +1370,23 @@ typedef struct { CARD32 unused2 B32; } xGLXPbufferClobberEvent;
Quoted 6 lines
glxproto.h typedef struct { · line 1376
Quoted 4 lines
glxproto.h +4
-0+/* Note, this struct is too large for an Xevent, I fail -- jbarnes +* So sbc_lo won't ever be sent. We can use a generic event though without +* size restrictions, thus xGLXBufferSwapComplete2. +*/ This comment doesn't seem to match the change.
double fail. will fix.
Signature · 5 lines
Jesse Barnes, Intel Open Source Technology Center _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] Pack swap complete bits into an XEvent
In reply to Jesse BarnesQuoted 4 lines · Jesse Barnes
The defintion of the swap complete event was wrong; XEvents are only 32 bytes long, and with padding the swap event was longer. So use some creative packing to get all the bits we want transmitted. Requires a proto version bump.
If you've got a proto version on both sides, you should just stick the low 32 bits in place of the event type and pad fields, rather than abusing. Yes, this requires two different structures in the X server, but you need to do that anyways -- the event type has to shrink from 16 bits to 8 bits, moving it at the same time is not a problem.
Besides, this will make the xcb case really ugly as xcb doesn't hide the protocol event structures from the application.
Signature · 1 line
[email protected]
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/1 GLX/DRI2: fix swap complete handling
In reply to Jesse BarnesThe swap complete event wasn't being handled fully; because XEvents are only 32 bytes long, we were getting junk for the sbc_lo value. If the server supports it, unpack the new structure, otherwise just return 0 for the sbc value instead of garbage.
--- configure.ac | 4 ++-- src/glx/dri2.c | 7 ++++++- src/glx/dri2_glx.c | 13 +++++++++++++ src/glx/glxclient.h | 1 + src/glx/glxext.c | 8 +++++++- 5 files changed, 29 insertions(+), 4 deletions(-)
configure.ac +2 -2
@@ -21,8 +21,8 @@ dnl Versions for external dependencies LIBDRM_REQUIRED=2.4.24 LIBDRM_RADEON_REQUIRED=2.4.24 LIBDRM_INTEL_REQUIRED=2.4.24 -DRI2PROTO_REQUIRED=2.1 -GLPROTO_REQUIRED=1.4.11 +DRI2PROTO_REQUIRED=2.4 +GLPROTO_REQUIRED=1.4.13 LIBDRM_XORG_REQUIRED=2.4.24 LIBKMS_XORG_REQUIRED=1.0.0
src/glx/dri2.c +6 -1
@@ -124,7 +124,12 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire) } aevent->ust = ((CARD64 )awire->ust_hi <<32 ) | awire->ust_lo; aevent->msc = ((CARD64 )awire->msc_hi <<32 ) | awire->msc_lo; - aevent->sbc = ((CARD64 )awire->sbc_hi <<32 ) | awire->sbc_lo; +if (dri2ServerSupportsSBC (dpy)) { + aevent->sbc = ((CARD64 )awire->sbc_hi <<32 ) | (awire->sbc_lo16 <<16 ) | + (awire->sbc_lo8 <<8 ) | awire->sbc_lo0; + }else { + aevent->sbc =0 ; + }return True; }#endif
src/glx/dri2_glx.c +13 -0
@@ -791,6 +791,19 @@ static const struct glx_screen_vtable dri2_screen_vtable = { dri2_create_context }; +int +dri2ServerSupportsSBC (Display *dpy) +{ +struct glx_display *dpyPriv =__glXInitialize (dpy); +struct dri2_display *pdp = + (struct dri2_display *) dpyPriv->dri2Display; + +if (pdp->driMajor >1 || (pdp->driMajor ==1 && pdp->driMinor >3 )) +return 1 ; + +return 0 ; +} +static struct glx_screen *dri2CreateScreen (int screen,struct glx_display * priv) {
src/glx/glxclient.h +1 -0
@@ -149,6 +149,7 @@ extern __GLXDRIdisplay *driCreateDisplay(Display * dpy);extern __GLXDRIdisplay *dri2CreateDisplay (Display * dpy);extern void dri2InvalidateBuffers (Display *dpy,XID drawable);extern unsigned dri2GetSwapEventType (Display *dpy,XID drawable); +extern int dri2ServerSupportsSBC (Display *dpy);/*
src/glx/glxext.c +7 -1
@@ -138,7 +138,13 @@ __glXWireToEvent(Display *dpy, XEvent *event, xEvent *wire) aevent->drawable = awire->drawable; aevent->ust = ((CARD64 )awire->ust_hi <<32 ) | awire->ust_lo; aevent->msc = ((CARD64 )awire->msc_hi <<32 ) | awire->msc_lo; - aevent->sbc = ((CARD64 )awire->sbc_hi <<32 ) | awire->sbc_lo; +if (glx_dpy->majorVersion >1 || (glx_dpy->majorVersion ==1 && + glx_dpy->minorVersion >4 )) { + aevent->sbc = ((CARD64 )awire->sbc_hi <<32 ) | (awire->sbc_lo16 <<16 ) | + (awire->sbc_lo8 <<8 ) | awire->sbc_lo0; + }else { + aevent->sbc =0 ; + }return True; }default :
Signature · 1 line
1.7.1
PATCH 1/1 DRI2/GLX: fix swap event handling
In reply to Jesse BarnesUse the new swap event structure packing and send it to the client if possible. This means tracking client version information when clients connect. If they don't support the new packing, they'll get the old bits and fill junk into their sbc values when they receive the event. If they do support the new packing, send off the right data.
--- configure.ac | 4 +- glx/glxdri2.c | 28 +++++++++++++++++++- hw/xfree86/dri2/dri2.c | 57 ++++++++++++++++++++++++++++++++++++++++++- hw/xfree86/dri2/dri2ext.c | 14 ++++++++++- include/protocol-versions.h | 2 +- 5 files changed, 98 insertions(+), 7 deletions(-)
configure.ac +2 -2
@@ -771,11 +771,11 @@ RECORDPROTO="recordproto >= 1.13.99.1" SCRNSAVERPROTO="scrnsaverproto >= 1.1" RESOURCEPROTO="resourceproto" DRIPROTO="xf86driproto >= 2.1.0" -DRI2PROTO="dri2proto >= 2.3" +DRI2PROTO="dri2proto >= 2.4" XINERAMAPROTO="xineramaproto" BIGFONTPROTO="xf86bigfontproto >= 1.2.0" DGAPROTO="xf86dgaproto >= 2.0.99.1" -GLPROTO="glproto >= 1.4.10" +GLPROTO="glproto >= 1.4.13" DMXPROTO="dmxproto >= 2.2.99.1" VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" WINDOWSWMPROTO="windowswmproto"
glx/glxdri2.c +26 -2
@@ -192,8 +192,17 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, wire.ust_lo = ust &0xffffffff ; wire.msc_hi = msc >>32 ; wire.msc_lo = msc &0xffffffff ; - wire.sbc_hi = sbc >>32 ; - wire.sbc_lo = sbc &0xffffffff ; + wire.sbc_hi =0 ; + +if (DRI2ClientSupportsSBC (client)) { + wire.sbc_lo0 = sbc &0xff ; + wire.sbc_lo8 = (sbc >>8 ) &0xff ; + wire.sbc_lo16 = (sbc >>16 ) &0xff ; + }else { + wire.sbc_lo0 =0 ; + wire.sbc_lo8 =0 ; + wire.sbc_lo16 =0 ; + }WriteEventsToClient (client,1 , (xEvent *) &wire); }
@@ -228,6 +237,18 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable)return TRUE; } +static void +__glXDRIclientGone (CallbackListPtr *list, +pointer closure, +pointer data) +{ +NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; +ClientPtr pClient = clientinfo->client; + +if (pClient->clientState == ClientStateGone) +DRI2ClientGone (client); +} +static int __glXDRIdrawableSwapInterval (__GLXdrawable *drawable,int interval) {
@@ -769,6 +790,9 @@ __glXDRIscreenProbe(ScreenPtr pScreen) screen->leaveVT = pScrn->LeaveVT; pScrn->LeaveVT = glxDRILeaveVT; +if (!AddCallback (&ClientStateCallback, __glXDRIclientGone,0 )) +return ; +LogMessage (X_INFO ,"AIGLX: Loaded and initialized %s\n" , driverName);
hw/xfree86/dri2/dri2.c +56 -1
93 lines not on this page · raw message
hw/xfree86/dri2/dri2ext.c +13 -1
@@ -77,6 +77,9 @@ ProcDRI2QueryVersion(ClientPtr client)swaps (&stuff->length, n);REQUEST_SIZE_MATCH (xDRI2QueryVersionReq); + +DRI2InitClient (client, stuff->majorVersion, stuff->minorVersion); + rep.type = X_Reply; rep.length =0 ; rep.sequenceNumber = client->sequence;
@@ -370,7 +373,16 @@ DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc, event.msc_hi = (CARD64 )msc >>32 ; event.msc_lo = msc &0xffffffff ; event.sbc_hi = (CARD64 )sbc >>32 ; - event.sbc_lo = sbc &0xffffffff ; + +if (DRI2ClientSupportsSBC (client)) { + event.sbc_lo0 = sbc &0xff ; + event.sbc_lo8 = (sbc >>8 ) &0xff ; + event.sbc_lo16 = (sbc >>16 ) &0xffff ; + }else { + event.sbc_lo0 =0 ; + event.sbc_lo8 =0 ; + event.sbc_lo16 =0 ; + }WriteEventsToClient (client,1 , (xEvent *)&event); }
include/protocol-versions.h +1 -1
@@ -57,7 +57,7 @@/* GLX */ #define SERVER_GLX_MAJOR_VERSION 1 -#define SERVER_GLX_MINOR_VERSION 4 +#define SERVER_GLX_MINOR_VERSION 5/* Xinerama */ #define SERVER_PANORAMIX_MAJOR_VERSION 1
Signature · 1 line
1.7.1
A message that is not in the archive (sent off-list or not yet received): 1304022442-8070-5-git-send-email-jbarnes-Y1mF5jBUw70BENJcbMCuUQ@public.gmane.org
Re: [PATCH] DRI2/GLX: fix swap event handling
Quoted 9 lines · Jesse Barnes
Use the new swap event structure packing and send it to the client if possible. This means tracking client version information when clients connect. If they don't support the new packing, they'll get the old bits and fill junk into their sbc values when they receive the event. If they do support the new packing, send off the right data.
glx/glxdri2.c __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, · line 195
Quoted 6 lines
glx/glxdri2.c +1
-2@@ -192,8 +192,17 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, wire.ust_lo = ust &0xffffffff ; wire.msc_hi = msc >>32 ; wire.msc_lo = msc &0xffffffff ; - wire.sbc_hi = sbc >>32 ; - wire.sbc_lo = sbc &0xffffffff ; + wire.sbc_hi =0 ;
was that supposed to be wire.sbc_lo and not whacking wire.sbc_hi?
At first I was confused by this whole thing -- why not rearrange the structure a bit if we're messing things up? Then I realized that this let the server emit the mostly-the-same event structure and only steal the other half of event_type for clients that understand the new 8-bit event_type protocol. Seems like a reasonable approach.
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
Re: [PATCH] DRI2/GLX: fix swap event handling
In reply to Jesse Barneshw/xfree86/dri2/dri2.c DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) · line 1175
Quoted 9 lines · Jesse Barnes
hw/xfree86/dri2/dri2.c +1
-1@@ -1114,7 +1169,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) ds->ScheduleSwap = info->ScheduleSwap; ds->ScheduleWaitMSC = info->ScheduleWaitMSC; ds->GetMSC = info->GetMSC; - cur_minor =3 ; + cur_minor =4 ; }else { cur_minor =1 ; }
This bugfix should probably be separate.
Signature · 6 lines
Earthling Michel Dänzer | http://www.vmware.com Libre software enthusiast | Debian, X and DRI developer _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] DRI2/GLX: fix swap event handling
In reply to Jesse BarnesQuoted 6 lines · Jesse Barnes
glx/glxdri2.c +0
-0@@ -192,8 +192,17 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, wire.ust_lo = ust &0xffffffff ;
glx/glxdri2.c __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, · line 200
Quoted 10 lines
glx/glxdri2.c +6
-2wire.msc_hi = msc >>32 ; wire.msc_lo = msc &0xffffffff ; - wire.sbc_hi = sbc >>32 ; - wire.sbc_lo = sbc &0xffffffff ; + wire.sbc_hi =0 ; + +if (DRI2ClientSupportsSBC (client)) { + wire.sbc_lo0 = sbc &0xff ; + wire.sbc_lo8 = (sbc >>8 ) &0xff ; + wire.sbc_lo16 = (sbc >>16 ) &0xff ;
This one should be wire.sbc_lo16 = (sbc >> 16) & 0xffff;
glx/glxdri2.c __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, · line 208
Quoted 8 lines
glx/glxdri2.c +5
-0+ }else { + wire.sbc_lo0 =0 ; + wire.sbc_lo8 =0 ; + wire.sbc_lo16 =0 ; + }WriteEventsToClient (client,1 , (xEvent *) &wire); }
Also I think big endian clients (when built against the old protocol header) will expect the low byte of event_type where you now have sbc_lo8, so you would need to swap them. Same for the dri2 event.
[...]
include/protocol-versions.h line 61
Quoted 11 lines
include/protocol-versions.h +1
-1@@ -57,7 +57,7 @@/* GLX */ #define SERVER_GLX_MAJOR_VERSION 1 -#define SERVER_GLX_MINOR_VERSION 4 +#define SERVER_GLX_MINOR_VERSION 5
Do we get to bump the GLX protocol version? Somehow I thought that was khronos business.
include/protocol-versions.h line 63
Quoted 2 lines
include/protocol-versions.h +0
-0/* Xinerama */ #define SERVER_PANORAMIX_MAJOR_VERSION 1
Cheers,
Julien
Re: [PATCH] DRI2/GLX: fix swap event handling
Quoted 12 lines · On Fri, 29 Apr 2011 09:20:31 +0200 Julien Cristau <[email protected]> wrote:
Quoted 10 lines · Jesse Barnes
glx/glxdri2.c +0
-2@@ -192,8 +192,17 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, wire.ust_lo = ust &0xffffffff ; wire.msc_hi = msc >>32 ; wire.msc_lo = msc &0xffffffff ; - wire.sbc_hi = sbc >>32 ; - wire.sbc_lo = sbc &0xffffffff ;
Quoted 8 lines
glx/glxdri2.c __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, · line 200
Quoted 6 lines
glx/glxdri2.c +6
-0+ wire.sbc_hi =0 ; + +if (DRI2ClientSupportsSBC (client)) { + wire.sbc_lo0 = sbc &0xff ; + wire.sbc_lo8 = (sbc >>8 ) &0xff ; + wire.sbc_lo16 = (sbc >>16 ) &0xff ;This one should be wire.sbc_lo16 = (sbc >> 16) &
0xffff;
Ah thanks, good catch. In this case, too much typing and not enough cult & paste. :)
Quoted 7 lines
Quoted 7 lines
glx/glxdri2.c +5
-0+ }else { + wire.sbc_lo0 =0 ; + wire.sbc_lo8 =0 ; + wire.sbc_lo16 =0 ; + }
Quoted 6 lines
glx/glxdri2.c __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, · line 208
Quoted 2 lines
glx/glxdri2.c +0
-0WriteEventsToClient (client,1 , (xEvent *) &wire); }Also I think big endian clients (when built against the old protocol header) will expect the low byte of
event_typewhere you now havesbc_lo8, so you would need to swap them. Same for the dri2 event.
Right. I should probably add swapping for the whole thing for swapped clients as well.
Quoted 8 lines
[...]
Quoted 6 lines
include/protocol-versions.h +0
-0@@ -57,7 +57,7 @@
Quoted 7 lines
include/protocol-versions.h line 61
Quoted 5 lines
include/protocol-versions.h +1
-1/* GLX */ #define SERVER_GLX_MAJOR_VERSION 1 -#define SERVER_GLX_MINOR_VERSION 4 +#define SERVER_GLX_MINOR_VERSION 5Do we get to bump the GLX protocol version? Somehow I thought that was khronos business.
Maybe it is, but unless we're going to ignore this problem for indirect glx clients, we need a way of knowing which type of event structure to expect. Is there another version I could use instead?
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center