> Well, this explains some things - but not all of them. Perhaps you can
> point out to me where I am wrong ?
>
>   First of all, how PCI scatter-gather works: instead of having one
> physically contiguous buffer to DMA in/out, we have a list of page-sized
> buffers and a table (not more than a few pages long) that specifies which
> ones to use. For example, in case of Radeons, the entries in the table are
> 16 bytes long: two are addresses, one specifies what to do with them and
> one 32bit word is reserved. For bt848 the entries are 8 bytes
> long: address and a command.

I think you *might* be refering to the pci-gart work, where there is an 
agp-like address translation unit on the chip itself?  I've never done any 
work with that; you might try Jeff or Gareth or maybe Michael Danzer?  I'm 
not really sure who's been working on that side of things.

>   However, for AGP cards, AGP can do the translation by itself. So, in
> principle, the AGP card should take faked contiguous buffer and work with
> it.

You don't really need to think of agp memory as faked contiguous - it really 
appears as contiguous memory to the driver and the card;  the agpgart kernel 
module can do everything necessary for setting it up and taking it down.

>   As I am writing the driver from scratch, I will have a natural interface
> boundary: the part that manages the buffers and the part that uses buffer
> address (before and after AGP GART/PCI GART) for card-specific purposes.
> If I am using drm/agpgart I'll have to figure out how to get the same
> information - which seems unusually hard. (And since AGP GART is universal
> with relation to all AGP cards there should be a unique way to arrive at
> numbers to write into cards registers given DRM Handle, AGP Offset and the
> like).

The interface to agpgart *is* universal, but the work done setting up agp 
regions has so far been the responsibility of the X server, because it is the 
trusted entity.  The knowledge of what agp regions need to be set up is 
device-specific, so the place that we've set up agp regions in the past has 
been the device-specific part of the X server, namely the 2d driver.

>   Now this is all fine, except I hit a brick wall: in my documentation
> there are  several registers that allow one to start DMA and _all_ of
> those that I am interested in are supposed to point to PCI-like
> scatter-gather table. Now, having a scatter-gather table in agp
> translatable space is nuts. But, just ignoring AGP stuff does not work
> either: first of all it does not work (experimentally) and I suspect the
> reason is that the cards AGP registers are set to translate _all_
> addressable space (instead of only 32mb AGP aperture). I would have tried
> using space in AGP aperture except that I have no idea how to do it
> (and this is the place my previous questions were about).

You're starting to loose me here.  It is easy to get confused with agp 
address spaces, and you need to look at them and usually try a bunch of 
different approaches before stuff starts to work.  

>From what I know about the radeon pcigart table, you end up with something a 
lot like an agpgart apperture where contiguous addresses are translated by 
hardware on the card to discontig addresses in main memory.  However, I've 
never dealt with these creatures...

>  And for some specific questions: D
>
>      * Does it make sense to have PCI GART and AGP GART working
>        simultaneously ? (AGP for graphics and PCI for things like
>        capture).

My guess is no - you make a choice according to whether agp is available and 
if so use that exclusively.  Search out the pcigart code - it will probably 
help you a lot.  Maybe consider supporting only agpgart to start with as that 
is the most common case.

>      * Do we actually need to set AGP registers to translate _all_
>        addresses ?

This sounds like a misconception - the agp aperture is only 32 or 64 meg, and 
it's only addresses in that range which get translated.  Addresses outside 
the aperture are unaffected by agp translations.  Otherwise the whole 
computer would break???

Keith

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Reply via email to