From: Julien Cristau Subject: Re: [PATCH] DRI2/GLX: fix swap event handling Date: Fri, 29 Apr 2011 09:20:31 +0200 Message-ID: <20110429072031.GS2809@radis.liafa.jussieu.fr> References: <1304022442-8070-1-git-send-email-jbarnes@virtuousgeek.org> <1304022442-8070-5-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from coloquinte.cristau.org (coloquinte.cristau.org [91.121.16.100]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B0979E84B for ; Fri, 29 Apr 2011 00:20:34 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1304022442-8070-5-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Jesse Barnes Cc: xorg-devel@lists.x.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Thu, Apr 28, 2011 at 13:27:22 -0700, Jesse Barnes wrote: > diff --git a/glx/glxdri2.c b/glx/glxdri2.c > index d979717..654b4ae 100644 > --- a/glx/glxdri2.c > +++ b/glx/glxdri2.c > @@ -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; This one should be wire.sbc_lo16 = (sbc >> 16) & 0xffff; > + } 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. [...] > diff --git a/include/protocol-versions.h b/include/protocol-versions.h > index 8692ded..8fde917 100644 > --- a/include/protocol-versions.h > +++ b/include/protocol-versions.h > @@ -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. > /* Xinerama */ > #define SERVER_PANORAMIX_MAJOR_VERSION 1 Cheers, Julien