LKML Archive on
help / color / mirror / Atom feed
From: "Thomas Hellström" <>
To: Linux Kernel list <>
Subject: [RFC] iomap_atomic_prot_pfn()
Date: Mon, 10 Mar 2008 17:08:00 +0100	[thread overview]
Message-ID: <> (raw)


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

                 reply	other threads:[~2008-03-10 16:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \
    --subject='Re: [RFC] iomap_atomic_prot_pfn()' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).