add pmem driver
PATCH 3/6 add pmem driver
This adds android pmem driver, one of dependencies of camera driver.
drivers/staging/dream/Kconfig +5 -1
@@ -39,5 +39,9 @@ config INPUT_GPIO Say Y here if you want to support gpio based keys, wheels etc... config GENERIC_GPIO - bool + bool + default y + +config ANDROID_PMEM + bool "Android pmem allocator" default y
drivers/staging/dream/Makefile +1 -0
@@ -1,4 +1,5 @@ obj-$(CONFIG_MSM_ADSP) += qdsp5/ smd/ obj-$(CONFIG_MSM_CAMERA) += camera/ obj-$(CONFIG_INPUT_GPIO) += gpio_axis.o gpio_event.o gpio_input.o gpio_matrix.o gpio_output.o +obj-$(CONFIG_ANDROID_PMEM) += pmem.o
drivers/staging/dream/pmem.c new file +1335 -0
1,335 lines not on this page · raw message
Signature · 8 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html ----- End forwarded message ----- -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 3 lines · Pavel Machek
This adds android pmem driver, one of dependencies of camera driver.
I wouldn't even both with this one .. There's no way it could ever go into mainline .. According to the android developers the camera , and the frame buffer driver should work without it anyway..
Daniel
Quoted 7 lines · Daniel Walker
Quoted 2 lines · Pavel Machek
This adds android pmem driver, one of dependencies of camera driver.
I wouldn't even both with this one .. There's no way it could ever go into mainline .. According to the android developers the camera , and the frame buffer driver should work without it anyway..
Well, without it, it does not link. If you can provide better patch, please go ahead. (But please let me fix the compilation in the meantime).
Plus... why do you think this is completely unacceptable? We may need to strip the userland interface, but the rest...?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 11 lines · Pavel Machek
Quoted 7 lines · Daniel Walker
Quoted 2 lines · Pavel Machek
This adds android pmem driver, one of dependencies of camera driver.
I wouldn't even both with this one .. There's no way it could ever go into mainline .. According to the android developers the camera , and the frame buffer driver should work without it anyway..
Well, without it, it does not link. If you can provide better patch, please go ahead. (But please let me fix the compilation in the meantime).
Now that I think about it, maybe just the frame buffer driver can work without it.. If it's really needed for the camera then the agenda should be removing pmem from the camera ..
Quoted 2 lines
Plus... why do you think this is completely unacceptable? We may need to strip the userland interface, but the rest..
The userland interface is the core of the driver tho .. According to the android developers (my understanding anyway), this driver just allows large blocks of memory to be allocated then shared between userspace and kernel space .. Brian can explain it better, but from the sound of it they are likely replicating interfaces that we already have ..
Daniel
Quoted 17 lines · Daniel Walker
Quoted 11 lines · Pavel Machek
Quoted 7 lines · Daniel Walker
Quoted 2 lines · Pavel Machek
This adds android pmem driver, one of dependencies of camera driver.
I wouldn't even both with this one .. There's no way it could ever go into mainline .. According to the android developers the camera , and the frame buffer driver should work without it anyway..
Well, without it, it does not link. If you can provide better patch, please go ahead. (But please let me fix the compilation in the meantime).
Now that I think about it, maybe just the frame buffer driver can work without it.. If it's really needed for the camera then the agenda should be removing pmem from the camera ..
Quoted 8 lines
Quoted 2 lines
Plus... why do you think this is completely unacceptable? We may need to strip the userland interface, but the rest..
The userland interface is the core of the driver tho .. According to the android developers (my understanding anyway), this driver just allows large blocks of memory to be allocated then shared between userspace and kernel space .. Brian can explain it better, but from the sound of it they are likely replicating interfaces that we already have ..
AFAICT, pmem exports functionality that is required by the other part. I agree that new userland interface is probably no-go, but I also believe that it should be easy enough to remove (or maybe change) in followup patch.
It will be worked on, eventually. For now, we'd like dream support to compile and link, and then maybe to boot.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 7 lines · Daniel Walker
Quoted 2 lines · Pavel Machek
This adds android pmem driver, one of dependencies of camera driver.
I wouldn't even both with this one .. There's no way it could ever go into mainline .. According to the android developers the camera , and the frame buffer driver should work without it anyway..
The latest camera driver should work without pmem (or be fixable to do so -- I forget if that's done yet).
The framebuffer itself does not need pmem, but pmem is used heavily by the android userspace on dream/magic for hardware compositable surfaces (since the 2d compositor requires physically contiguous memory).
Is there a general linux kernel solution for managing large (1-8MB+) chunks of physically contiguous memory that needs to be shared between kernel and userspace for media operations? This is a very common problem with these SoCs -- the a/v subsystem and/or GPU don't have scatter/gather or MMU support and as a result we need to carve out memory for their use and provide some way for userspace to manipulate it.
Brian
Quoted 17 lines · Brian Swetland
Quoted 7 lines · Daniel Walker
Quoted 2 lines · Pavel Machek
This adds android pmem driver, one of dependencies of camera driver.
I wouldn't even both with this one .. There's no way it could ever go into mainline .. According to the android developers the camera , and the frame buffer driver should work without it anyway..
The latest camera driver should work without pmem (or be fixable to do so -- I forget if that's done yet).
The framebuffer itself does not need pmem, but pmem is used heavily by the android userspace on dream/magic for hardware compositable surfaces (since the 2d compositor requires physically contiguous memory).
Quoted 7 lines
Is there a general linux kernel solution for managing large (1-8MB+) chunks of physically contiguous memory that needs to be shared between kernel and userspace for media operations? This is a very common problem with these SoCs -- the a/v subsystem and/or GPU don't have scatter/gather or MMU support and as a result we need to carve out memory for their use and provide some way for userspace to manipulate it.
After out last conversation I found the the system calls splice/vm-splice .. I don't know a great deal about those system call, but from what I read that sounded like it would be the appropriate way to transfer memory between two kernel drivers (i.e. camera to framebuffer) ..
As for sharing it with userspace, I haven't really researched that enough to give a good answer. I would think you could build something into the camera driver that would expose the memory to userspace temporarily then the camera could reclaim the memory later.
Daniel