Re: fb_defio with a coherent DMA framebuffer
From: "Magnus Damm" <magnus.damm@gmail.com>
Date: 2008-12-26 02:23:01
On Fri, Dec 26, 2008 at 5:43 AM, Jaya Kumar [off-list ref] wrote:
On Fri, Dec 12, 2008 at 8:00 PM, [off-list ref] wrote:quoted
Is fb_defio supposed to work with DMA memory? I saw a thread from over a year ago about defio's nopage (we're still using 2.6.24) being written to use driver supplied flags to specify what memory allocation type nopage is dealing with. Was this not implemented or not deemed necessary? I would be very interested to hear any suggestions about how we should tackle making this work.The current defio code does not work with DMA memory. This has been recently rectified by Magnus Damm. This effort is still in progress in some areas but I think it is usable. As for using 2.6.24, my response to that would be: Why? We're on 2.6.28 and defio has seen a reasonable amount of change since 24. :-)
The patch that Jaya referrers to simply adds support for physically contiguous frame buffers. This means that the frame buffer is contiguous both in virtual space and physical space. Your frame buffer memory must be backed with struct page though. The patch can be found here: http://thread.gmane.org/gmane.linux.ports.sh.devel/5012/focus=5015 However, your coherent memory may or may not be backed by struct page. Some types of memories may have pfn mappings only. If your memory is backed by struct page or not depends on your coherent DMA memory implementation. On SuperH we use __get_free_pages() and split_page() unless dma_declare_coherent() has been used. This works well for me. Have a look at arch/sh/mm/consistent.c and kernel/dma-coherent.c in a recent kernel. Cheers, / magnus ------------------------------------------------------------------------------