[media] media: mx3_camera: buf_init() add buffer state check
authorAlex Gershgorin <alexg@meprolight.com>
Wed, 1 Aug 2012 08:05:10 +0000 (05:05 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 15 Aug 2012 22:59:03 +0000 (19:59 -0300)
commitc72f429f665c1f8087dddde75f4e99f4d1f886cd
treefbb68bd1da18c75f3df59d7f420fb2fbffec0f88
parent78fa59038eda0ad2501c67b6d79423addab4b871
[media] media: mx3_camera: buf_init() add buffer state check

This patch checks the state of the buffer when calling .buf_init() method.
This is needed for the USERPTR buffer type, because in that case
.buf_init() is called every time a buffer is queued, and not only once
during the preparation stage, like in the MMAP case. Without this check
buffers get initialised repeatedly, which also leads to the allocation
of new DMA descriptors, of which there is only a final relatively small
number available. Both MMAP and USERPTR methods were successfully tested.

Signed-off-by: Alex Gershgorin <alexg@meprolight.com>
[g.liakhovetski@gmx.de: remove mx3_camera_buffer::state completely]
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/mx3_camera.c