Salut, I'm trying to port DRM to NetBSD, for that purpose it's necessary to use the bus_dma(9) API instead of the vtophys hack. Therefor, I'm currently performing the last task which is going to be porting the DMA interface.
pci_alloc allocates a DMA buffer of some specified size, whereas
ati_agpgart_init uses a regular buffer size that is "constant" in the sense
that it doesn't change during the code execution, so I could simply use a
static DMA buffer for it that gets mapped at once and unmapped on cleanup.
However, pci_alloc allocates a buffer whose size cannot be easily determined,
because it's passed to the function, so you cannot simply pre-allocate a DMA
pool and allocate from that. The question is thus, is there a boundary that
the memory usage is guaranteed not to pass, either hardware-wise or because
the software will never need more? I'm not sure about that. Otherwise, it
might become necessary to allocate lists of DMA buffers, which is ugly.
Thanks,
Tonnerre
pgpSTjebBsw0B.pgp
Description: PGP signature
