public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Markus Niebel <list-09_linux_media@tqsc.de>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: mx3_camera and DMA / double buffering
Date: Mon, 17 Jan 2011 18:28:11 +0100	[thread overview]
Message-ID: <4D347C2B.5070200@tqsc.de> (raw)
In-Reply-To: <Pine.LNX.4.64.1101171724360.16051@axis700.grange>

Am 17.01.2011 17:27, schrieb Guennadi Liakhovetski:
> On Mon, 17 Jan 2011, Markus Niebel wrote:
>
>> Hello,
>>
>> sorry for the __very__ long timeout. The doublebuffering is indeed enabled
>> when the second buffer is queued - my fault, should have read the code more
>> carfully.
>
> Good.
>
>> But in this way a new question arises:
>>
>> in soc_camera.c, function soc_camera_streamon the subdev's s_stream handler is
>> called first before videobuf_streamon gets called. This way the videosource is
>> producing data which could produce a race condition with the idmac.
>
> Starting the sensor before the host shouldn't cause any problems, because
> hosts should be capable of handling sensors, continuously streaming data.
> So, the order should be ok, if the mx3-camera driver gets problems with
> it, it has a bug and it should be fixed.
>
>> Maybe I'm
>> wrong but in some cases (especially whith enabled dev_dbg in ipu_idmac.c) we
>> fail to get frames from the driver.
>
> Sorry, what exactly do you mean? Capture doesn't start at all? Or it
> begins and then hangs? Or some fraims get dropped? Please, explain in more
> detail.
>
> Thanks
> Guennadi
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Hello,

we see messages like this (with more logging output at higher possibility):

[   24.260000] dma dma0chan7: IDMAC irq 177, buf 1
[   24.260000] dma dma0chan7: IRQ on active buffer on channel 7, active 
1, ready 0, 0, current 80!

and calls from an application to select times out

when changing the order of calls in soc_camera_streamon 
(videobuf_streamon before v4l2_subdev_call(sd, video, s_stream, 1)
images always can be captured.

My assumption for the reason is based on the following:

1) Since CSI is enabled by idmac in ipu_init_channel, mx3_camera has no 
control over the data flow. As soon as the first buffer is queued with 
idmac it will filled - my thoughts are that this can interfere with the 
initial setup during submission of the first two buffers.

2) The freescale sample code (mxc_camera.c, not in mainline) enables the 
CSI after channel and buffers are configured.

Thanks
Markus


      reply	other threads:[~2011-01-17 17:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4CF7AE4A.7070107@tqsc.de>
     [not found] ` <Pine.LNX.4.64.1012022103270.26762@axis700.grange>
     [not found]   ` <4CF91228.3030709@tqsc.de>
     [not found]     ` <Pine.LNX.4.64.1012032105200.5693@axis700.grange>
2011-01-17 15:34       ` mx3_camera and DMA / double buffering Markus Niebel
2011-01-17 16:27         ` Guennadi Liakhovetski
2011-01-17 17:28           ` Markus Niebel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D347C2B.5070200@tqsc.de \
    --to=list-09_linux_media@tqsc.de \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox