diff mbox

glxproto: make GLX swap event struct match spec

Message ID 20110503140858.65d5f945@jbarnes-desktop (mailing list archive)
State New, archived
Headers show

Commit Message

Jesse Barnes May 3, 2011, 9:08 p.m. UTC
On Tue, 3 May 2011 14:02:31 -0700
Jesse Barnes <jbarnes@virtuousgeek.org> wrote:

> On Tue, 03 May 2011 13:54:38 -0700
> Keith Packard <keithp@keithp.com> wrote:
> 
> > On Tue,  3 May 2011 12:21:24 -0700, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> > 
> > > 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.

Fixed version below.

Comments

Keith Packard May 3, 2011, 9:15 p.m. UTC | #1
On Tue, 3 May 2011 14:08:58 -0700, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:

> Fixed version below.

Reviewed-by: Keith Packard <keithp@keithp.com>

(assuming that the GLX protocol specification gets updated to match :-)
Jesse Barnes May 3, 2011, 9:20 p.m. UTC | #2
On Tue, 03 May 2011 14:15:30 -0700
Keith Packard <keithp@keithp.com> wrote:

> On Tue, 3 May 2011 14:08:58 -0700, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> 
> > Fixed version below.
> 
> Reviewed-by: Keith Packard <keithp@keithp.com>
> 
> (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,
Ian Romanick May 4, 2011, 10:11 p.m. UTC | #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/03/2011 02:08 PM, Jesse Barnes wrote:
> On Tue, 3 May 2011 14:02:31 -0700
> Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> 
>> On Tue, 03 May 2011 13:54:38 -0700
>> Keith Packard <keithp@keithp.com> wrote:
>>
>>> On Tue,  3 May 2011 12:21:24 -0700, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
>>>
>>>> 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.
> 
> 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-----
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index d88e6df..a3047e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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
 
diff --git a/glxproto.h b/glxproto.h
index 0ff44e3..dfa0647 100644
--- a/glxproto.h
+++ b/glxproto.h
@@ -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;
 
 /************************************************************************/