* [PATCH] pxa_camera: move fifo reset direct before dma start
@ 2010-04-20 6:51 Stefan Herbrechtsmeier
2010-04-20 7:06 ` Guennadi Liakhovetski
0 siblings, 1 reply; 5+ messages in thread
From: Stefan Herbrechtsmeier @ 2010-04-20 6:51 UTC (permalink / raw)
To: linux-media; +Cc: g.liakhovetski, jic23, Stefan Herbrechtsmeier
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>
---
drivers/media/video/pxa_camera.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 5ecc30d..04bf5c1 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -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)
{
- unsigned long cicr0, cifr;
+ unsigned long cicr0;
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 */
cicr0 = __raw_readl(pcdev->base + CICR0) | CICR0_ENB;
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)
{
struct pxa_camera_dev *pcdev = data;
- unsigned long status, cicr0;
+ unsigned long status, cifr, cicr0;
struct pxa_buffer *buf;
struct videobuf_buffer *vb;
@@ -949,6 +946,10 @@ static irqreturn_t pxa_camera_irq(int irq, void *data)
__raw_writel(status, pcdev->base + CISR);
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,
struct pxa_buffer, vb.queue);
vb = &pcdev->active->vb;
--
1.5.4.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] pxa_camera: move fifo reset direct before dma start
2010-04-20 6:51 [PATCH] pxa_camera: move fifo reset direct before dma start Stefan Herbrechtsmeier
@ 2010-04-20 7:06 ` Guennadi Liakhovetski
2010-04-20 17:36 ` Robert Jarzmik
0 siblings, 1 reply; 5+ messages in thread
From: Guennadi Liakhovetski @ 2010-04-20 7:06 UTC (permalink / raw)
To: Stefan Herbrechtsmeier; +Cc: Linux Media Mailing List, jic23, Robert Jarzmik
Robert, what do you think? Are you still working with PXA camera?
Thanks
Guennadi
On Tue, 20 Apr 2010, Stefan Herbrechtsmeier wrote:
> 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>
> ---
> drivers/media/video/pxa_camera.c | 11 ++++++-----
> 1 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
> index 5ecc30d..04bf5c1 100644
> --- a/drivers/media/video/pxa_camera.c
> +++ b/drivers/media/video/pxa_camera.c
> @@ -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)
> {
> - unsigned long cicr0, cifr;
> + unsigned long cicr0;
>
> 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 */
> cicr0 = __raw_readl(pcdev->base + CICR0) | CICR0_ENB;
> 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)
> {
> struct pxa_camera_dev *pcdev = data;
> - unsigned long status, cicr0;
> + unsigned long status, cifr, cicr0;
> struct pxa_buffer *buf;
> struct videobuf_buffer *vb;
>
> @@ -949,6 +946,10 @@ static irqreturn_t pxa_camera_irq(int irq, void *data)
> __raw_writel(status, pcdev->base + CISR);
>
> 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,
> struct pxa_buffer, vb.queue);
> vb = &pcdev->active->vb;
> --
> 1.5.4.3
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pxa_camera: move fifo reset direct before dma start
2010-04-20 7:06 ` Guennadi Liakhovetski
@ 2010-04-20 17:36 ` Robert Jarzmik
2010-04-21 10:06 ` Antonio Ospite
0 siblings, 1 reply; 5+ messages in thread
From: Robert Jarzmik @ 2010-04-20 17:36 UTC (permalink / raw)
To: Guennadi Liakhovetski
Cc: Stefan Herbrechtsmeier, Linux Media Mailing List, jic23
Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:
> Robert, what do you think? Are you still working with PXA camera?
Hi Guennadi,
Yes, I'm still working with pxa_camera :)
About the patch, I have a very good feeling about it. I have not tested it, but
it looks good to me. I'll assume Stefan has tested it, and if you want it,
please take my :
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Cheers.
--
Robert
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pxa_camera: move fifo reset direct before dma start
2010-04-20 17:36 ` Robert Jarzmik
@ 2010-04-21 10:06 ` Antonio Ospite
2010-04-21 11:20 ` Jonathan Cameron
0 siblings, 1 reply; 5+ messages in thread
From: Antonio Ospite @ 2010-04-21 10:06 UTC (permalink / raw)
To: Robert Jarzmik
Cc: Guennadi Liakhovetski, Stefan Herbrechtsmeier,
Linux Media Mailing List, jic23
[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]
On Tue, 20 Apr 2010 19:36:13 +0200
Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:
>
> > Robert, what do you think? Are you still working with PXA camera?
> Hi Guennadi,
>
> Yes, I'm still working with pxa_camera :)
>
> About the patch, I have a very good feeling about it. I have not tested it, but
> it looks good to me. I'll assume Stefan has tested it, and if you want it,
> please take my :
> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
>
FWIW,
Tested-by: Antonio Ospite <ospite@studenti.unina.it>
It works on Motorola A780: pxa_camera + mt9m111
The first picture is now ok.
Thanks Stefan.
Ciao ciao,
Antonio
--
Antonio Ospite
http://ao2.it
PGP public key ID: 0x4553B001
A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] pxa_camera: move fifo reset direct before dma start
2010-04-21 10:06 ` Antonio Ospite
@ 2010-04-21 11:20 ` Jonathan Cameron
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Cameron @ 2010-04-21 11:20 UTC (permalink / raw)
To: Antonio Ospite
Cc: Robert Jarzmik, Guennadi Liakhovetski, Stefan Herbrechtsmeier,
Linux Media Mailing List
On 04/21/10 11:06, Antonio Ospite wrote:
> On Tue, 20 Apr 2010 19:36:13 +0200
> Robert Jarzmik <robert.jarzmik@free.fr> wrote:
>
>> Guennadi Liakhovetski <g.liakhovetski@gmx.de> writes:
>>
>>> Robert, what do you think? Are you still working with PXA camera?
>> Hi Guennadi,
>>
>> Yes, I'm still working with pxa_camera :)
>>
>> About the patch, I have a very good feeling about it. I have not tested it, but
>> it looks good to me. I'll assume Stefan has tested it, and if you want it,
>> please take my :
>> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
>>
>
> FWIW,
> Tested-by: Antonio Ospite <ospite@studenti.unina.it>
>
> It works on Motorola A780: pxa_camera + mt9m111
> The first picture is now ok.
>
> Thanks Stefan.
>
> Ciao ciao,
> Antonio
>
Excellent, I'm not in a position to test right now, but glad
to see this issue cleaned up.
Jonathan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-04-21 11:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-20 6:51 [PATCH] pxa_camera: move fifo reset direct before dma start Stefan Herbrechtsmeier
2010-04-20 7:06 ` Guennadi Liakhovetski
2010-04-20 17:36 ` Robert Jarzmik
2010-04-21 10:06 ` Antonio Ospite
2010-04-21 11:20 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox