[PATCH] DRI2/GLX: fix swap event handling

Jesse Barnes jbarnes at virtuousgeek.org
Fri Apr 29 08:21:32 PDT 2011


On Fri, 29 Apr 2011 09:23:27 +0200
Michel Dänzer <michel at daenzer.net> wrote:

> On Fre, 2011-04-29 at 08:52 +0200, Michel Dänzer wrote: 
> > On Don, 2011-04-28 at 13:27 -0700, Jesse Barnes wrote: 
> > > @@ -1114,7 +1169,7 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
> > >  	ds->ScheduleSwap = info->ScheduleSwap;
> > >  	ds->ScheduleWaitMSC = info->ScheduleWaitMSC;
> > >  	ds->GetMSC = info->GetMSC;
> > > -	cur_minor = 3;
> > > +	cur_minor = 4;
> > >      } else {
> > >  	cur_minor = 1;
> > >      }
> > 
> > This bugfix should probably be separate.
> 
> Never mind, I thought cur_minor was used for something else than what it
> is.
> 
> 
> On a not directly related note, the following code:
> 
>     /* Initialize minor if needed and set to minimum provied by DDX */
>     if (!dri2_minor || dri2_minor > cur_minor)
>         dri2_minor = cur_minor;
> 
> seems to rely on dri2_minor being initialized to 0, but it's not static,
> and I don't see any initialization for it elsewhere. So dri2_minor could
> end up being lower than intended if it's not 0 initially. Am I missing
> something?

Both globals and statics w/o specific assignments at init will be set
to 0.  At least, that's the behavior we're relying on here!  Adding an
explicit = 0 at the top of dri2.c wouldn't hurt, aside from generating
a little extra code.

-- 
Jesse Barnes, Intel Open Source Technology Center


More information about the xorg-devel mailing list