EXA support for nv driver

Lars Knoll lars at trolltech.com
Wed Aug 24 23:21:12 PDT 2005


On Thursday 25 August 2005 01:08, Benjamin Herrenschmidt wrote:
> On Wed, 2005-08-24 at 10:18 +0200, Lars Knoll wrote:
> > Hi,
> >
> > I've hacked the nvidia driver lately to add EXA support to it, and at the
> > same time cleaned up some (but far from all) of the number magic in
> > nv_hw.c. I also added some documentation on how to initialize the HW to
> > be able to do DMA (at least as far as I understood it ;-)
> >
> > I implemented the uploadToScreen/downloadFromScreen hooks, but they
> > require access to the AGP file descriptor (so that the driver can
> > allocate mmap the GART). Currently the AGP code in Xorg doesn't export
> > this, so I had to add a small hook there as well.
>
> You certainly do _not_ want to mmap the AGP aperture via the AGP file
> descriptor. That will not work on a number of chipsets that can't expose
> the AGP aperture to the CPU. You need to use the DRM AGP mapping
> functions instead which can deal with that case.

Interesting. Why can the DRM mapping methods handle this and the agpgart 
module can't? The limitation sounds somewhat arbitrary to me. Shouldn't the 
code needed to handle this case be in the agpgart module then?

The problem is that you'd need a drm module for nv first. I had a short look 
at the DRM stuff, but as I couldn't find any decent documentation on how to 
write one, I didn't feel like diving into this up to now.

I have some ideas how to dispatch DMA command buffers that are resident in AGP 
memory as well, so one could propably write a semi decent DRM module for NV.

Cheers,
Lars

> > The upload/download hooks are working for me on a GeForce 6600, but I had
> > reports that they don't work on some other hardware. I hope to be able to
> > get my hands on some older hardware soon, so I can test myself.
> >
> > There is a preliminary implementation for the composite hook available,
> > but the implementation is wrong, because the blending operation seems to
> > expect non premultiplied pixmaps. I have an idea how to do it properly
> > and will probably work on that as my time permits.
> >
> > You can find the patches at:
> >
> > http://trolls.troll.no/lars/patches/nv.diff
> > http://trolls.troll.no/lars/patches/lnx_agp.diff
> >
> >
> > Related to this, I think we should change the signature of
> >     Bool        (*UploadToScreen) (PixmapPtr            pDst,
> >                                    char                 *src,
> >                                    int                  src_pitch);
> > in ExaAccelInfoRec to
> >     Bool        (*UploadToScreen) (PixmapPtr            pDst,
> >                                    int x, int y, int w, int h,
> >                                    char                 *src,
> >                                    int                  src_pitch);
> >
> > to match the DownloadFromScreen pointer, and allow us to use
> > UploadToScreen to accelerate PutImage. Any opinions?
> >
> > Lars
> > _______________________________________________
> > xorg mailing list
> > xorg at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/xorg
>
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg



More information about the xorg mailing list