[media] media i.MX27 camera: improve discard buffer handling
authorJavier Martin <javier.martin@vista-silicon.com>
Tue, 7 Feb 2012 10:14:42 +0000 (07:14 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 8 Mar 2012 12:41:56 +0000 (09:41 -0300)
commitcdc9d6f191d81aa1b1b34db9d3a33f779f5c5ec7
tree3223a3fa758c180fdd17e88b48c6c59506410d51
parentfb51cbdd3ec868b903bd706aa7db065c8c36bcd4
[media] media i.MX27 camera: improve discard buffer handling

The way discard buffer was previously handled lead
to possible races that made a buffer that was not
yet ready to be overwritten by new video data. This
is easily detected at 25fps just adding "#define DEBUG"
to enable the "memset" check and seeing how the image
is corrupted.

A new "discard" queue and two discard buffers have
been added to make them flow trough the pipeline
of queues and thus provide suitable event ordering.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/mx2_camera.c