The patch number 9244 was added via Magnus Damm <[EMAIL PROTECTED]> to http://linuxtv.org/hg/v4l-dvb master development tree.
Kernel patches in this development tree may be modified to be backward compatible with older kernels. Compatibility modifications will be removed before inclusion into the mainstream Kernel If anyone has any objections, please let us know by sending a message to: [EMAIL PROTECTED] ------ video: improve sh_mobile_ceu buffer handling This patch improves the buffer handling in the sh_mobile_ceu driver. Instead of marking all queued buffers as VIDEOBUF_ACTIVE the code now marks queued-but-not-active buffers as VIDEOBUF_QUEUED and buffers involved in dma as VIDEOBUF_ACTIVE. The code is also updated with code to cancel active buffers, thanks to Morimoto-san. Signed-off-by: Magnus Damm <[EMAIL PROTECTED]> Tested-by: Kuninori Morimoto <[EMAIL PROTECTED]> Signed-off-by: Guennadi Liakhovetski <[EMAIL PROTECTED]> --- linux/drivers/media/video/sh_mobile_ceu_camera.c | 15 ++++++++++++++- 1 files changed, 14 insertions(+), 1 deletions(-) --- linux/drivers/media/video/sh_mobile_ceu_camera.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff -r 1b08df423fed -r 116288e3d3d5 linux/drivers/media/video/sh_mobile_ceu_camera.c --- a/linux/drivers/media/video/sh_mobile_ceu_camera.c Fri Oct 17 00:50:56 2008 +0200 +++ b/linux/drivers/media/video/sh_mobile_ceu_camera.c Fri Oct 17 00:51:20 2008 +0200 @@ -165,6 +165,7 @@ static void sh_mobile_ceu_capture(struct ceu_write(pcdev, CETCR, 0x0317f313 ^ 0x10); if (pcdev->active) { + pcdev->active->state = VIDEOBUF_ACTIVE; ceu_write(pcdev, CDAYR, videobuf_to_dma_contig(pcdev->active)); ceu_write(pcdev, CAPSR, 0x1); /* start capture */ } @@ -236,7 +237,7 @@ static void sh_mobile_ceu_videobuf_queue dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %zd\n", __func__, vb, vb->baddr, vb->bsize); - vb->state = VIDEOBUF_ACTIVE; + vb->state = VIDEOBUF_QUEUED; spin_lock_irqsave(&pcdev->lock, flags); list_add_tail(&vb->queue, &pcdev->capture); @@ -323,12 +324,24 @@ static void sh_mobile_ceu_remove_device( { struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); struct sh_mobile_ceu_dev *pcdev = ici->priv; + unsigned long flags; BUG_ON(icd != pcdev->icd); /* disable capture, disable interrupts */ ceu_write(pcdev, CEIER, 0); ceu_write(pcdev, CAPSR, 1 << 16); /* reset */ + + /* make sure active buffer is canceled */ + spin_lock_irqsave(&pcdev->lock, flags); + if (pcdev->active) { + list_del(&pcdev->active->queue); + pcdev->active->state = VIDEOBUF_ERROR; + wake_up_all(&pcdev->active->done); + pcdev->active = NULL; + } + spin_unlock_irqrestore(&pcdev->lock, flags); + icd->ops->release(icd); dev_info(&icd->dev, --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/116288e3d3d5e7dd15afa5a475ffeab4b5b16536 _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits