Re: [PATCH 1/3] media/videobuf2-dma-sg: Fix handling of sg_table structure

2015-02-11 Thread Ricardo Ribalda Delgado
Hello again On Wed, Feb 11, 2015 at 10:00 AM, Marek Szyprowski wrote: > Well, this int return value seems to be misleading, but according to > Documentation/DMA-API.txt, the only error value is zero: > > "As with the other mapping interfaces, dma_map_sg() can fail. When it > does, 0 is returned

Re: [PATCH 1/3] media/videobuf2-dma-sg: Fix handling of sg_table structure

2015-02-11 Thread Marek Szyprowski
Hello, On 2015-02-11 09:37, Ricardo Ribalda Delgado wrote: Hello Marek On Wed, Feb 11, 2015 at 9:06 AM, Marek Szyprowski wrote: Unfortunately nent differs in sign to the output of dma_map_sg, so an intermediate value must be used. I don't get this part. dma_map_sg() returns the number of sca

Re: [PATCH 1/3] media/videobuf2-dma-sg: Fix handling of sg_table structure

2015-02-11 Thread Ricardo Ribalda Delgado
Hello Marek On Wed, Feb 11, 2015 at 9:06 AM, Marek Szyprowski wrote: >> Unfortunately nent differs in sign to the output of dma_map_sg, so an >> intermediate value must be used. > > > I don't get this part. dma_map_sg() returns the number of scatter list > entries mapped > to the hardware or zero

Re: [PATCH 1/3] media/videobuf2-dma-sg: Fix handling of sg_table structure

2015-02-11 Thread Marek Szyprowski
Hello, On 2015-02-09 17:14, Ricardo Ribalda Delgado wrote: when sg_alloc_table_from_pages() does not fail it returns a sg_table structure with nents and nents_orig initialized to the same value. dma_map_sg returns the dma_map_sg returns the number of areas mapped by the hardware, which could be

[PATCH 1/3] media/videobuf2-dma-sg: Fix handling of sg_table structure

2015-02-09 Thread Ricardo Ribalda Delgado
when sg_alloc_table_from_pages() does not fail it returns a sg_table structure with nents and nents_orig initialized to the same value. dma_map_sg returns the dma_map_sg returns the number of areas mapped by the hardware, which could be different than the areas given as an input. The output must b