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. A failure will cause driver_init_driver() to return DFB_IO. So unless I miss something, we only need to make sure that dfb_gfxcard_map_mmio() is the first thing that the gfx drivers try to do. The nvidia driver needs the attached minor change then. Sven
>From 4cb00b02ae4e5334a7b0c26550bfd7c3508bce7c Mon Sep 17 00:00:00 2001 From: Sven Neumann <s.neum...@raumfeld.com> Date: Mon, 3 Aug 2009 13:13:38 +0200 Subject: [PATCH] [nvidia] try to map the MMIO area before anything else --- gfxdrivers/nvidia/nvidia.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gfxdrivers/nvidia/nvidia.c b/gfxdrivers/nvidia/nvidia.c index 6ecb17f..f125538 100644 --- a/gfxdrivers/nvidia/nvidia.c +++ b/gfxdrivers/nvidia/nvidia.c @@ -1539,17 +1539,17 @@ driver_init_driver( CoreGraphicsDevice *device, NVidiaDriverData *nvdrv = (NVidiaDriverData*) driver_data; NVidiaDeviceData *nvdev = (NVidiaDeviceData*) device_data; u32 arch = 0; - + nvdrv->device = device; nvdrv->device_data = device_data; - - nvdrv->fb_base = (volatile void*) dfb_gfxcard_memory_virtual( device, 0 ); - nvdrv->agp_base = (volatile void*) dfb_gfxcard_auxmemory_virtual( device, 0 ); nvdrv->mmio_base = (volatile void*) dfb_gfxcard_map_mmio( device, 0, -1 ); if (!nvdrv->mmio_base) return DFB_IO; - + + nvdrv->fb_base = (volatile void*) dfb_gfxcard_memory_virtual( device, 0 ); + nvdrv->agp_base = (volatile void*) dfb_gfxcard_auxmemory_virtual( device, 0 ); + if (nvdev->use_dma) { nvdrv->dma_base = nvdev->use_agp ? nvdrv->agp_base : nvdrv->fb_base; nvdrv->dma_base += nvdev->dma_offset; -- 1.6.0.4
_______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev