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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
981cbef2c3
commit
a47f6be456
@@ -609,12 +609,9 @@ static void pxa_dma_add_tail_buf(struct pxa_camera_dev *pcdev,
|
|||||||
*/
|
*/
|
||||||
static void pxa_camera_start_capture(struct pxa_camera_dev *pcdev)
|
static void pxa_camera_start_capture(struct pxa_camera_dev *pcdev)
|
||||||
{
|
{
|
||||||
unsigned long cicr0, cifr;
|
unsigned long cicr0;
|
||||||
|
|
||||||
dev_dbg(pcdev->soc_host.v4l2_dev.dev, "%s\n", __func__);
|
dev_dbg(pcdev->soc_host.v4l2_dev.dev, "%s\n", __func__);
|
||||||
/* Reset the FIFOs */
|
|
||||||
cifr = __raw_readl(pcdev->base + CIFR) | CIFR_RESET_F;
|
|
||||||
__raw_writel(cifr, pcdev->base + CIFR);
|
|
||||||
/* Enable End-Of-Frame Interrupt */
|
/* Enable End-Of-Frame Interrupt */
|
||||||
cicr0 = __raw_readl(pcdev->base + CICR0) | CICR0_ENB;
|
cicr0 = __raw_readl(pcdev->base + CICR0) | CICR0_ENB;
|
||||||
cicr0 &= ~CICR0_EOFM;
|
cicr0 &= ~CICR0_EOFM;
|
||||||
@@ -935,7 +932,7 @@ static void pxa_camera_deactivate(struct pxa_camera_dev *pcdev)
|
|||||||
static irqreturn_t pxa_camera_irq(int irq, void *data)
|
static irqreturn_t pxa_camera_irq(int irq, void *data)
|
||||||
{
|
{
|
||||||
struct pxa_camera_dev *pcdev = data;
|
struct pxa_camera_dev *pcdev = data;
|
||||||
unsigned long status, cicr0;
|
unsigned long status, cifr, cicr0;
|
||||||
struct pxa_buffer *buf;
|
struct pxa_buffer *buf;
|
||||||
struct videobuf_buffer *vb;
|
struct videobuf_buffer *vb;
|
||||||
|
|
||||||
@@ -949,6 +946,10 @@ static irqreturn_t pxa_camera_irq(int irq, void *data)
|
|||||||
__raw_writel(status, pcdev->base + CISR);
|
__raw_writel(status, pcdev->base + CISR);
|
||||||
|
|
||||||
if (status & CISR_EOF) {
|
if (status & CISR_EOF) {
|
||||||
|
/* Reset the FIFOs */
|
||||||
|
cifr = __raw_readl(pcdev->base + CIFR) | CIFR_RESET_F;
|
||||||
|
__raw_writel(cifr, pcdev->base + CIFR);
|
||||||
|
|
||||||
pcdev->active = list_first_entry(&pcdev->capture,
|
pcdev->active = list_first_entry(&pcdev->capture,
|
||||||
struct pxa_buffer, vb.queue);
|
struct pxa_buffer, vb.queue);
|
||||||
vb = &pcdev->active->vb;
|
vb = &pcdev->active->vb;
|
||||||
|
Reference in New Issue
Block a user