public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "Figo.zhang" <zhangtianfei@leadcoretech.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Andrew Chew <AChew@nvidia.com>,
	"'linux-media@vger.kernel.org'" <linux-media@vger.kernel.org>,
	Marek Szyprowski <m.szyprowski@samsung.com>
Subject: Re: Allocating videobuf_buffer, but lists not being initialized
Date: Tue, 16 Nov 2010 16:01:06 +0800	[thread overview]
Message-ID: <4CE23A42.1090101@leadcoretech.com> (raw)
In-Reply-To: <201011160837.32797.hverkuil@xs4all.nl>

于 11/16/2010 03:37 PM, Hans Verkuil 写道:
> On Tuesday, November 16, 2010 02:10:39 Andrew Chew wrote:
>> I'm looking at drivers/media/video/videobuf-dma-contig.c's __videobuf_alloc() routine.  We call kzalloc() to allocate the videobuf_buffer.  However, I don't see where the two lists (vb->stream and vb->queue) that are a part of struct videobuf_buffer get initialized (with, say, INIT_LIST_HEAD).
>
> Yuck. The videobuf framework doesn't initialize vb-stream at all. It relies on
> list_add_tail to effectively initialize it for it. It works, but it is not
> exactly clean programming :-(
>
> The vb->queue list has to be initialized in the driver. Never understood the
> reason for that either.
>
> Marek, can you make sure that videobuf2 will initialize these lists correctly?
> That is, vb2 should do this initialization instead of the driver.

vb2 have init the list :
	INIT_LIST_HEAD(&q->queued_list);
	INIT_LIST_HEAD(&q->done_list);

btw, "queued_list" re-name "grabbing_list" is better?





  parent reply	other threads:[~2010-11-16  8:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <643E69AA4436674C8F39DCC2C05F763816BB828A36@HQMAIL03.nvidia.com>
2010-11-16  1:10 ` Allocating videobuf_buffer, but lists not being initialized Andrew Chew
2010-11-16  5:29   ` Pawel Osciak
2010-11-16  7:40     ` Hans Verkuil
2010-11-16  7:58       ` Figo.zhang
2010-11-16  7:37   ` Hans Verkuil
2010-11-16  7:48     ` Hans Verkuil
2010-11-16  8:01     ` Figo.zhang [this message]
2010-11-16 10:10     ` Marek Szyprowski

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=4CE23A42.1090101@leadcoretech.com \
    --to=zhangtianfei@leadcoretech.com \
    --cc=AChew@nvidia.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.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