Re: [PATCH] videobuf2-dma-sg: Minimize the number of dma segments

2013-07-19 Thread Ricardo Ribalda Delgado
Hello Marek I have prepared a new set of patches, please take a look to them. The series implements the coherent allocation, segments compaction and use of sg_table, it does not implement the dma_map/dma_unmap/dma_sync, I rather work on that one when you are back. Thanks for your help On Thu,

Re: [PATCH] videobuf2-dma-sg: Minimize the number of dma segments

2013-07-18 Thread Marek Szyprowski
Hello, On 7/17/2013 4:20 PM, Ricardo Ribalda Delgado wrote: Hello again Marek In my system I am doing the scatter gather compaction on device driver... But I agree that it would be better done on the vb2 layer. For the oversize sglist we could do one of this two things. If we want to have a

Re: [PATCH] videobuf2-dma-sg: Minimize the number of dma segments

2013-07-18 Thread Ricardo Ribalda Delgado
Hello again: I have started to implemt it, but I think there is more hidden work in this task as it seems. In order to call dma_map_sg and max_dma_segment_size I need acess to the struct device, but (correct me if I am wrong), vb2 is device agnostic. Adding the above functionality will mean not

Re: [PATCH] videobuf2-dma-sg: Minimize the number of dma segments

2013-07-18 Thread Marek Szyprowski
Hello, On 7/18/2013 9:39 AM, Ricardo Ribalda Delgado wrote: Hello again: I have started to implemt it, but I think there is more hidden work in this task as it seems. In order to call dma_map_sg and max_dma_segment_size I need acess to the struct device, but (correct me if I am wrong), vb2 is

Re: [PATCH] videobuf2-dma-sg: Minimize the number of dma segments

2013-07-17 Thread Marek Szyprowski
Hello, On 7/15/2013 11:34 AM, Ricardo Ribalda Delgado wrote: Most DMA engines have limitations regarding the number of DMA segments (sg-buffers) that they can handle. Videobuffers can easily spread through houndreds of pages. In the previous aproach, the pages were allocated individually, this

Re: [PATCH] videobuf2-dma-sg: Minimize the number of dma segments

2013-07-17 Thread Ricardo Ribalda Delgado
Hi Marek alloc_pages_exact returns pages of order 0, every single page is filled into buf-pages, that then is used by vb2_dma_sg_mmap(), that also expects order 0 pages (its loops increments in PAGE_SIZE). The code has been tested on real HW. Your concern is that that alloc_pages_exact splits

Re: [PATCH] videobuf2-dma-sg: Minimize the number of dma segments

2013-07-17 Thread Marek Szyprowski
Hello, On 7/17/2013 11:43 AM, Ricardo Ribalda Delgado wrote: Hi Marek alloc_pages_exact returns pages of order 0, every single page is filled into buf-pages, that then is used by vb2_dma_sg_mmap(), that also expects order 0 pages (its loops increments in PAGE_SIZE). The code has been tested

Re: [PATCH] videobuf2-dma-sg: Minimize the number of dma segments

2013-07-17 Thread Ricardo Ribalda Delgado
Hello again I have made some experiments and have replaced alloc_pages_exact with alloc_pages of order N. Unfortunatelly vm_insert_page and vm_map_ram does not work as expected. vm_insert_page, only insert the PAGE_SIZE bytes of the higher order page, if I try to add the other pages manually,

Re: [PATCH] videobuf2-dma-sg: Minimize the number of dma segments

2013-07-17 Thread Ricardo Ribalda Delgado
Hello again Marek In my system I am doing the scatter gather compaction on device driver... But I agree that it would be better done on the vb2 layer. For the oversize sglist we could do one of this two things. If we want to have a simple pass processing we have to allocate an structure A for

[PATCH] videobuf2-dma-sg: Minimize the number of dma segments

2013-07-15 Thread Ricardo Ribalda Delgado
Most DMA engines have limitations regarding the number of DMA segments (sg-buffers) that they can handle. Videobuffers can easily spread through houndreds of pages. In the previous aproach, the pages were allocated individually, this could led to the creation houndreds of dma segments