[PATCH] Fail more gracefully when drm surface manager can't be initialized

Michel Dänzer michel at daenzer.net
Thu May 10 09:06:18 PDT 2012


On Don, 2012-05-10 at 17:22 +0200, Anisse Astier wrote: 
> On Thu, 10 May 2012 17:08:55 +0200, Michel Dänzer <michel at daenzer.net> wrote :
> 
> > On Don, 2012-05-10 at 16:56 +0200, Anisse Astier wrote: 
> > 
> > > diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> > > index edc8fe3..d2089d1 100644
> > > --- a/src/radeon_kms.c
> > > +++ b/src/radeon_kms.c
> > > @@ -947,6 +947,11 @@ Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen,
> > >      front_ptr = info->FB;
> > >  
> > >      info->surf_man = radeon_surface_manager_new(info->dri->drmFD);
> > > +    if(!info->surf_man) {
> > > +        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
> > > +		   "failed to initialise surface manager");
> > > +        return FALSE;
> > > +    }
> > >      if (!info->bufmgr)
> > >          info->bufmgr = radeon_bo_manager_gem_ctor(info->dri->drmFD);
> > >      if (!info->bufmgr) {
> > 
> > This would probably break pre-R600 cards, which aren't supported by the
> > surface manager.
> Indeed, I didn't know about that.
> 
> How about the version below ?

Looks good. Pushed (with a newline appended to the error message),
thanks!


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