vb2: Don't WARN when v4l2_buffer.bytesused is 0 for multiplanar buffers
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 19 Jun 2015 11:50:07 +0000 (08:50 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:02 +0000 (09:29 -0700)
commit24dade33c059e297602a100d5e3b34de3106e259
tree035f561cc44fc8c586d9cd4415a3416152ec7330
parentb7bc8d0ac57d3728d0a2c14db9dec2cf5cf02b15
vb2: Don't WARN when v4l2_buffer.bytesused is 0 for multiplanar buffers

commit 77a3c6fd90c94f635edb00d4a65f485687538791 upstream.

Commit f61bf13b6a07 ("[media] vb2: add allow_zero_bytesused flag to the
vb2_queue struct") added a WARN_ONCE to catch usage of a deprecated API
using a zero value for v4l2_buffer.bytesused.

However, the condition is checked incorrectly, as the v4L2_buffer
bytesused field is supposed to be ignored for multiplanar buffers. This
results in spurious warnings when using the multiplanar API.

Fix it by checking v4l2_buffer.bytesused for uniplanar buffers and
v4l2_plane.bytesused for multiplanar buffers.

Fixes: f61bf13b6a07 ("[media] vb2: add allow_zero_bytesused flag to the vb2_queue struct")

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/v4l2-core/videobuf2-core.c