linux-mips
[Top] [All Lists]

Re: Uncached mmap

To: Mile Davidovic <Mile.Davidovic@micronasnit.com>
Subject: Re: Uncached mmap
From: Ralf Baechle <ralf@linux-mips.org>
Date: Mon, 13 Nov 2006 12:32:33 +0000
Cc: linux-mips@linux-mips.org
In-reply-to: <001201c70704$bc731230$5c00a8c0@niit.micronasnit.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <001201c70704$bc731230$5c00a8c0@niit.micronasnit.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.4.2.2i
On Mon, Nov 13, 2006 at 10:18:52AM +0100, Mile Davidovic wrote:

> Hello to all,
> I am working on fb device and I have general questions regarding cache/uncache
> access to MIPS memory. 
> 
> User space application use mmap access for r/w access to fb device. If fb use
> cached memory, user space application has to call cacheflush to flush contents
> instruction and/or data cache. In this case there are no limitations regarding
> byte access to this memory. Is this correct statement?

Yes.

With caching bus transfers from and to the device happen at the full width
of the bus, so a device won't see byte accesses ever.

> If fb use uncached memory, there is no need for cacheflush call in user space
> application but limitation is access to mmap uncached memory.

Correct.

> There is no byte access to uncached mmaped memory. Is this correct statement?

Definately wrong.  For example alot of mmapped I/O devices use uncached
byte accesses.

This stament if of course limited to the CPU's part of the system.  Devices
may have their specific restrictions on access size and its not uncommon to
have such restrictions though that would seem unlikely for framebuffer
memory.

If your particular CPU support it you may want to use cache mode "uncached
accellerated" for a framebuffer.  It should deliver significtn performance
gains yet avoid the need for cache flushes.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>