On Wed, 4 May 2011 21:29:23 -0700
Jeremy Huddleston <jerem...@freedesktop.org> wrote:

> Yeah... so considering the comments in mesa-dev earlier today, I was really 
> surprised to see that glproto and dri2proto were tagged today.  I think we 
> need to brownbag retract and rethink this.

Damnit; right when Dave mentioned this last night I knew I had gone too
far in trying to make sure the fix was propagated.  I hate it when he's
right!

Yeah, having a rule that we can't touch existing proto structs makes
sense unless we want to do a major break.  It certainly makes pushing
out updates eaiser and preserves bisection...

> These changes break API.  I'm all for fixing the structs, but anything that 
> breaks API (or worse, protocol) certainly warrants much more than the +0.0.1 
> version bump.  This also makes it impossible to build the current dev and 
> current stable with the same protos installed.  I haven't looked at the 
> details specifically, but I suspect that it also changes what is on the wire, 
> meaning clients and the server may disagree depending on which glproto 
> version they were using.  Is that the case?  If not, can't we solve this with 
> some creative union{}ing?

In this case, what's on the wire is pretty much the same; if the client
and server don't match, you may get a different kind of corruption in
the affected field (0 vs some other value), but things are no worse.

> Either way, I think we should retract the glproto 1.4.13 release until we can 
> get this straightened out.

Ok; fwiw my rationale was twofold:
  1) make sure master requires the new proto headers to avoid some of
     the trouble we've had in the past with ifdefs and untested paths
     (though again, the failure mode is benign in this case)
  2) make the proto breakage obvious even for older code; the fix is
     trivial

But I guess (2) is a bit much... after pushing I started having
nightmares about the input proto changes from awhile back.

Here are what the backwards compatible changes look like...  Look
better?

Thanks,
-- 
Jesse "Breaker of Builds" Barnes
diff --git a/configure.ac b/configure.ac
index 9505f56..297be0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ([2.60])
-AC_INIT([DRI2Proto], [2.4], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AC_INIT([DRI2Proto], [2.5], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
diff --git a/dri2proto.h b/dri2proto.h
index ff76355..ab25565 100644
--- a/dri2proto.h
+++ b/dri2proto.h
@@ -290,6 +290,21 @@ typedef struct {
     CARD8 pad;
     CARD16 sequenceNumber B16;
     CARD16 event_type 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
+
+typedef struct {
+    CARD8 type;
+    CARD8 pad;
+    CARD16 sequenceNumber B16;
+    CARD16 event_type B16;
     CARD16 pad2;
     CARD32 drawable B32;
     CARD32 ust_hi B32;
@@ -297,7 +312,7 @@ typedef struct {
     CARD32 msc_hi B32;
     CARD32 msc_lo B32;
     CARD32 sbc B32;
-} xDRI2BufferSwapComplete;
+} xDRI2BufferSwapComplete2;
 #define sz_xDRI2BufferSwapComplete 32
 
 typedef struct {
diff --git a/configure.ac b/configure.ac
index a3047e4..a6c301c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
 AC_PREREQ([2.60])
-AC_INIT([GLProto], [1.4.13], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
+AC_INIT([GLProto], [1.4.14], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
 
diff --git a/glxproto.h b/glxproto.h
index dfa0647..3f9e837 100644
--- a/glxproto.h
+++ b/glxproto.h
@@ -1375,6 +1375,20 @@ typedef struct {
     BYTE pad;
     CARD16 sequenceNumber B16;
     CARD16 event_type B16;
+    CARD32 drawable;
+    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;
+
+typedef struct {
+    BYTE type;
+    BYTE pad;
+    CARD16 sequenceNumber B16;
+    CARD16 event_type B16;
     CARD16 pad2;
     CARD32 drawable;
     CARD32 ust_hi B32;
@@ -1382,7 +1396,8 @@ typedef struct {
     CARD32 msc_hi B32;
     CARD32 msc_lo B32;
     CARD32 sbc B32;
-} xGLXBufferSwapComplete;
+} xGLXBufferSwapComplete2;
+
 
 /************************************************************************/
 
diff --git a/configure.ac b/configure.ac
index 54d9c29..fb38a4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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.5
+GLPROTO_REQUIRED=1.4.14
 LIBDRM_XORG_REQUIRED=2.4.24
 LIBKMS_XORG_REQUIRED=1.0.0
 
diff --git a/src/glx/dri2.c b/src/glx/dri2.c
index adfd3d1..8654a37 100644
--- a/src/glx/dri2.c
+++ b/src/glx/dri2.c
@@ -97,7 +97,7 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
    case DRI2_BufferSwapComplete:
    {
       GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event;
-      xDRI2BufferSwapComplete *awire = (xDRI2BufferSwapComplete *)wire;
+      xDRI2BufferSwapComplete2 *awire = (xDRI2BufferSwapComplete2 *)wire;
 
       /* Ignore swap events if we're not looking for them */
       aevent->type = dri2GetSwapEventType(dpy, awire->drawable);
@@ -124,7 +124,7 @@ 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;
+      aevent->sbc = awire->sbc;
       return True;
    }
 #endif
diff --git a/src/glx/glxext.c b/src/glx/glxext.c
index 278c719..02652cb 100644
--- a/src/glx/glxext.c
+++ b/src/glx/glxext.c
@@ -133,12 +133,12 @@ __glXWireToEvent(Display *dpy, XEvent *event, xEvent *wire)
    case GLX_BufferSwapComplete:
    {
       GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event;
-      xGLXBufferSwapComplete *awire = (xGLXBufferSwapComplete *)wire;
+      xGLXBufferSwapComplete2 *awire = (xGLXBufferSwapComplete2 *)wire;
       aevent->event_type = awire->event_type;
       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;
+      aevent->sbc = awire->sbc;
       return True;
    }
    default:
diff --git a/configure.ac b/configure.ac
index 61caaed..d487e71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -774,11 +774,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.5"
 XINERAMAPROTO="xineramaproto"
 BIGFONTPROTO="xf86bigfontproto >= 1.2.0"
 DGAPROTO="xf86dgaproto >= 2.0.99.1"
-GLPROTO="glproto >= 1.4.10"
+GLPROTO="glproto >= 1.4.14"
 DMXPROTO="dmxproto >= 2.2.99.1"
 VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
 WINDOWSWMPROTO="windowswmproto"
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index d979717..279a42d 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -166,7 +166,7 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
 		  CARD64 msc, CARD64 sbc)
 {
     __GLXdrawable *drawable = data;
-    xGLXBufferSwapComplete wire;
+    xGLXBufferSwapComplete2 wire;
 
     if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
 	return;
@@ -192,8 +192,7 @@ __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 = sbc;
 
     WriteEventsToClient(client, 1, (xEvent *) &wire);
 }
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 4e48e65..f645161 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -359,7 +359,7 @@ static void
 DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
 	      CARD64 sbc)
 {
-    xDRI2BufferSwapComplete event;
+    xDRI2BufferSwapComplete2 event;
     DrawablePtr pDrawable = data;
 
     event.type = DRI2EventBase + DRI2_BufferSwapComplete;
@@ -369,8 +369,7 @@ DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
     event.ust_lo = ust & 0xffffffff;
     event.msc_hi = (CARD64)msc >> 32;
     event.msc_lo = msc & 0xffffffff;
-    event.sbc_hi = (CARD64)sbc >> 32;
-    event.sbc_lo = sbc & 0xffffffff;
+    event.sbc = sbc;
 
     WriteEventsToClient(client, 1, (xEvent *)&event);
 }
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to