]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit - drivers/media/v4l2-core/videobuf2-dma-sg.c
[media] media/videobuf2-dma-sg: Fix handling of sg_table structure
authorRicardo Ribalda <ricardo.ribalda@gmail.com>
Wed, 29 Apr 2015 12:00:45 +0000 (09:00 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sat, 30 May 2015 14:28:29 +0000 (11:28 -0300)
commit6a5d77cbf26078e9ee8f88c7d77fe0a7fa4a0364
treed32cac4d537d73e0641dd2e38d187273fa75ee48
parent29fba6a84bc73b9250472e4779ca255f585878a6
[media] media/videobuf2-dma-sg: Fix handling of sg_table structure

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 number of areas mapped by the hardware,
which could be different than the areas given as an input.
The output must be saved to nent.

The output of dma_map, should be used to transverse the scatter list.

dma_unmap_sg needs the value passed to dma_map_sg (nents_orig).

sg_free_tables uses also orig_nent.

This patch fix the file to follow this paradigm.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/media/v4l2-core/videobuf2-dma-sg.c