From: Matthieu CASTET <matthieu.castet@parrot.com>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: video4linux-list@redhat.com,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Subject: Re: soc-camera : sh_mobile_ceu_camera race on free_buffer ?
Date: Tue, 20 Jan 2009 10:27:09 +0100 [thread overview]
Message-ID: <497598ED.3050502@parrot.com> (raw)
In-Reply-To: <aec7e5c30901192046j1a595day51da698181d034e5@mail.gmail.com>
Hi Magnus,
Magnus Damm a écrit :
> Hi Matthieu,
>
> On Mon, Jan 19, 2009 at 11:02 PM, Matthieu CASTET
>> 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.
Well from my understanding form videobuf_queue_cancel [1], we call
buf_release on all buffer.
>> 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.
May be.
Matthieu
[1]
void videobuf_queue_cancel(struct videobuf_queue *q)
{
unsigned long flags = 0;
int i;
q->streaming = 0;
q->reading = 0;
wake_up_interruptible_sync(&q->wait);
/* remove queued buffers from list */
spin_lock_irqsave(q->irqlock, flags);
for (i = 0; i < VIDEO_MAX_FRAME; i++) {
if (NULL == q->bufs[i])
continue;
if (q->bufs[i]->state == VIDEOBUF_QUEUED) {
list_del(&q->bufs[i]->queue);
q->bufs[i]->state = VIDEOBUF_ERROR;
wake_up_all(&q->bufs[i]->done);
}
}
spin_unlock_irqrestore(q->irqlock, flags);
/* free all buffers + clear queue */
for (i = 0; i < VIDEO_MAX_FRAME; i++) {
if (NULL == q->bufs[i])
continue;
q->ops->buf_release(q, q->bufs[i]);
}
INIT_LIST_HEAD(&q->stream);
}
--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
next prev parent reply other threads:[~2009-01-20 9:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-19 14:02 soc-camera : sh_mobile_ceu_camera race on free_buffer ? Matthieu CASTET
2009-01-20 4:46 ` Magnus Damm
2009-01-20 9:27 ` Matthieu CASTET [this message]
2009-02-13 10:14 ` Magnus Damm
2009-02-16 1:07 ` morimoto.kuninori
2009-02-18 18:51 ` Guennadi Liakhovetski
2009-02-19 1:01 ` morimoto.kuninori
2009-02-19 7:29 ` Guennadi Liakhovetski
2009-02-19 8:07 ` morimoto.kuninori
2009-02-19 8:33 ` Guennadi Liakhovetski
2009-02-19 9:30 ` morimoto.kuninori
2009-02-19 9:51 ` Guennadi Liakhovetski
2009-02-19 23:56 ` morimoto.kuninori
2009-02-18 18:56 ` Guennadi Liakhovetski
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=497598ED.3050502@parrot.com \
--to=matthieu.castet@parrot.com \
--cc=g.liakhovetski@gmx.de \
--cc=magnus.damm@gmail.com \
--cc=video4linux-list@redhat.com \
/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