EXA pixmap alignments.

Benjamin Herrenschmidt benh at kernel.crashing.org
Wed Sep 28 01:59:00 PDT 2005

On Wed, 2005-09-28 at 08:32 +0200, Lars Knoll wrote:

> Yes, that's what I currently do on nv. I also have an idea how to do 
> fb->system using PCI scatter/gather, but didn't have the time to try it out 
> up to now.

You may want to "peek" my kernel side code for that once I'm finished...
I hope I'll have something to play with sometimes next week-end.

> Btw, is there any way to know if an AGP chipset supports writes 
> from card to AGP?

Not really afaik. The radeon DRI does a sneaky test at startup, it
"tries" to do a writeback to a scratch location and verifies if it
actually worked. If not, it uses MMIO reads to read the scratch value
(used for register aging afaik), if yes, it reads the one that was
written to AGP. That's the only thing that info is used for though at
the moment.

I suppose we should expose more infos from the APG chipset drivers.

Looking at Apple Darwin driver for their AGP chipset, I see other
interesting "features". Some version of the chipset expose "flags"
called "kIOAGPDisableUnaligned" and "kIOAGPDisablePageSpans" whose exact
meaning is still obscure to me (though whatever I can imagine they might
mean is a bit scary... like we shouldn't do transfers that cross a page
boundary on some of them ? Ugh....) in addition to
"kIOAGPDisableAGPWrites" whose meaning is clear enough (and we've known
about it the hard way before Apple published a driver with those flags
exposed anyway).

I've been told in the past that such limitations existed on various x86
chipsets as well.

> Difficult to say without doing some measurements. The fastest way however 
> would be to temporarily map the destination of the pixmap into the GART, then 
> initiate the transfer from the framebuffer and afterwards remove the chunk of 
> memory from the GART again. But that would require some kernel support from 
> either agpgart or drm.

Yes. That is definitely what I'd like to aim toward in the future. It
would be a bit difficult with AGP due to the cache issues but would work
fine with PCI GART and PCIE GART. Note that there might still be a size
threshold below which it's better to copy manually, either to fb, or to
some permanently allocated scratch in the GART to avoid the overhead of
setting up & tearing down the mapping. (Especially since on x86_64 with
no iommu, the kernel will end up bouncing your pixmaps to low memory if
you have physical RAM above the 4Gb point and your card isn't 64 bits BM
capable, at least for PCI & PCIE GART, AGP is a different matter).


More information about the xorg mailing list