diff options
author | Prabhakar Lad <prabhakar.csengg@gmail.com> | 2014-10-12 17:40:35 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-10-28 16:07:52 -0200 |
commit | 50d9481ddcc88a6a0b282a5d74f2f62639d70660 (patch) | |
tree | 101d16569d6adb358e61ec1df4fa83b157224d0a /drivers/media/platform/davinci | |
parent | f2095f658df7f660fbf97e116096473a5b0d2f8f (diff) | |
download | talos-obmc-linux-50d9481ddcc88a6a0b282a5d74f2f62639d70660.tar.gz talos-obmc-linux-50d9481ddcc88a6a0b282a5d74f2f62639d70660.zip |
[media] media: davinci: vpbe: improve vpbe_buffer_prepare() callback
this patch improve vpbe_buffer_prepare() callback, as buf_prepare()
callback is never called with invalid state and check for
vb2_plane_vaddr(vb, 0) is dropped as payload check should
be done unconditionally.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/davinci')
-rw-r--r-- | drivers/media/platform/davinci/vpbe_display.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c index 491b8320f6a6..524e1fd53ada 100644 --- a/drivers/media/platform/davinci/vpbe_display.c +++ b/drivers/media/platform/davinci/vpbe_display.c @@ -215,22 +215,15 @@ static int vpbe_buffer_prepare(struct vb2_buffer *vb) v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev, "vpbe_buffer_prepare\n"); - if (vb->state != VB2_BUF_STATE_ACTIVE && - vb->state != VB2_BUF_STATE_PREPARED) { - vb2_set_plane_payload(vb, 0, layer->pix_fmt.sizeimage); - if (vb2_plane_vaddr(vb, 0) && - vb2_get_plane_payload(vb, 0) > vb2_plane_size(vb, 0)) - return -EINVAL; + vb2_set_plane_payload(vb, 0, layer->pix_fmt.sizeimage); + if (vb2_get_plane_payload(vb, 0) > vb2_plane_size(vb, 0)) + return -EINVAL; - addr = vb2_dma_contig_plane_dma_addr(vb, 0); - if (q->streaming) { - if (!IS_ALIGNED(addr, 8)) { - v4l2_err(&vpbe_dev->v4l2_dev, - "buffer_prepare:offset is \ - not aligned to 32 bytes\n"); - return -EINVAL; - } - } + addr = vb2_dma_contig_plane_dma_addr(vb, 0); + if (!IS_ALIGNED(addr, 8)) { + v4l2_err(&vpbe_dev->v4l2_dev, + "buffer_prepare:offset is not aligned to 32 bytes\n"); + return -EINVAL; } return 0; } |