[PATCH] Bail if we're trying to start up in UMS mode on KMS.

Michel Dänzer michel at daenzer.net
Wed Aug 17 09:05:46 PDT 2011


On Mit, 2011-08-17 at 11:05 -0400, Alex Deucher wrote: 
> 2011/8/17 Michel Dänzer <michel at daenzer.net>:
> > From: Michel Dänzer <michel.daenzer at amd.com>
> >
> > Ideally, the display manager will start the X server again, and everything
> > will be fine and dandy. But in the worst case, at least we won't hit the
> > hardware behind the KMS driver's back.
> >
> > Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
> 
> One comment below.  Other than that:
> 
> Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

Thanks.


> > diff --git a/src/radeon_driver.c b/src/radeon_driver.c
> > index 202951f..1a5b334 100644
> > --- a/src/radeon_driver.c
> > +++ b/src/radeon_driver.c
> > @@ -2333,7 +2333,7 @@ static Bool RADEONPreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10)
> >  }
> >
> >  #ifdef XF86DRI
> > -static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
> > +static int RADEONPreInitDRI(ScrnInfoPtr pScrn)
> >  {
> >     RADEONInfoPtr  info = RADEONPTR(pScrn);
> >     MessageType    from;
> > @@ -2402,7 +2402,9 @@ static Bool RADEONPreInitDRI(ScrnInfoPtr pScrn)
> >     info->dri->pLibDRMVersion = NULL;
> >     info->dri->pKernelDRMVersion = NULL;
> >
> > -    if (!RADEONDRIGetVersion(pScrn))
> > +    if (RADEONDRIGetVersion(pScrn) < 0)
> > +       return -1;
> > +    else if (!RADEONDRIGetVersion(pScrn))
> >        return FALSE;
> 
> for consistency, might be worth changing FALSE/TRUE to 0/1 since you
> changed the return type.

I wanted to avoid that, as this is just a hackish band-aid for a rare
failure.

As Bool is pretty much guaranteed to be defined as int and TRUE/FALSE as
1/0 in this environment, maybe I should just leave the return type as
Bool? (Note that I left info->directRenderingEnabled as Bool as well)


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


More information about the xorg-driver-ati mailing list