Message ID | 20190617133221.21246-1-andrealmeid@collabora.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v3,1/2] media: vimc: stream: add missing function documentation | expand |
Em Mon, 17 Jun 2019 10:32:20 -0300 André Almeida <andrealmeid@collabora.com> escreveu: > Add comments at vimc_streamer_s_stream and vimc_streamer_thread, making > the vimc-stream totally documented. I'm applying it right now. Yet, if this is fully documented, IMO you should add it to Documentation/media/v4l-drivers, replacing the comments to kernel-doc markups. That would make easier for the ones to read the comments and, if someone changes a function call, warnings will be produced, and the developer will be warned. Thanks, Mauro
Hello Mauro, On 6/21/19 6:17 PM, Mauro Carvalho Chehab wrote: > Em Mon, 17 Jun 2019 10:32:20 -0300 > André Almeida <andrealmeid@collabora.com> escreveu: > >> Add comments at vimc_streamer_s_stream and vimc_streamer_thread, making >> the vimc-stream totally documented. > I'm applying it right now. > > Yet, if this is fully documented, IMO you should add it to > Documentation/media/v4l-drivers, replacing the comments to kernel-doc > markups. This suggestion is a great improvement and it's simple to apply to the source. Where do you believe we can place this at[1]? Maybe something like Source code documentation ------------------------- vimc-streamer ~~~~~~~~~~~~ .. kernel-doc:: drivers/media/platform/vimc/vimc-streamer.c :internal: at the end of the file? > That would make easier for the ones to read the comments and, if someone > changes a function call, warnings will be produced, and the developer > will be warned. > Thanks, > Mauro Thanks, André [1] https://git.linuxtv.org/media_tree.git/tree/Documentation/media/v4l-drivers/vimc.rst
Em Sat, 22 Jun 2019 18:51:06 -0300 André Almeida <andrealmeid@collabora.com> escreveu: > Hello Mauro, > > On 6/21/19 6:17 PM, Mauro Carvalho Chehab wrote: > > Em Mon, 17 Jun 2019 10:32:20 -0300 > > André Almeida <andrealmeid@collabora.com> escreveu: > > > >> Add comments at vimc_streamer_s_stream and vimc_streamer_thread, making > >> the vimc-stream totally documented. > > I'm applying it right now. > > > > Yet, if this is fully documented, IMO you should add it to > > Documentation/media/v4l-drivers, replacing the comments to kernel-doc > > markups. > > This suggestion is a great improvement and it's simple to apply to the > source. Where do you believe we can place this at[1]? Maybe something like > > > Source code documentation > ------------------------- > > vimc-streamer > ~~~~~~~~~~~~ > > .. kernel-doc:: drivers/media/platform/vimc/vimc-streamer.c > :internal: > > > at the end of the file? > Yeah, this should be enough. > > That would make easier for the ones to read the comments and, if someone > > changes a function call, warnings will be produced, and the developer > > will be warned. > > Thanks, > > Mauro > > Thanks, > André > > [1] > https://git.linuxtv.org/media_tree.git/tree/Documentation/media/v4l-drivers/vimc.rst > Thanks, Mauro
diff --git a/drivers/media/platform/vimc/vimc-streamer.c b/drivers/media/platform/vimc/vimc-streamer.c index 236ade38f1da..1fea6d666c2e 100644 --- a/drivers/media/platform/vimc/vimc-streamer.c +++ b/drivers/media/platform/vimc/vimc-streamer.c @@ -122,6 +122,14 @@ static int vimc_streamer_pipeline_init(struct vimc_stream *stream, return -EINVAL; } +/* + * vimc_streamer_thread - process frames through the pipeline + * + * @data: vimc_stream struct of the current stream + * + * From the source to the sink, gets a frame from each subdevice and send to + * the next one of the pipeline in a fixed framerate. + */ static int vimc_streamer_thread(void *data) { struct vimc_stream *stream = data; @@ -149,6 +157,20 @@ static int vimc_streamer_thread(void *data) return 0; } +/* + * vimc_streamer_s_stream - start/stop the streaming on the media pipeline + * + * @stream: the pointer to the stream structure of the current stream + * @ved: pointer to the vimc entity of the entity of the stream + * @enable: flag to determine if stream should start/stop + * + * When starting, check if there is no stream->kthread allocated. This should + * indicate that a streaming is already running. Then, it initializes + * the pipeline, creates and runs a kthread to consume buffers through the + * pipeline. + * When stopping, analogously check if there is a stream running, stops + * the thread and terminates the pipeline. + */ int vimc_streamer_s_stream(struct vimc_stream *stream, struct vimc_ent_device *ved, int enable)
Add comments at vimc_streamer_s_stream and vimc_streamer_thread, making the vimc-stream totally documented. Signed-off-by: André Almeida <andrealmeid@collabora.com> --- Changes in v3: replace "streaming" by "stream" at vimc_streamer_thread(). Changes in v2: fix typos drivers/media/platform/vimc/vimc-streamer.c | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+)