- 25 May, 2023 40 commits
-
-
Su Hui authored
No need cast (void*) to (struct dst_state *), (struct cx18_stream *), (struct saa7164_port *) or (struct budget *). Signed-off-by: Su Hui <suhui@nfschina.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Su Hui authored
No need cast (void*) to (struct stdemux *),(struct hva_h264_ctx *) or (struct hva_h264_task *). Signed-off-by: Su Hui <suhui@nfschina.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Su Hui authored
No need cast (void*) to (struct dvb_usb_device *) or (struct filter_info *). Signed-off-by: Su Hui <suhui@nfschina.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: drop the obsolete dvb-usb/az6027.c and dvb-usb/pctv452e.c changes]
-
Lukas Bulwahn authored
Commit dfb9f94e ("[media] stk1160: Build as a module if SND is m and audio support is selected") had to introduce some complex config dependency handling to compile for all combinations of configs VIDEO_STK1160 and VIDEO_STK1160_AC97. Later, commit e36e6b5f ("[media] stk1160: Remove stk1160-mixer and setup internal AC97 codec automatically") removes the config VIDEO_STK1160_AC97, which renders the previous dependency handling unnecessary. The commit already simplified the dependency of the remaining config VIDEO_STK1160, but it misses the opportunity to merge VIDEO_STK1160 and VIDEO_STK1160_COMMON. So, do that now and simplify the build config definition of the STK1160 USB video capture support. Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Ming Qian authored
The last buffer from before the change must be marked with the V4L2_BUF_FLAG_LAST flag, similarly to the Drain sequence above. initiate a drain of the capture queue in dynamic resolution change Fixes: 6de8d628 ("media: amphion: add v4l2 m2m vpu decoder stateful driver") Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Alexander Stein authored
This prints all register values. Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Daniel Lundberg Pedersen authored
The pointer types of p_s32 and p_s64 in v4l2_ext_control has been updated, match the change in documentation. Signed-off-by: Daniel Lundberg Pedersen <dlp@qtec.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Daniel Lundberg Pedersen authored
Use the intended pointer types for p_s32 and p_64 in the union of the struct v4l2_ext_control. Fixes: e77eb663 ("videodev2.h: add p_s32 and p_s64 pointers") Signed-off-by: Daniel Lundberg Pedersen <dlp@qtec.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Bryan O'Donoghue authored
I'd like to be looped in on changes to venus so that I can help ensure no obvious regressions creep in. I'm happy to run some simple tests for venus on the hardware I have access to - db410c - db820 - rb3 - rb5 and one of rb1 / rb2 in the future when they are delivered. Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Christophe JAILLET authored
Commit in Fixes turned a BUG() into a "normal" memory allocation failure. While at it, it introduced a memory leak. So fix it. Also update the comment on top of the function to reflect what has been change by the commit in Fixes. Fixes: 40e986c9 ("media: common: saa7146: replace BUG_ON by WARN_ON") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Nícolas F. R. A. Prado authored
This reverts commit cd61f3c6. That commit's purpose was to prevent the padding from being decoded when userspace didn't set a selection, relying on the default one. However, as described in the Step 6 of the Initialization procedure for the Memory-to-Memory Stateful Video Encoder Interface [1]: "Set the visible resolution for the stream metadata via VIDIOC_S_SELECTION() on the OUTPUT queue if it is desired to be different than the full OUTPUT resolution." And from the Note: "To avoid encoding the padding, the client needs to explicitly configure this selection target" Hence the behavior in the original commit doesn't follow the interface and needs to be reverted. This fixes the following v4l2-compliance failure observed on mt8192-asurada-spherion: fail: v4l2-test-formats.cpp(924): sel.r.width != fmt.g_width() test VIDIOC_S_FMT: FAIL [1] https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/dev-encoder.html#initializationSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Yunfei Dong authored
Getting below error when using KCSAN to check the driver. Adding lock to protect parameter num_rdy when getting the value with function: v4l2_m2m_num_src_bufs_ready/v4l2_m2m_num_dst_bufs_ready. kworker/u16:3: [name:report&]BUG: KCSAN: data-race in v4l2_m2m_buf_queue kworker/u16:3: [name:report&] kworker/u16:3: [name:report&]read-write to 0xffffff8105f35b94 of 1 bytes by task 20865 on cpu 7: kworker/u16:3: v4l2_m2m_buf_queue+0xd8/0x10c Signed-off-by: Pina Chen <pina.chen@mediatek.com> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Max Staudt authored
This adds an option for higher frame rates from a simulated webcam. Currently, vivid emulates (amongst other things) a webcam with somewhat limited bandwidth - higher resolutions deliver fewer frames per second. $ yavta --enum-formats -c /dev/video0 Device /dev/video0 opened. Device `vivid' on `platform:vivid-000' (driver 'vivid') supports video, capture, without mplanes. - Available formats: Format 0: YUYV (56595559) Type: Video capture (1) Name: YUYV 4:2:2 Frame size: 320x180 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60) Frame size: 640x360 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40) Frame size: 640x480 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25) Frame size: 1280x720 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25) Frame size: 1920x1080 (1/1, 1/2, 1/4, 1/5) Frame size: 3840x2160 (1/1, 1/2) In some test cases, it is useful to allow for higher frame rates, as configurations such as 720p@30 FPS have become commonplace now. This patch allows: 0- 719p - 120fps 720-1079p - 60fps 1080-2159p - 30fps 2160p - 15fps $ yavta --enum-formats -c /dev/video0 Device /dev/video0 opened. Device `vivid' on `platform:vivid-000' (driver 'vivid') supports video, capture, without mplanes. - Available formats: Format 0: YUYV (56595559) Type: Video capture (1) Name: YUYV 4:2:2 Frame size: 320x180 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60, 1/120) Frame size: 640x360 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60, 1/120) Frame size: 640x480 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60, 1/120) Frame size: 1280x720 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30, 1/40, 1/50, 1/60) Frame size: 1920x1080 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15, 1/25, 1/30) Frame size: 3840x2160 (1/1, 1/2, 1/4, 1/5, 1/10, 2/25, 1/15) Passes: v4l2-compliance 1.25.0-5039 from v4l-utils git ccc08732823f Signed-off-by: Max Staudt <mstaudt@chromium.org> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: unsigned -> unsigned int]
-
Ming Qian authored
For format V4L2_PIX_FMT_VC1_ANNEX_G, the separate codec data is required only once. The repeated codec data may introduce some decoding error. so drop the repeated codec data. It's amphion vpu's limitation Fixes: e670f5d6 ("media: amphion: only insert the first sequence startcode for vc1l format") Signed-off-by: Ming Qian <ming.qian@nxp.com> Tested-by: xiahong.bao <xiahong.bao@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Ming Qian authored
For format V4L2_PIX_FMT_VC1_ANNEX_L, the codec data is replaced with startcode, and then driver drop it, otherwise it may led to decoding error. It's amphion vpu's limitation Driver has dropped the first codec data, but need to drop the repeated codec data too. Fixes: e670f5d6 ("media: amphion: only insert the first sequence startcode for vc1l format") Signed-off-by: Ming Qian <ming.qian@nxp.com> Tested-by: xiahong.bao <xiahong.bao@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Angel Alberto Carretero authored
Conform to kernel coding style by wrapping macro in parenthesis. Issue found by checkpatch. Signed-off-by: Angel Alberto Carretero <angelalbertoc.r@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Benjamin Gaignard authored
Rework allocation errors cases handling to simply it by removing useless tests. Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reported-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Daniil Dulov authored
If az6007_read() returns error, there is no sence to continue. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 3af2f4f1 ("[media] az6007: Change the az6007 read/write routine parameter") Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Deepak R Varma authored
The iterator for_each_child_of_node() increments the refcount of the child node it is processing. Release such a reference when the loop needs to break due to an error during its execution. Issue identified using for_each_child.cocci Coccinelle semantic patch. Signed-off-by: Deepak R Varma <drv@mailo.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Lad Prabhakar authored
Fix the below error reported by checkpatch: ERROR: Macros with complex values should be enclosed in parentheses CSIDPHYSKW0_UTIL_DL1_SKW_ADJ(1) | \ CSIDPHYSKW0_UTIL_DL2_SKW_ADJ(1) | \ CSIDPHYSKW0_UTIL_DL3_SKW_ADJ(1) Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
The VI peripheral of Tegra supports capturing from MIPI CSI-2 or parallel video (called VIP in the docs). The staging tegra-video driver currently implements MIPI CSI-2 video capture for Tegra210. Add support for parallel video capture (VIP) on Tegra20. With the generalizations added to the VI driver in previous commits, this is only a matter of adding the vip.c and tegra20.c implementations and registering them. Unfortunately there was no documentation available for the VI or VIP peripherals of Tegra20 (or any other Tegra chips). This implementation has been based entirely on the code from a vendor kernel based on Linux 3.1 and massively adapted to fit into the tegra-video driver. Parts of this code is definitely non-optimal to say the least (especially tegra20_vi_enable() and the single-frame capture logic), but it was impossible to improve it. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: fix host1x_client_unregister usage: it's now a void func]
-
Luca Ceresoli authored
Tegra20 can do horizontal and vertical image flip, but Tegra210 cannot (either the hardware, or this driver). In preparation to adding Tegra20 support, add a flag in struct tegra_vi_soc so the generic vi.c code knows whether the flip controls should be added or not. Also provide a generic implementation that simply sets two flags in the channel struct. The Tegra20 implementation will enable flipping at stream start based on those flags. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
Tegra20 supports planar YUV422 capture, which can be implemented by writing U and V base address registers in addition to the "main" base buffer address register. It also supports H and V flip, which among others requires to write the start address (i.e. the 1st offset to write, at the end of the buffer or line) in more registers for Y and, for planar formats, U and V. Add minimal hooks in VI to allow per-SoC optional support to those features: - variables in struct tegra_vi for the U and V buffer base offsets - variables in struct tegra_vi for the Y, U and V buffer start offsets - an optional per-soc VI operation to compute those values on queue setup Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
In preparation to implement Tegra20 parallel video capture, add a variable to hold the required syncpt and document all the syncpt variables. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
tegra_channel_host1x_syncpt_init() gets the host1x syncpts needed for the Tegra210 implementation, and tegra_channel_host1x_syncpts_free() puts them. Tegra20 needs to get and put a different syncpt. In preparation for adding Tegra20 support, move these functions to new ops in the soc-specific `struct tegra_vi_ops` . No functional changes. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
The Tegra20 VI needs an additional operation to enable the VI, add an operation for that. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
The CSI module does not handle all the MIPI lane calibration procedure, leaving a small part of it to the VI module. In doing this, tegra_channel_enable_stream() (vi.c) manipulates the private data of the upstream subdev casting it to struct 'tegra_csi_channel', which will be wrong after introducing a VIP (parallel video input) channel. This prevents adding support for the VIP module. It also breaks the logical isolation between modules. Since the lane calibration requirement does not exist in the parallel input module, moving the calibration function to a per-module op is not optimal. Instead move the calibration procedure in the CSI module, together with the rest of the calibration procedures. After this change, tegra_channel_enable_stream() just calls v4l2_subdev_call() to ask for a stream start/stop to the CSI module, which in turn knows all the CSI-specific details to implement it. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
The tegra_default_format in vi.c is specific to Tegra210 CSI. In preparation for adding Tegra20 VIP support, move the default format to a new field in the soc-specific `struct tegra_vi_soc`. Instead of an entire format struct, only store a pointer to an item in the existing format array. No functional changes. The format pointed to is the same that used to be in vi.c. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
tegra_channel_fmt_align() takes care of the size constraints, alignment and rounding requirements of the Tegra210 VI peripheral. Tegra20 has different constraints. In preparation for adding Tegra20 support, move this function to a new op in the soc-specific `struct tegra_vi_ops` . Also move to tegra210.c the T210-specific defines used in the moved code. No functional changes. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
We are about to add support for the Tegra20 parallel video capture, which has no TPG. In preparation for that, limit the VIDEO_TEGRA_TPG option to Tegra210 which is the only implementation currently provided by this driver. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
There is only a pointer reference to struct tegra_vi in video.h, thus vi.h is not needed. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
This declaration is used only in csi.c, no need to export it elsewhere. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
struct tegra_vi_graph_entity is an internal implementation detail of the VI module. Move its declaration from vi.h to vi.c. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
of_node_put(node) does nothing if node == NULL, so it can be moved to the cleanup section at the bottom. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
tegra_vi_channels_alloc() can primarily fail for two reasons: 1. "ports" node not found 2. port_num > vi->soc->vi_max_channels Case 1 prints nothing, case 2 has a dev_err(). The caller [tegra_vi_init()] has a generic dev_err() on any failure. This mean that in case 2 we print two messages, and in case 1 we only print a generic message. Remove the generic message and add a specific message when case 1 happens, so that we always have one specific message without even increasing the number of dev_dbg*() calls. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
Add "skip" in "so we can *skip* the current channel" or it doesn't make sense. Also add articles where appropriate to fix English grammar. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
Clarify what this function does. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
Some fields are irrelevant for Tegra20/VIP. Add a note to clarify that. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
The Tegra20 VI peripheral can receive parallel input from the VIP parallel input module. Add it to the allowed properties and augment the existing nvidia,tegra20-vi example to show a 'vip' property. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-
Luca Ceresoli authored
VIP is the parallel video capture component within the video input subsystem of Tegra20 (and other Tegra chips, apparently). Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-