Skip to content

Commit a47f6be

Browse files
Stefan HerbrechtsmeierMauro Carvalho Chehab
authored andcommitted
V4L/DVB: pxa_camera: move fifo reset direct before dma start
Move the fifo reset from pxa_camera_start_capture to pxa_camera_irq direct before the dma start after an end of frame interrupt to prevent images from shifting because of old data at the begin of the frame. Signed-off-by: Stefan Herbrechtsmeier <hbmeier@hni.uni-paderborn.de> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Tested-by: Antonio Ospite <ospite@studenti.unina.it> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1 parent 981cbef commit a47f6be

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/media/video/pxa_camera.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -609,12 +609,9 @@ static void pxa_dma_add_tail_buf(struct pxa_camera_dev *pcdev,
609609
*/
610610
static void pxa_camera_start_capture(struct pxa_camera_dev *pcdev)
611611
{
612-
unsigned long cicr0, cifr;
612+
unsigned long cicr0;
613613

614614
dev_dbg(pcdev->soc_host.v4l2_dev.dev, "%s\n", __func__);
615-
/* Reset the FIFOs */
616-
cifr = __raw_readl(pcdev->base + CIFR) | CIFR_RESET_F;
617-
__raw_writel(cifr, pcdev->base + CIFR);
618615
/* Enable End-Of-Frame Interrupt */
619616
cicr0 = __raw_readl(pcdev->base + CICR0) | CICR0_ENB;
620617
cicr0 &= ~CICR0_EOFM;
@@ -935,7 +932,7 @@ static void pxa_camera_deactivate(struct pxa_camera_dev *pcdev)
935932
static irqreturn_t pxa_camera_irq(int irq, void *data)
936933
{
937934
struct pxa_camera_dev *pcdev = data;
938-
unsigned long status, cicr0;
935+
unsigned long status, cifr, cicr0;
939936
struct pxa_buffer *buf;
940937
struct videobuf_buffer *vb;
941938

@@ -949,6 +946,10 @@ static irqreturn_t pxa_camera_irq(int irq, void *data)
949946
__raw_writel(status, pcdev->base + CISR);
950947

951948
if (status & CISR_EOF) {
949+
/* Reset the FIFOs */
950+
cifr = __raw_readl(pcdev->base + CIFR) | CIFR_RESET_F;
951+
__raw_writel(cifr, pcdev->base + CIFR);
952+
952953
pcdev->active = list_first_entry(&pcdev->capture,
953954
struct pxa_buffer, vb.queue);
954955
vb = &pcdev->active->vb;

0 commit comments

Comments
 (0)