dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Julien Cristau <jcristau@debian.org>
Cc: xorg-devel@lists.x.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] DRI2/GLX: fix swap event handling
Date: Fri, 29 Apr 2011 08:24:19 -0700	[thread overview]
Message-ID: <20110429082419.16f6775b@jbarnes-desktop> (raw)
In-Reply-To: <20110429072031.GS2809@radis.liafa.jussieu.fr>

On Fri, 29 Apr 2011 09:20:31 +0200
Julien Cristau <jcristau@debian.org> wrote:

> 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;

Ah thanks, good catch. In this case, too much typing and not enough
cult & paste. :)

> 
> > +    } 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.

Right.  I should probably add swapping for the whole thing for swapped
clients as well.

> 
> [...]
> > 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.

Maybe it is, but unless we're going to ignore this problem for indirect
glx clients, we need a way of knowing which type of event structure to
expect.  Is there another version I could use instead?

-- 
Jesse Barnes, Intel Open Source Technology Center

  reply	other threads:[~2011-04-29 15:24 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-28 20:27 [RFC] swap event handling fixes Jesse Barnes
2011-04-28 20:27 ` [PATCH] Pack swap complete bits into an XEvent Jesse Barnes
2011-04-28 21:33   ` Eric Anholt
     [not found]     ` <87y62uhxh5.fsf-NuZ+OHacjZctnJUoGz2Qal6hYfS7NtTn@public.gmane.org>
2011-04-28 21:34       ` Jesse Barnes
2011-04-28 22:01   ` Keith Packard
2011-04-28 20:27 ` [PATCH] GLX/DRI2: fix swap complete handling Jesse Barnes
2011-04-28 20:27 ` [PATCH] DRI2/GLX: fix swap event handling Jesse Barnes
     [not found]   ` <1304022442-8070-5-git-send-email-jbarnes-Y1mF5jBUw70BENJcbMCuUQ@public.gmane.org>
2011-04-28 21:37     ` Eric Anholt
2011-04-29  6:52   ` Michel Dänzer
2011-04-29  7:20   ` Julien Cristau
2011-04-29 15:24     ` Jesse Barnes [this message]
     [not found] ` <1304022442-8070-1-git-send-email-jbarnes-Y1mF5jBUw70BENJcbMCuUQ@public.gmane.org>
2011-04-28 20:27   ` [PATCH] Fix swap complete event size Jesse Barnes
2011-04-29 21:37   ` [RFC] swap event handling fixes Jesse Barnes
2011-04-29 23:10     ` Mario Kleiner
2011-05-02 20:09       ` Jesse Barnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110429082419.16f6775b@jbarnes-desktop \
    --to=jbarnes@virtuousgeek.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jcristau@debian.org \
    --cc=xorg-devel@lists.x.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox