diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2014-04-14 18:52:31 +0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-05-23 19:20:33 +0400 |
commit | b1c090d0f4afbb87340dcdd5084391098d2f279d (patch) | |
tree | 9de1b511b0889055a87b75621b21ce55fd851f41 | |
parent | e21c94e772a34c3dec920e8e5ad313f4f3d77147 (diff) | |
download | linux-b1c090d0f4afbb87340dcdd5084391098d2f279d.tar.xz |
[media] media: davinci: vpbe: release buffers in case start_streaming call back fails
this patch adds support to release the buffer by calling
vb2_buffer_done(), with state marked as VB2_BUF_STATE_QUEUED
if start_streaming() call back fails.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/platform/davinci/vpbe_display.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c index 4025b1b8aff4..bf5eff99452b 100644 --- a/drivers/media/platform/davinci/vpbe_display.c +++ b/drivers/media/platform/davinci/vpbe_display.c @@ -355,8 +355,17 @@ static int vpbe_start_streaming(struct vb2_queue *vq, unsigned int count) /* Set parameters in OSD and VENC */ ret = vpbe_set_osd_display_params(fh->disp_dev, layer); - if (ret < 0) + if (ret < 0) { + struct vpbe_disp_buffer *buf, *tmp; + + vb2_buffer_done(&layer->cur_frm->vb, VB2_BUF_STATE_QUEUED); + list_for_each_entry_safe(buf, tmp, &layer->dma_queue, list) { + list_del(&buf->list); + vb2_buffer_done(&buf->vb, VB2_BUF_STATE_QUEUED); + } + return ret; + } /* * if request format is yuv420 semiplanar, need to |