On Mon, Aug 03, 2009 at 01:23:09PM +0200, Sven Neumann wrote:
> Hi,
> 
> On Mon, 2009-08-03 at 11:39 +0200, Denis Oliver Kropp wrote:
> > Sven Neumann wrote:
> > > Hi,
> > > 
> > > On Mon, 2009-07-27 at 12:50 +0200, Denis Oliver Kropp wrote:
> > > 
> > >>>> commit fbf15dbbba6398850b54112ace094d019351a44a
> > >>>> Author: Claudio Ciccani <k...@directfb.org>
> > >>>> Date:   Fri Aug 12 11:00:56 2005 +0000
> > >>>>
> > >>>>     system_get_accelerator() returns -1 if mmio memory lenght is 0.
> > >>> I've checked the changes Claudio was working on at the time he did that
> > >>> change. Looks like he was working on the nvidia and the r200 drivers.
> > >>> But I still can't figure out what this change is good for.
> > >>>
> > >>> What are our options now? I'd like to get rid of this questionable
> > >>> check. But of course I could also introduce yet another hack in
> > >>> system_get_accelerator() and special case the PXA3XX hardware. Any
> > >>> opinions?
> > >> I think he did that to avoid usage of the accelerated driver when the
> > >> MMIO region is not exported.
> > >>
> > >> The check for the mmio length should move into the driver.
> > > 
> > > Which drivers should have this check added?
> > 
> > I think ATI and/or nVidia, but basically all with MMIO.
> 
> As far as I can see no extra code should be needed. The drivers that I
> checked call dfb_gfxcard_map_mmio() from driver_init_driver(). They pass
> -1 as length argument. In system_map_mmio() in fbdev.c this value is
> then replaced by dfb_fbdev->shared->fix.mmio_len. In case this is zero,
> mmap() will be called with a size of zero and according to the manual
> page, this is supposed to fail. 

My manual page says linux < 2.6.12 will return addr if length == 0. But
since system_map_mmio() will return NULL on failure too it shouldn't
matter assuming that mmio_start is page aligned, but I guess it should
generally be 0 if mmio_len is 0.

> A failure will cause
> driver_init_driver() to return DFB_IO.

I think failure at that point will terminate the core init. So the user
would be forced to use disable-module to get DFB up and running.

-- 
Ville Syrjälä
syrj...@sci.fi
http://www.sci.fi/~syrjala/
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to