Re: [PATCH] Pack swap complete bits into an XEvent

2011-04-28 Thread Eric Anholt
On Thu, 28 Apr 2011 13:27:19 -0700, Jesse Barnes jbar...@virtuousgeek.org 
wrote:
 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(-)
 
 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..4a583c1 100644
 --- a/glxproto.h
 +++ b/glxproto.h
 @@ -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.

  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;


pgpvVEqhx05gf.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: 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

2011-04-28 Thread Jesse Barnes
On Thu, 28 Apr 2011 14:33:58 -0700
Eric Anholt e...@anholt.net wrote:

 On Thu, 28 Apr 2011 13:27:19 -0700, Jesse Barnes jbar...@virtuousgeek.org 
 wrote:
  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(-)
  
  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..4a583c1 100644
  --- a/glxproto.h
  +++ b/glxproto.h
  @@ -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.

double fail. will fix.

-- 
Jesse Barnes, Intel Open Source Technology Center
___
xorg-devel@lists.x.org: 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

2011-04-28 Thread Keith Packard
On Thu, 28 Apr 2011 13:27:19 -0700, Jesse Barnes jbar...@virtuousgeek.org 
wrote:
 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.

-- 
keith.pack...@intel.com


pgppIX96qdwHY.pgp
Description: PGP signature
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel