Hi Kristen, The free function is in exit_dma_skipframe_release: I use the wrong free size, now corrected. Please review. Thanks!
--
Index: linux-2.6.37/drivers/staging/mrstci/mrstisp/mrstisp_main.c
===================================================================
--- linux-2.6.37/drivers/staging/mrstci/mrstisp/mrstisp_main.c (revision 105)
+++ linux-2.6.37/drivers/staging/mrstci/mrstisp/mrstisp_main.c (working copy)
@@ -46,6 +46,12 @@
static unsigned long jiffies_start;
static int mipi_flag;
+/* DMA buffer pointer for skipped frames
+ * when input FIFO is empty */
+#define SKIPPED_FRAME_MAX_SIZE 0x00400000
+static void *addr_for_skipped_frame;
+static dma_addr_t dma_addr_for_skipped_frame;
+
#define ISP_CLOCK_GATING
#ifdef ISP_CLOCK_GATING
@@ -3014,6 +3020,11 @@
isp->next->i);
} else {
isp->stopflag = 1;
+ /* input FIFO is empty, this frame should be skipped
+ * set DMA WR address to the skipped frame buf*/
+ mrst_isp_update_marvinvfaddr(isp,
+ dma_addr_for_skipped_frame,
+ CI_ISP_CFG_UPDATE_FRAME_SYNC);
dprintk(0, "stop isp");
}
@@ -3219,6 +3230,18 @@
dprintk(1, "isp mb1 = %lx, mb1_size = %lx", isp->mb1, isp->mb1_size);
+ /* allocate memory space for the skipped frames */
+ addr_for_skipped_frame = dma_alloc_coherent(&pdev->dev,
+ SKIPPED_FRAME_MAX_SIZE,
+ &dma_addr_for_skipped_frame,
+ GFP_KERNEL);
+
+ if (!addr_for_skipped_frame) {
+ printk(KERN_WARNING "failed to allocate dma memory for skipped
frame");
+ ret = -ENXIO;
+ goto exit_iounmap;
+ }
+
ret = dma_declare_coherent_memory(&pdev->dev, start,
/* start, len - 640 * 480 * 2, */
start, len,
@@ -3230,7 +3253,7 @@
if (!ret) {
dprintk(0, "failed to declare dma memory");
ret = -ENXIO;
- goto exit_iounmap;
+ goto exit_dma_skipframe_release;
}
/* init device struct */
@@ -3298,6 +3321,9 @@
video_unregister_device(isp->vdev);
exit_dma_release:
dma_release_declared_memory(&pdev->dev);
+exit_dma_skipframe_release:
+ dma_free_coherent(&pdev->dev, SKIPPED_FRAME_MAX_SIZE,
+ addr_for_skipped_frame, dma_addr_for_skipped_frame);
exit_iounmap:
iounmap(isp->regs);
exit_release_regions:
Signed-off-by: Yong He <[email protected]>
-- Yong
Phone (+86) 21-61166334
Lab (+86) 21-61167881
> -----Original Message-----
> From: Kristen Carlson Accardi [mailto:[email protected]]
> Sent: Tuesday, June 21, 2011 2:21 AM
> To: He, Yong M
> Cc: [email protected]; Arjan van de Ven
> Subject: Re: [PATCH] MRST Tablet camera driver ver-0.951, fix 8917
>
> On Mon, 20 Jun 2011 16:46:48 +0800
> "He, Yong M" <[email protected]> wrote:
>
> >
> > Hi,
> >
> > Please help to review the patch
> >
> > From: Yong He <[email protected]>
> > Subject: [PATCH] MRST Tablet camera driver ver-0.951, fix 8917
> >
> > Bug_8917 -[MM-camera]: a cropped line appears on both camera previewing.
> > solution is to add a empty frame buffer space. If the in-queue is empty,
> > all dropped frames goes to this empty buffer.
> >
> > Signed-off-by: He, Yong <[email protected]>
> > ---
> > Index: linux-2.6.37/drivers/staging/mrstci/mrstisp/mrstisp_main.c
> > ===================================================================
> > --- linux-2.6.37/drivers/staging/mrstci/mrstisp/mrstisp_main.c (revision
> > 106)
> > +++ linux-2.6.37/drivers/staging/mrstci/mrstisp/mrstisp_main.c
> > (working copy)
> > @@ -46,6 +46,12 @@
> > static unsigned long jiffies_start;
> > static int mipi_flag;
> > +/* DMA buffer pointer for skipped frames
> > + * when input FIFO is empty */
> > +#define SKIPPED_FRAME_MAX_SIZE 0x00400000
> > +static void *addr_for_skipped_frame;
> > +static dma_addr_t dma_addr_for_skipped_frame;
> > +
> > #define ISP_CLOCK_GATING
> > #ifdef ISP_CLOCK_GATING
> > @@ -3014,6 +3020,11 @@
> > isp->next->i);
> > } else {
> > isp->stopflag = 1;
> > + /* input FIFO is empty, this frame should be
> > skipped
> > + * set DMA WR address to the skipped frame buf*/
> > + mrst_isp_update_marvinvfaddr(isp,
> > + dma_addr_for_skipped_frame,
> > + CI_ISP_CFG_UPDATE_FRAME_SYNC);
> > dprintk(0, "stop isp");
> > }
> > @@ -3219,6 +3230,18 @@
> > dprintk(1, "isp mb1 = %lx, mb1_size = %lx", isp->mb1,
> > isp->mb1_size);
> > + /* allocate memory space for the skipped frames */
> > + addr_for_skipped_frame = dma_alloc_coherent(&pdev->dev,
> > + SKIPPED_FRAME_MAX_SIZE,
> > + &dma_addr_for_skipped_frame,
> > + GFP_KERNEL);
> > +
> > + if (!addr_for_skipped_frame) {
> > + printk(KERN_WARNING "failed to allocate dma memory for
> > skipped frame");
> > + ret = -ENXIO;
> > + goto exit_iounmap;
> > + }
> > +
>
> I did not see a corresponding dma_free_coherent in your remove
> function.
>
> > ret = dma_declare_coherent_memory(&pdev->dev, start,
> > /* start, len - 640 * 480 *
> > 2, */
> > start, len,
> > @@ -3230,7 +3253,7 @@
> > if (!ret) {
> > dprintk(0, "failed to declare dma memory");
> > ret = -ENXIO;
> > - goto exit_iounmap;
> > + goto exit_dma_skipframe_release;
> > }
> > /* init device struct */
> > @@ -3298,6 +3321,9 @@
> > video_unregister_device(isp->vdev);
> > exit_dma_release:
> > dma_release_declared_memory(&pdev->dev);
> > +exit_dma_skipframe_release:
> > + dma_free_coherent(&pdev->dev, isp->mb1_size,
> > + addr_for_skipped_frame, dma_addr_for_skipped_frame);
> > exit_iounmap:
> > iounmap(isp->regs);
> > exit_release_regions:
> > Signed-off-by: Yong He <[email protected]>
>
> Why is this down here?
linux-2.6.37-camera-ov5640-ov9740-version-0.95_to_0.951.patch
Description: linux-2.6.37-camera-ov5640-ov9740-version-0.95_to_0.951.patch
_______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
