[lkml]   [2008]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[RFC] iomap_atomic_prot_pfn()

For the new DRM graphics memory manager, there is a need to map and
patch graphics command buffers from within the kernel. When the memory
manager has sorted out where the buffers are located, the command stream
and state buffers need to be patched up with references to the new
locations. At this point, the buffers are usually located in graphics
memory or bound to the AGP aperture.

So there is a need to do quick map - write - unmap of a single or
possibly a pair of these pages, and it seems something like
kmap_atomic() would be the best thing, in order to avoid IPI tlb flushing.
It seems like ioremap_nocache() is too slow, and it's not really an
option to permanently map a large area of graphics memory or AGP
aperture space.

So I've considered implementing something like the following:

void *iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type,
pgprot_t protection);

Initially at least on some architectures: x86 and ppc.

But there are some options:
1) Reuse the fixmap kmap_atomic KM_USER? and KM_IRQ? slots on
architectures that support them, and add them to the fixmap of the other.
2) Add completely new fixmap slots on all architectures, starting with
the ones listed above.
3) Don't do any of this, but allocate some permanent ptes using vmap()
and hack those ptes within the driver when needed.

So basically I'm asking for some guidance on which is the preferred
method to do this. Any comments appreciated.

/Thomas Hellström
Tungsten Graphics

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2008-03-10 17:27    [W:0.024 / U:13.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site