[PATCH] DRI2/GLX: fix swap event handling

Michel Dänzer michel at daenzer.net
Mon May 2 04:23:24 PDT 2011


On Fre, 2011-04-29 at 08:21 -0700, Jesse Barnes wrote: 
> 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.

Right, I thought that was only the case for static variables, but I
probably mixed up something from previous discussions related to
this. :}


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the xorg-devel mailing list