On Sun, 2008-10-19 at 19:53 +0200, Ingo Molnar wrote:
fset);
This API needs the cacheability control, which I don't see in it
currently. In the past we've been relying on an MTRR over the GTT
resulting in all of our UC- mappings getting us the correct WC behavior,
but now there aren't enough MTRRs to go around and graphics loses out
(at about a 20% CPU cost as a conservative estimate). The primary goal
of the new API is to let us eat PAT costs up front so we don't have to
at runtime.
Second, we need to know when we're doing a mapping whether we're
affected by atomic scheduling restrictions. Right now our plan has been
to try doing page-by-page
io_map_atomic_wc()/copy_from_user_inatomic()/io_unmap_atomic(), and if
we fail at that at some point (map returns NULL or we get a partial
completion from copy_from_user_inatomic) then fall back to io_map_wc()
and copy_from_user() the whole thing at once. That gets us good
performance on both x86 with highmem and x86-64, and not too shabby
performance on x86 non-highmem.
Also, while it's rare, there have been graphics cards (looking at you,
S3) where BARs were expensive for some reason and they stuffed both the
framebuffer and registers into one PCI BAR, where you want the FB to be
WC and the registers to be UC. Not sure if they would be supportable
with this API or not. And if it's not, I'm not sure how much we care to
design for them, but it's something to potentially consider.
Finally, I'm confused by the pfn and offset args to io_resource_map,
when I expected something parallel to ioremap but with our resource arg
added.
--=20
Eric Anholt
eric@anholt.neteric.anholt@intel.com