On 24 Apr 2002, Jose Fonseca wrote:

> On Wed, 2002-04-24 at 14:13, Jens Owen wrote:
> > ...
> > 
> > Jose,
> > 
> > I don't have a complete answer for you, but here is *some* background
> > information that might help.
> > 
> > The drmAddBufs style was created with the origianal DRI infrastructure
> > that supported a partial implementation of the Gamma driver.  Buffers
> > were short, and based out of PCI memory.
> > 
> > The first complete driver was the 3Dfx.  It used MMIO and didn't need
> > any DMA buffers.
> > 
> > The second and third complete drivers were the i810 and mga.  The were
> > the first to require AGP based DMA, and that's when the drmAGPAlloc
> > functionality was added.
> > 
> > I believe the AGP implementation is flexable about where the physical
> > pages reside, and can use the GART to make the pages appear contiguous
> > to both the 3D driver *and* the hardware.
> > 
> > For PCI DMA, I believe you need to allocate actual contiguous pages in
> > order for the hardware to see the memory as contiguous.  This may be why
> > the mechanism is more cumbersome--or it could be that the PCI DMA case
> > just hasn't been fully flushed out.
> 
> Allocating contiguous pages in physical memory is complicated, and is
> addressed by the drmAddBufs, assuming that one doesn't choose the size
> of each individual buffer too big. The problem is that drmAddBufs makes
> it difficult to separate the general purpose DMA buffers from buffer
> with a special purpose, such as primary buffers or page tables.

I was looking at the code in glint_dri.c to add the page table thinking
that we could set the DRM_RESTRICTED flag for the descriptor table as is
done there.  However, in looking at drmAddBufs and the ioctl, the last arg
is the agp_offset for DRM_AGP_BUFFER and is unused for PCI, so passing
DRM_RESTRICTED in the last arg to drmAddBufs is just wrong.  AFAICT, you
only use DRM_RESTRICTED with drmAddMap.  Am I missing something or does
the glint/gamma driver have a problem here?

> I think I'll extract the actual buffer allocation code from drmAddBufs
> into a separate IOCTL available for those cards that may need it.
> 
> > I believe the r128 driver's PCI support still utilizes GART
> > functionality to allow non-contiguous memory to be utilized.  Your
> > driver may be the first to need true PCI support, and *possibly* the
> > last to need it unless other legacy chipsets of the same era are
> > supported.
> 
> The gamma driver could use it (but just to have a little more code
> readability). I don't know if MGA has a PCI version but it would
> simplify substantially extending its support in case there is, as there
> would be possible to make a parallelism between the AGP and PCI code. I
> believe that the Savage chips come in PCI versions too, and this might
> be handy again.
> 
> > 
> > I hope this helps.
> 
> Yes. Thanks very much for the background info.
> 
> > 
> > --                             /\
> >          Jens Owen            /  \/\ _    
> >   [EMAIL PROTECTED]  /    \ \ \   Steamboat Springs, Colorado
> > 
> 
> Regards,
> 
> Jose Fonseca
> 
> 
> _______________________________________________
> Dri-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/dri-devel
> 

-- 
Leif Delgass 
http://www.retinalburn.net


_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to