]> git.baikalelectronics.ru Git - kernel.git/commit
media: ti-vpe: vpe: fix a v4l2-compliance failure about invalid sizeimage
authorBenoit Parrot <bparrot@ti.com>
Mon, 7 Oct 2019 15:09:59 +0000 (12:09 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 10 Oct 2019 16:49:02 +0000 (13:49 -0300)
commit057657a2142109acfc4e47f2c5d47b9d961acbf5
treebcd4b52aa3a9d2d37e00230a230c726cfa9fd97c
parentb3cda545ed002c5eeebb7fc913bf053041b33f6e
media: ti-vpe: vpe: fix a v4l2-compliance failure about invalid sizeimage

v4l2-compliance fails with this message:

   fail: v4l2-test-formats.cpp(463): !pfmt.sizeimage
   fail: v4l2-test-formats.cpp(736): \
Video Capture Multiplanar is valid, \
but TRY_FMT failed to return a format
   test VIDIOC_TRY_FMT: FAIL

This failure is causd by the driver failing to handle out range
'bytesperline' values from user space applications.

VPDMA hardware is limited to 64k line stride (16 bytes aligned, so 65520
bytes). So make sure the provided or calculated 'bytesperline' is
smaller than the maximum value.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/ti-vpe/vpdma.h
drivers/media/platform/ti-vpe/vpe.c