aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/platform/vimc/vimc-streamer.c
AgeCommit message (Collapse)AuthorFilesLines
2019-08-13media: Revert "media: vimc: propagate pixel format in the stream"Helen Koike1-2/+0
This reverts commit b6c61a6c37317efd7327199bfe24770af3d7e799. The requested pixelformat is being propagated from the capture to the tpg in the sensor. This was a bad design choice, as we start having the following issues: * We set a pixelformat in the capture; * We set matching media bus formats in the subdevices pads; * Link validate looks fine (sizes matches, media bus formats matches); * Issue: if some of the subdevice doesn't know how to generate the requested pixelformat in the capture, then stream_on fails. This is bad because capture says it supports that pixelformat, everything looks fine, but it is not, and there is no way to find it out through the links. This patch was implemented so we could request any pixelformat from the pipeline regardeless of the media bus format configured between pads. Not all pixelformat can be mapped into a media bus code (e.g. multiplanar formats), so with this patch we could request those pixelformats from the tpg. Solution: map pixelformats to media bus codes as before, and implement conversions to other pixelformats in the capture to support multiplanar. So first step to this solution is to revert this patch. Signed-off-by: Helen Koike <[email protected]> Signed-off-by: Lucas A. M. Magalhaes <[email protected]> Tested-by: André Almeida <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-07-23media: vimc: stream: format comments as kernel-docAndré Almeida1-14/+24
Format the current existing comments as kernel-doc comments, to be reused at kernel documention. Add opening marks (/**) and return values. Signed-off-by: André Almeida <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-06-21media: vimc: stream: add missing function documentationAndré Almeida1-0/+22
Add comments at vimc_streamer_s_stream and vimc_streamer_thread, making the vimc-stream totally documented. Signed-off-by: André Almeida <[email protected]> [[email protected]: fix typo: in a fixed framerate -> at a fixed framerate] [[email protected]: fix typo: stops the thread -> stop the thread] Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-06-21media: vimc: Makefile: file cleanupAndré Almeida1-4/+0
Remove redundant Makefile rules (vimc_capture-objs, ...). Stop exposing vimc-{common, streamer} as modules, since there's no use case where they would be individually added/removed from Vimc. As consequence, remove MODULE_ macros from vimc-{common, streamer}. `-objs` is fitted for building host programs, change to `-y`, more straightforward for device drivers. Signed-off-by: André Almeida <[email protected]> Suggested-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-04-22media: vimc: propagate pixel format in the streamHelen Fornazier1-0/+2
Media bus codes were being mapped to pixelformats, which causes a limitation on vimc because not all pixelformats can be mapped to media bus codes. Also, media bus codes are an internal configuration from the device. Userspace only assures media bus codes matches between pads and expects the image in a given pixelformat. So we can allow almost any media bus format to be configured between pads, except for debayer that expects a media bus code of type bayer in the sink pad. [[email protected]: drop use of v4l2_get_fourcc_name: not yet available] [[email protected]: made vimc_mbus_list static] Signed-off-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-03-19media: vimc: stream: init/terminate the first entityHelen Fornazier1-10/+16
The s_stream callback was not being called for the first entity in the stream pipeline array. Instead of verifying the type of the node (video or subdevice) and calling s_stream from the second entity in the pipeline, do this process for all the entities in the pipeline for consistency. The previous code was not a problem because the first entity is a video device and not a subdevice, but this patch prepares vimc to allow setting some configuration in the entity before calling s_stream. Signed-off-by: Helen Koike <[email protected]> Tested-by: André Almeida <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [[email protected]: fix line-too-long warning] Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-03-19media: vimc: stream: cleanup frame field from struct vimc_streamHelen Fornazier1-6/+4
There is no need to have the frame field in the vimc_stream struct. Signed-off-by: Helen Koike <[email protected]> Tested-by: André Almeida <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-03-19media: vimc: stream: fix thread state before sleepHelen Fornazier1-1/+1
The state TASK_UNINTERRUPTIBLE should be set just before schedule_timeout() call, so it knows the sleep mode it should enter. There is no point in setting TASK_UNINTERRUPTIBLE at the initialization of the thread as schedule_timeout() will set the state back to TASK_RUNNING. This fixes a warning in __might_sleep() call, as it's expecting the task to be in TASK_RUNNING state just before changing the state to a sleeping state. Reported-by: Hans Verkuil <[email protected]> Signed-off-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2019-02-07media: vimc: Add vimc-streamer for stream controlLucas A. M. Magalhães1-0/+188
Add a linear pipeline logic for the stream control. It's created by walking backwards on the entity graph. When the stream starts it will simply loop through the pipeline calling the respective process_frame function of each entity. Fixes: f2fe89061d797 ("vimc: Virtual Media Controller core, capture and sensor") Cc: [email protected] # for v4.20 Signed-off-by: Lucas A. M. Magalhães <[email protected]> Acked-by: Helen Koike <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [[email protected]: fixed small space-after-tab issue in the patch] Signed-off-by: Mauro Carvalho Chehab <[email protected]>