Re: [PATCH 0/3] hwmem: Hardware memory driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 16 Nov 2010 17:16:23 +0100, Johan MOSSBERG <johan.xx.mossberg@xxxxxxxxxxxxxx> wrote:

MichaÅ Nazarewicz wrote:
In particular, a cma_alloc() could return a pointer to an opaque
struct cma and to get physical address user would have to pin the
buffer with, say, cma_pin() and then call cma_phys() to obtain
physical address.

I think cma_phys() is redundant, cma_pin() can return the physical
address, that's how we did it in hwmem.

Makes sense.  I'd add cma_phys() for convenience anyway.

I'm only wondering if treating "unpin" as "free" and pin as another
"alloc" would not suffice?

I don't understand. Wouldn't you lose all the data in the buffer
when you free it? How would we handle something like the desktop
image which is blitted to the display all the time but never
changes? We'd have to keep a scattered version and then copy it
into a temporary contiguous buffer which is not optimal
performance wise. The other alternative would be to keep the
allocation but then we would get fragmentation problems.

Got it.

Do you want to remap user space mappings when page is moved during
defragmentation? Or would user need to unmap the region?  Ie. would
mmap()ed buffer be pinned?

--
Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  MichaÅ "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]