Skip to contentSkip to conversation

Make swap event handling match the spec

PATCH In review Jesse Barnes 6 participants 22 messages May 3, 2011 – May 5, 2011 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Ian reminded me that we changed the spec to fit within an XEvent, but we never updated the code to match. This set of patches (much simpler than the last) does just that. Wrapping support can be added to Mesa if we really want 64 bit values, but that means checking the drawable sbc and adding whenver sbc hits 0.

Thanks,
Jesse

A message that is not in the archive (sent off-list or not yet received): 1304450489-31415-1-git-send-email-jbarnes-Y1mF5jBUw70BENJcbMCuUQ@public.gmane.org

#2 lore raw

PATCH 1/1 glxproto: make GLX swap event struct match spec

We only spec a 32 bit swap count, so drop the high sbc field.

---
 configure.ac |    2 +-
 glxproto.h   |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
configure.ac +1 -1
index d88e6df..a3047e4 100644
@@ -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 +1 -2
index 0ff44e3..a6018a1 100644
@@ -1380,8 +1380,7 @@ typedef struct {
     CARD32 ust_lo B32;
     CARD32 msc_hi B32;
     CARD32 msc_lo B32;
-    CARD32 sbc_hi B32;
-    CARD32 sbc_lo B32;
+    CARD32 sbc B32;
 } xGLXBufferSwapComplete;
 
 /************************************************************************/
Signature · 6 lines
1.7.4.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
#3 lore raw

Re: [PATCH] glxproto: make GLX swap event struct match spec

Quoted 1 line · Jesse Barnes

We only spec a 32 bit swap count, so drop the high sbc field.

You're missing the explicit 16-bit padding field after 'event_type'

The documented encoding
http://www.opengl.org/registry/specs/INTEL/swap_event.txt needs to be fixed to match this, it has the padding at the end which leaves most of the structure mis-aligned.

Signature · 1 line
[email protected]

_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

#4 lore raw

Re: [PATCH] glxproto: make GLX swap event struct match spec

Quoted 10 lines · On Tue, 03 May 2011 13:54:38 -0700 Keith Packard <[email protected]> wrote:
Quoted 1 line · Jesse Barnes

We only spec a 32 bit swap count, so drop the high sbc field.

You're missing the explicit 16-bit padding field after 'event_type'

The documented encoding
http://www.opengl.org/registry/specs/INTEL/swap_event.txt needs to be fixed to match this, it has the padding at the end which leaves most of the structure mis-aligned.

Right, another case where we updated the spec incorrectly then failed to make the code match the broken definition (the complete enums also need to match the final values, which are correct in the first part of the spec). Yay for divergence.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#5 lore raw

Re: [PATCH] glxproto: make GLX swap event struct match spec

Quoted 14 lines · On Tue, 3 May 2011 14:02:31 -0700 Jesse Barnes…
Quoted 10 lines · On Tue, 03 May 2011 13:54:38 -0700 Keith Packard…
Quoted 1 line · Jesse Barnes

We only spec a 32 bit swap count, so drop the high sbc field.

You're missing the explicit 16-bit padding field after 'event_type'

The documented encoding
http://www.opengl.org/registry/specs/INTEL/swap_event.txt needs to be fixed to match this, it has the padding at the end which leaves most of the structure mis-aligned.

Quoted 4 lines

Right, another case where we updated the spec incorrectly then failed to make the code match the broken definition (the complete enums also need to match the final values, which are correct in the first part of the spec). Yay for divergence.

Fixed version below.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Quoted 1 line

From f5403828c68af0f12c79c0504df0a4781ca84b2b Mon Sep 17 00:00:00 2001

From: Jesse Barnes <[email protected]>
Date: Tue, 3 May 2011 12:14:10 -0700
Subject: [PATCH] glxproto: make GLX swap event struct match spec

We only spec a 32 bit swap count, so drop the high sbc field. Also make the padding explicit (most compilers would have already done this since it's not a packed structure, but making it explicit should prevent surprises in the future).

---
 configure.ac |    2 +-
 glxproto.h   |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
configure.ac +1 -1
index d88e6df..a3047e4 100644
@@ -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 +2 -2
index 0ff44e3..dfa0647 100644
@@ -1375,13 +1375,13 @@ typedef struct {
     BYTE pad;
     CARD16 sequenceNumber B16;
     CARD16 event_type B16;
+    CARD16 pad2;
     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;
+    CARD32 sbc B32;
 } xGLXBufferSwapComplete;
 
 /************************************************************************/
Signature · 7 lines
1.7.4.1


_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
#7 lore raw

Re: [PATCH] glxproto: make GLX swap event struct match spec

Quoted 7 lines · On Tue, 03 May 2011 14:15:30 -0700 Keith Packard <[email protected]> wrote:
Quoted 1 line · Jesse Barnes

Fixed version below.

(assuming that the GLX protocol specification gets updated to match :-)

Yeah, Ian is fixing up the padding there to match what our existing gcc compiled implementations actually do (along with fixing the enums in the second half to match the first :)

I'll push this out.

Thanks,

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#8 lore raw

Re: [PATCH] glxproto: make GLX swap event struct match spec

In reply to Jesse Barnes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 17 lines · Jesse Barnes
Quoted 14 lines · On Tue, 3 May 2011 14:02:31 -0700 Jesse Barnes…
Quoted 10 lines · On Tue, 03 May 2011 13:54:38 -0700 Keith Packard…
Quoted 1 line · Jesse Barnes

We only spec a 32 bit swap count, so drop the high sbc field.

You're missing the explicit 16-bit padding field after 'event_type'

The documented encoding
http://www.opengl.org/registry/specs/INTEL/swap_event.txt needs to be fixed to match this, it has the padding at the end which leaves most of the structure mis-aligned.

Quoted 7 lines
Quoted 4 lines

Right, another case where we updated the spec incorrectly then failed to make the code match the broken definition (the complete enums also need to match the final values, which are correct in the first part of the spec). Yay for divergence.

Fixed version below.

Does this need the "B16" cruft?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk3BzwQACgkQX1gOwKyEAw/SowCfaAm1gxkowryhD2ku9oPMlaUY YyoAniZgXMFszpUBwnJH17JDyZwtsOw+
=k7tr
-----END PGP SIGNATURE-----
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

#9 lore raw

Re: [Mesa-dev] [PATCH] glxproto: make GLX swap event struct match spec

In reply to Jesse Barnes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Jesse Barnes

We only spec a 32 bit swap count, so drop the high sbc field.

Is there any way we could do this and NOT break building older versions of Mesa? I'd like to be able to build 7.9, 7.10, and master on my system without having two different versions of glproto.

Quoted 21 lines
---
 configure.ac |    2 +-
 glxproto.h   |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
configure.ac +1 -1
index d88e6df..a3047e4 100644
@@ -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 +0 -0
index 0ff44e3..a6018a1 100644

glxproto.h typedef struct { · line 1386

Quoted 9 lines
glxproto.h +1 -2
@@ -1380,8 +1380,7 @@ typedef struct {
     CARD32 ust_lo B32;
     CARD32 msc_hi B32;
     CARD32 msc_lo B32;
-    CARD32 sbc_hi B32;
-    CARD32 sbc_lo B32;
+    CARD32 sbc B32;
 } xGLXBufferSwapComplete;
 
 /************************************************************************/

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

iEYEARECAAYFAk3B0HsACgkQX1gOwKyEAw+27gCeLgSzv2Yjq7NQF+3QjeoXS8J0 qoQAn3n+Q8ujE3JFwpAyCM9TYtZ13wy0
=OkZ2
-----END PGP SIGNATURE-----

#10 lore raw

Re: [PATCH] glxproto: make GLX swap event struct match spec

Quoted 12 lines · On Wed, 04 May 2011 15:17:31 -0700 Ian Romanick <[email protected]> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Jesse Barnes

We only spec a 32 bit swap count, so drop the high sbc field.

Is there any way we could do this and NOT break building older versions of Mesa? I'd like to be able to build 7.9, 7.10, and master on my system without having two different versions of glproto.

We did that the last time glproto bumped (kept the req at 1.4.10 and added ifdefs), but that added bugs that we didn't find for awhile, so I wanted to try to avoid it this time. Another option for you would be to build 7.9, 7.10, and master against different install roots with PKG_CONFIG_PATH set appropriately...

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#11 lore raw

Re: [PATCH] glxproto: make GLX swap event struct match spec

Quoted 16 lines · On Wed, 4 May 2011 16:16:37 -0700 Jesse Barnes <[email protected]> wrote:
Quoted 12 lines · On Wed, 04 May 2011 15:17:31 -0700 Ian Romanick <[email protected]> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Jesse Barnes

We only spec a 32 bit swap count, so drop the high sbc field.

Is there any way we could do this and NOT break building older versions of Mesa? I'd like to be able to build 7.9, 7.10, and master on my system without having two different versions of glproto.

Quoted 5 lines

We did that the last time glproto bumped (kept the req at 1.4.10 and added ifdefs), but that added bugs that we didn't find for awhile, so I wanted to try to avoid it this time. Another option for you would be to build 7.9, 7.10, and master against different install roots with PKG_CONFIG_PATH set appropriately...

Or just backport the fix to 7.x :) The server is only sending 32 bytes regardless, so having the fix in older client library versions will give either the right sbc number (if the server is new) or 0 if the server is old (unless you've wrapped the sbc_lo field and sbc_hi is set). So an improvement either way.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#12 lore raw

Re: [Mesa-dev] [PATCH] glxproto: make GLX swap event struct match spec

In reply to Jesse Barnes
Quoted 16 lines · Jesse Barnes
Quoted 12 lines · On Wed, 04 May 2011 15:17:31 -0700 Ian Romanick <[email protected]> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Jesse Barnes

We only spec a 32 bit swap count, so drop the high sbc field.

Is there any way we could do this and NOT break building older versions of Mesa? I'd like to be able to build 7.9, 7.10, and master on my system without having two different versions of glproto.

Quoted 6 lines

We did that the last time glproto bumped (kept the req at 1.4.10 and added ifdefs), but that added bugs that we didn't find for awhile, so I wanted to try to avoid it this time. Another option for you would be to build 7.9, 7.10, and master against different install roots with PKG_CONFIG_PATH set appropriately...

How about you try again, with an increased emphasis on not adding bugs, now that you know what you did wrong the first time?

Dave.

#13 lore raw

Re: [Mesa-dev] [PATCH] glxproto: make GLX swap event struct match spec

Quoted 24 lines · On Thu, 05 May 2011 09:32:46 +1000 Dave Airlie <[email protected]> wrote:
Quoted 16 lines · Jesse Barnes
Quoted 12 lines · On Wed, 04 May 2011 15:17:31 -0700 Ian Romanick <[email protected]> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Jesse Barnes

We only spec a 32 bit swap count, so drop the high sbc field.

Is there any way we could do this and NOT break building older versions of Mesa? I'd like to be able to build 7.9, 7.10, and master on my system without having two different versions of glproto.

Quoted 6 lines

We did that the last time glproto bumped (kept the req at 1.4.10 and added ifdefs), but that added bugs that we didn't find for awhile, so I wanted to try to avoid it this time. Another option for you would be to build 7.9, 7.10, and master against different install roots with PKG_CONFIG_PATH set appropriately...

Quoted 2 lines

How about you try again, with an increased emphasis on not adding bugs, now that you know what you did wrong the first time?

How about you look at git and see what happened last time?

We added some dri2 proto requests, and people wanted to build with old versions w/o the new requests. So they added some ifdefs but didn't check all the combos (now not just old server/new server, but multiplied by two) and things were broken for awhile, and it was easy to get breakage without even noticing (I found several bugs for people related to invalidation that were solely due to bad builds).

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
#14 lore raw

Re: [Mesa-dev] [PATCH] glxproto: make GLX swap event struct match spec

Quoted 8 lines · On Wed, 4 May 2011 17:49:37 -0700 Jesse Barnes…

How about you look at git and see what happened last time?

We added some dri2 proto requests, and people wanted to build with old versions w/o the new requests. So they added some ifdefs but didn't check all the combos (now not just old server/new server, but multiplied by two) and things were broken for awhile, and it was easy to get breakage without even noticing (I found several bugs for people related to invalidation that were solely due to bad builds).

(For those who don't want to look through git and the history: the problem is that making the builds use old and new means you can build client and server with different proto versions and not even notice. That makes debugging all the harder because everything seems to be ok but you're now taking untested paths on the client and/or server side due to #ifdefs and protocol mismatches.)

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
#15 lore raw

PATCH 3/4 GLX/DRI2: pass drawable correctly for indirect swap events

In reply to a message not in the archive

Pass the right drawable pointer as data to the swap complete function.

---
 glx/glxdri2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
glx/glxdri2.c +1 -1
index d979717..93c5e5b 100644
@@ -222,7 +222,7 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable)
 #endif
 
     if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
-			__glXdriSwapEvent, drawable->pDraw) != Success)
+			__glXdriSwapEvent, drawable) != Success)
 	return FALSE;
 
     return TRUE;
Signature · 6 lines
1.7.4.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
#16 lore raw

PATCH 5/6 GLX: don't crash when indirect clients try to set an event mask

In reply to a message not in the archive

After sending the GLXChangeDrawableAttributes request, we also set a local set of attributes on the DRI drawable. But in the indirect case this array won't be present, so skip the setting in that case to avoid a crash.

---
 src/glx/glx_pbuffer.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
src/glx/glx_pbuffer.c +3 -0
index 5f91bc6..ec54f1e 100644
@@ -137,6 +137,9 @@ ChangeDrawableAttribute(Display * dpy, GLXDrawable drawable,
 #ifdef GLX_DIRECT_RENDERING
    pdraw = GetGLXDRIDrawable(dpy, drawable);
 
+   if (!pdraw)
+      return;
+
    for (i = 0; i < num_attribs; i++) {
       switch(attribs[i * 2]) {
       case GLX_EVENT_MASK:
Signature · 6 lines
1.7.4.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
#17 lore raw
In reply to a message not in the archive
Quoted 5 lines · On Tue, 3 May 2011 12:21:23 -0700 Jesse Barnes…

Ian reminded me that we changed the spec to fit within an XEvent, but we never updated the code to match. This set of patches (much simpler than the last) does just that. Wrapping support can be added to Mesa if we really want 64 bit values, but that means checking the drawable sbc and adding whenver sbc hits 0.

Apparently I've confused git send-email... 3/4 and 4/4 are for the server and 5/6 and 6/6 are for Mesa.

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
#18 lore raw

PATCH 4/4 GLX/DRI2: make GLX swap event handling match spec

In reply to Jesse Barnes

Only send a 32 bit swap count out to the client.

---
 configure.ac              |    4 ++--
 glx/glxdri2.c             |    5 ++---
 hw/xfree86/dri2/dri2.c    |    2 +-
 hw/xfree86/dri2/dri2.h    |    2 +-
 hw/xfree86/dri2/dri2ext.c |    5 ++---
 5 files changed, 8 insertions(+), 10 deletions(-)
configure.ac +2 -2
index 6eb780c..87194a5 100644
@@ -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 +2 -3
index 93c5e5b..450d8c9 100644
@@ -163,7 +163,7 @@ __glXDRIdrawableWaitGL(__GLXdrawable *drawable)
 
 static void
 __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
-		  CARD64 msc, CARD64 sbc)
+		  CARD64 msc, CARD32 sbc)
 {
     __GLXdrawable *drawable = data;
     xGLXBufferSwapComplete wire;
@@ -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);
 }
hw/xfree86/dri2/dri2.c +1 -1
index 5c42a51..40829c2 100644
@@ -76,7 +76,7 @@ typedef struct _DRI2Drawable {
     ClientPtr		 blockedClient;
     Bool		 blockedOnMsc;
     int			 swap_interval;
-    CARD64		 swap_count;
+    CARD32		 swap_count;
     int64_t		 target_sbc; /* -1 means no SBC wait outstanding */
     CARD64		 last_swap_target; /* most recently queued swap target */
     CARD64		 last_swap_msc; /* msc at completion of most recent swap */
hw/xfree86/dri2/dri2.h +1 -1
index fe0bf6c..2a41ead 100644
@@ -51,7 +51,7 @@ extern CARD8 dri2_minor;
 
 typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr;
 typedef void (*DRI2SwapEventPtr)(ClientPtr client, void *data, int type,
-				 CARD64 ust, CARD64 msc, CARD64 sbc);
+				 CARD64 ust, CARD64 msc, CARD32 sbc);
 
 
 typedef DRI2BufferPtr	(*DRI2CreateBuffersProcPtr)(DrawablePtr pDraw,
hw/xfree86/dri2/dri2ext.c +2 -3
index 4e48e65..2bb515f 100644
@@ -357,7 +357,7 @@ vals_to_card64(CARD32 lo, CARD32 hi)
 
 static void
 DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
-	      CARD64 sbc)
+	      CARD32 sbc)
 {
     xDRI2BufferSwapComplete event;
     DrawablePtr pDrawable = data;
@@ -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);
 }
Signature · 1 line
1.7.4.1
#19 lore raw

PATCH 6/6 DRI2/GLX: make swap event handling match spec

In reply to Jesse Barnes

We only handle a 32 bit swap count, so use the new structure definitions.

---
 configure.ac     |    4 ++--
 src/glx/dri2.c   |    2 +-
 src/glx/glxext.c |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
configure.ac +2 -2
index 3b05ca3..94fb6f7 100644
@@ -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 +1 -1
index adfd3d1..2f18ca0 100644
@@ -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
src/glx/glxext.c +1 -1
index 278c719..831d83f 100644
@@ -138,7 +138,7 @@ __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;
+      aevent->sbc = awire->sbc;
       return True;
    }
    default:
Signature · 1 line
1.7.4.1
#20 lore raw

PATCH 1/1 dri2proto: make DRI2 swap event match GLX spec

In reply to Jesse Barnes

We only spec a 32 bit sbc count, so drop the high bits.

---
 configure.ac |    2 +-
 dri2proto.h  |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
configure.ac +1 -1
index 5b78d6b..9505f56 100644
@@ -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 +1 -2
index 9708a4a..12d834f 100644
@@ -295,8 +295,7 @@ typedef struct {
     CARD32 ust_lo B32;
     CARD32 msc_hi B32;
     CARD32 msc_lo B32;
-    CARD32 sbc_hi B32;
-    CARD32 sbc_lo B32;
+    CARD32 sbc B32;
 } xDRI2BufferSwapComplete;
 #define sz_xDRI2BufferSwapComplete 32
 
Signature · 1 line
1.7.4.1
#21 lore raw

Re: [PATCH] dri2proto: make DRI2 swap event match GLX spec

Updated with explicit padding.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Quoted 1 line

From 0ca3778de195a82087d0f07415a1cf8fc94f5b0a Mon Sep 17 00:00:00 2001

From: Jesse Barnes <[email protected]>
Date: Tue, 3 May 2011 12:14:58 -0700
Subject: [PATCH] dri2proto: make DRI2 swap event match GLX spec

We only spec a 32 bit sbc count, so drop the high bits. Also make the padding explicit.

---
 configure.ac |    2 +-
 dri2proto.h  |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
configure.ac +1 -1
index 5b78d6b..9505f56 100644
@@ -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 +2 -2
index 9708a4a..ff76355 100644
@@ -290,13 +290,13 @@ typedef struct {
     CARD8 pad;
     CARD16 sequenceNumber B16;
     CARD16 event_type B16;
+    CARD16 pad2;
     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;
+    CARD32 sbc B32;
 } xDRI2BufferSwapComplete;
 #define sz_xDRI2BufferSwapComplete 32
 
Signature · 1 line
1.7.4.1
Reviewed-by
#22 lore raw
In reply to Jesse Barnes

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Jesse Barnes

Ian reminded me that we changed the spec to fit within an XEvent, but we never updated the code to match. This set of patches (much simpler than the last) does just that. Wrapping support can be added to Mesa if we really want 64 bit values, but that means checking the drawable sbc and adding whenver sbc hits 0.

3/4, 4/4, 5/6, and 6/6:

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

iEYEARECAAYFAk3B0pAACgkQX1gOwKyEAw8JmwCeKgOPMC733wwz5zCP1OuSYX7f h+wAn05XZhh6akmfUyuaJ2THREQEaDsw
=FzuP
-----END PGP SIGNATURE-----