Re: soc-camera : sh_mobile_ceu_camera race on free_buffer ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Matthieu,

On Mon, Jan 19, 2009 at 11:02 PM, Matthieu CASTET
<matthieu.castet@xxxxxxxxxx> wrote:
> Hi,
>
> I am writing a soc camera driver, and I use sh_mobile_ceu_camera as an
> example.
>
> But I don't understand how buffer are handled when the application is
> doing a streamoff :
>
> streamoff will call videobuf_streamoff and then videobuf_queue_cancel.
> videobuf_queue_cancel will call free_buffer.
>
> But we didn't do stop_capture, so as far I understand the controller is
> still writing data in memory. What prevent us to free the buffer we are
> writing.

I have not looked into this in great detail, but isn't this handled by
the videobuf state? The videobuf has state VIDEOBUF_ACTIVE while it is
in use. I don't think such a buffer is freed.

> Why doesn't we do a stop_capture before videobuf_streamoff ?
>
> I saw that pxa_camera use videobuf_waiton, before freeing the buffer.
> That seem more safe, but that mean we need to wait that controller
> finish to write all the pending buffer.

Hm, but vivi.c does not use videbuf_waiton(). I guess this depends on
how the frames are queued in the driver.

Cheers,

/ magnus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

[Index of Archives]     [Linux Media]     [Older V4L]     [Linux DVB]     [Video Disk Recorder]     [Linux Kernel]     [Asterisk]     [DCCP]     [Netdev]     [X.org]     [Util Linux]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [SSH]     [DVB Maintainers]     [Linux USB]     [Yosemite Information]
  Powered by Linux