aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
15 hoursmedia-ctl: add v4l2-ycbcr-enc field in help descriptionHEADmasterMarian Cichy1-1/+7
The help-description of media-ctl shows the possible values for v4l2-colorspace, v4l2-xfer-func and v4l2-quant, but misses to show them for v4l2-ycbcr-enc, even though they are perfectly defined in the source code like for the other fields. Let's print them too in the help description. Signed-off-by: Marian Cichy <m.cichy@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: rename v4l2-ycbcr-enc-func to v4l2-ycbcr-enc]
15 hoursmedia-ctl: fix ycbcr property in help descriptionMarian Cichy1-1/+1
The help description in media-ctl claims that the ycbcr property in v4l2-mbusfmt is called 'ycbcr-enc', which will lead to an EINVAL when used as the property is actually called 'ycbcr'. Signed-off-by: Marian Cichy <m.cichy@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
7 daysv4l2-compliance: check correct buffer length after CREATE_BUFSHans Verkuil1-0/+7
After using VIDIOC_CREATE_BUFS to allocate a double-sized buffer, check that VIDIOC_QUERYBUF reports the correct buffer size. This verifies that drivers preserve the requested size in their setup_queue callback. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
7 daysv4l2-compliance: improve VIDIOC_(TRY_)EN/DECODER_CMD testsHans Verkuil1-4/+4
Check that encoder_cmd ioctls return ENOTTY for decoders and vice versa. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
7 daysv4l2-compliance: improve VIDIOC_TRY_DE/ENCODER_CMD testsHans Verkuil1-0/+2
If the VIDIOC_DE/ENCODER_CMD ioctl returns ENOTTY, then the corresponding VIDIOC_TRY_DE/ENCODER_CMD ioctl must return that as well. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
7 daysv4l2-compliance: add support for VIDIOC_SUBDEV_QUERYCAPHans Verkuil3-5/+47
This ioctl was introduce some time ago, but support for this was never added to v4l2-compliance. Fix this. In particular add checks for read-only subdevices. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
7 daysv4l2-ctl: add support for VIDIOC_SUBDEV_QUERYCAPHans Verkuil1-8/+16
This ioctl was introduce some time ago, but support for this was never added to v4l2-ctl. Fix this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
7 daysv4l2-info: add v4l2_info_subdev_capabilityHans Verkuil2-0/+20
Add support for struct v4l2_subdev_capability. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
7 daysv4l2-subdev.h: replace BIT(0) by 0x00000001Hans Verkuil1-1/+1
The BIT macro is not available in userspace. A proper fix for the kernel has been posted, but until that's merged just fix this header manually. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
12 daysBuild with libbpf, remove local sourcesLuca Boccassi7-614/+14
libbpf is nowadays widely available in all distros that enable BPF, and it is a standalone library with a release cycle and a stable API. Remove the old sync of bpf.c/bpf.h and check for the library via pkg-config and use it instead. Only a minor modification is needed to make it compile. Signed-off-by: Luca Boccassi <bluca@debian.org> Signed-off-by: Sean Young <sean@mess.org>
2021-01-06v4l-utils: sync with latest media_tree master repoHans Verkuil8-22/+252
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-01-06v4l2-compliance: skip sequence tests for vividHans Verkuil2-5/+23
The vivid driver still has timing issues that can cause wrong buffer sequence numbers to be returned. Replace related tests with 'info()' messages if the vivid driver is being tested to avoid noise in the test results. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-01-06v4l2-compliance: test polling and disconnectingHans Verkuil3-2/+98
Test that disconnecting a device will wake up any processes that are using select or poll. This can only be tested with the vivid driver that enabled the DISCONNECT control. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2021-01-06v4l2-compliance: test for vb2/m2m poll kernel bugAlexandre Courbot1-1/+16
A bug has been discovered in the vb2 and m2m implementations of poll where EPOLLIN and EPOLLOUT events are never signaled to epoll_wait() unless at least one of them is included in the initial epoll_ctl() call. The presence of this bug can be detected by setting an initial empty set of events with EPOLL_CTL_ADD, then setting the events we are interested in using EPOLL_CTL_MOD. epoll_wait() will then invariably timeout even if there is a queue-related event pending. Signed-off-by: Alexandre Courbot <gnurou@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-12-10v4l2-compliance: fix two S_EDID testsHans Verkuil1-1/+1
The final two S_EDID tests check what happens if the edid pointer is NULL or 0x0eadbeef, but if no EDID is loaded when v4l2-compliance is run, then 'blocks' is 0, and in that case the edid pointer is ignored (S_EDID is interpreted as 'clear the EDID' in that case). So set 'blocks' to 1 instead to ensure that these two tests actually use the edid pointer and so return EFAULT. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-12-07qv4l2: fix CaptureWin::setWindowSize() if there are multiple screensHans Verkuil1-1/+2
QGuiApplication::screenAt() can return a nullptr depending on the screen geometry. It is overly complication since what we want to know is on which screen the window is shown. Replace it by querying the window for the screen: QScreen *screen = window()->windowHandle()->screen(); Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-03v4l-utils: sync with media_tree masterHans Verkuil18-564/+2097
The FWHT stateless codec API is now an official public API, so this required a few changes. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-12-01v4l2-ctl: break on VIDIOC_DQEVENT errorHans Verkuil1-14/+14
If VIDIOC_DQEVENT fails, then stop polling. This will happen if e.g. the video device was unregistered and VIDIOC_DQEVENT returns ENODEV. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-11-14v4l2-ctl: clean up control value printingHans Verkuil2-224/+252
There were two places where control values were printed. Merge this into a single print_value function. In addition, allow numeric controls IDs instead of control names to be passed to -C and -c. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-11-06v4l2-compliance: improve comment for CROPCAP/G_SELECTION failHans Verkuil1-2/+10
The reason for this failure is a bit subtle (missing support for V4L2_SEL_TGT_CROP_DEFAULT/BOUNDS), so explain this in more detail. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-11-06common/media-info.cpp: 'Flags' was not alignedHans Verkuil1-1/+1
The 'Flags' line was not properly aligned with the others: Entity Info: ID : 0x00000003 (3) Name : unicam-image Function : V4L2 I/O Flags : default Pad 0x01000004 : 0: Sink Link 0x02000007: from remote pad 0x1000002 of entity 'ov5647 10-0036': Data, Enabled, Immutable Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-30clang-tidy: add a bunch of constRosen Penev6-8/+8
Found with cppcoreguidelines-interfaces-global-init Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-30clang-tidy: use nullptrRosen Penev38-845/+845
Found with modernize-use-nullptr Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-24v4l2-ctl-32: use v4l2_ctl_CPPFLAGS, fix wrong checkHans Verkuil1-3/+3
Use v4l2_ctl_CPPFLAGS to build v4l2-ctl-32 to ensure it is consistent with building v4l2-ctl. In this case the GIT_COMMIT_CNT define was missing from v4l2-ctl-32, using v4l2_ctl_CPPFLAGS fixed that. Also v4l2-ctl-32 depended on 'if WITH_V4L2_COMPLIANCE_32' instead of 'if WITH_V4L2_CTL_32'. Fixed this as well. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-24v4l2-compliance-32: use v4l2_compliance_CPPFLAGSHans Verkuil1-1/+1
Rather than copying the v4l2_compliance_CPPFLAGS flags, just use $(v4l2_compliance_CPPFLAGS). This avoids accidental divergence between v4l2-compliance and v4l2-compliance-32. In this case, GIT_COMMIT_DATE was missing for v4l2-compliance-32. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-23cec-ctl: detect if Standby etc. messages are NackedHans Verkuil1-27/+90
During the power cycle stress test the <Active Source>, <Standby> and <Image View On> messages are transmitted without checking if the message was Nacked. Add this check and retry transmitting after waiting for a second. Some displays become unresponsive for a short time after changing power state, and during that time these messages are NACKed. The stress test didn't handle that very well, although it is dubious for a display to do this, since this makes life hard for sources. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-22cec-ctl.1.in: fix awkward languageHans Verkuil1-1/+1
"Note that this test should work without needed any repeats." -> "Note that this test should work without any repeats." Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-22cec-ctl: really wait for 2 seconds when the HPD is lowHans Verkuil1-11/+3
The purpose of commit 5b4a5a96ebe5 ("cec-ctl: improve wait_for_pwr_state") was to: "if, while waiting for Standby, the HPD is pulled low, then do not immediately assume the device is in standby, instead wait for two consecutive low HPDs before reporting that the device is in standby.". However, CEC_ADAP_G_LOG_ADDRS calls that checked if the logical address was invalid prevented that commit from actually doing the right thing. Those CEC_ADAP_G_LOG_ADDRS calls should have been removed, so do this now. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-22cec-follower: drop physical address checkHans Verkuil1-12/+3
If the CEC adapter required manual setting of the physical address, and the physical address was invalid, then cec-follower aborted with this message: FAIL: missing physical address, use cec-ctl to configure this But cec-ctl can poll for the physical address from the EDID using the -e or -E options, so in that case this check is too strict. Just drop the invalid physical address check, it's not needed. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-21cec utils and v4l2-compliance: improve version infoHans Verkuil9-19/+35
Various versioning changes: - GIT_SHA is now a SHA with length 12, the full SHA was a bit ridiculous. - the CEC/V4L2 compliance-related utilities now also report the last git commit date in UTC to make it easier to verify that the git repo is recent enough. - show the versioning as well for the cec-ctl power cycle tests. - don't show the git info if it wasn't build from a git repo. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-21cec-ctl/cec-compliance: add pulse8-cec kernel version checkHans Verkuil2-1/+41
The CEC framework had problems with displays that pull down the HPD when in Standby. This was fixed in kernel 5.5 and the fix was backported to LTS kernels 4.19.94 and 5.4.9. Check that the right kernel version is being used to prevent unreliable stress and compliance test results. For the stress test using the wrong kernel is a hard FAIL, for the compliance test it is just a warning since it is much more likely to pass. This is only checked for the pulse8-cec driver, for other CEC devices (most likely on an embedded system) you hopefully know what you are doing. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-06cec-compliance: options -n and -N were swapped in --helpHans Verkuil1-2/+2
The -n and -N options were swapped in the usage message: '-n' must be '-N' and vice versa. The man page and code is OK, it was just the usage message that was wrong. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-05README: Update build requirements for debianSebastian Fricke1-4/+3
The current set of required packages was not sufficient to complete the `make`, after following the usual route of: `sudo apt-get install debhelper dh-autoreconf autotools-dev\ autoconf-archive doxygen graphviz libasound2-dev\ libtool libjpeg-dev qtbase5-dev libqt5opengl5-dev\ libudev-dev libx11-dev pkg-config udev make gcc git` `./bootstrap.sh` `./configure` `make` The following error was presented: `moc: could not find a Qt installation of ''` Fix this issue by adding the `qt5-default` package to the list of requirements. Fixes: 8d2093a8a4bc43622cd68aeb85fb2b817de55993 Tested on: Debian version: Debian GNU/Linux 10 & Debian GNU/Linux 9 (Buster & Stretch(inside of a lxc container)) Additionally, I tested to build on a fresh VM, where I faced the same problem. Signed-off-by: Sebastian Fricke <sebastian.fricke.linux@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-04v4l-compliance: remove NON_CONSISTENT hint testSergey Senozhatsky5-69/+13
Kernel support for V4L2_FLAG_MEMORY_NON_CONSISTENT has been reverted, so we need to to remove the memory consistency (coherency) tests from the test-buffers code. Note, the buffer cache management hints support is still there and should be tested. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: squashed this patch with the sync-to-kernel patch,] [hverkuil: otherwise bisect would fail]
2020-10-03media-ctl: fix compiler warningsHans Verkuil1-1/+1
media-ctl.c: In function v4l2_subdev_print_dv_timings: media-ctl.c:169:32: warning: sprintf may write a terminating nul past the end of the destination [-Wformat-overflow=] 169 | sprintf(unknown, "Unknown (%u)", type); | ^ media-ctl.c:169:2: note: sprintf output between 12 and 21 bytes into a destination of size 20 169 | sprintf(unknown, "Unknown (%u)", type); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Increase array size from 20 to 21. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-03cppcheck: use const referencesRosen Penev1-2/+2
Found with constVariable Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-10-03cppcheck: turn several references to constRosen Penev6-19/+19
Found with constParameter Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: fix qvidcap changes]
2020-09-28libcecutil: make license consistentHans Verkuil9-8/+9
The headers and sources were a mix of GPL, LGPL and dual licensed BSD. Set them all to "LGPL-2.1-only OR BSD-3-Clause". Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-09-26v4l2-ctl: subdev: Add the flags to the list of supported mbus formatsDafna Hirschfeld3-2/+31
Add a new function mbus2s to that prints a descriptive string of the supported flags of the the v4l2_subdev_mbus_code_enum Use this function in the print_mbus_code function. Also add a macro MBUS_DEF(enc_type) to create the two arries 'mbus_hsv_def' and mbus_ycbcr_def' that maps flags to string according to the enc_type (ycbcr/hsv) Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-09-26v4l2-ctl: subdev: Add support for the CSC API in the subdevicesDafna Hirschfeld1-4/+12
The CSC API allows userspace to configure the colorspace, quantization, (ycbcr/hsv)_enc and xfer_func fields when setting the formats, so those fields are not read only in userspace. This patch adds support for this API in subevices. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-09-26v4l2: common: add the flags V4L2_FMT_FLAG_CSC* to the list that maps flags ↵Dafna Hirschfeld3-14/+32
to str Replace the array fmtdesc_def with a macro 'FMTDESC_DEF' The macro is used to to create two arrays 'fmtdesc_def_ycbcr', 'fmtdesc_def_hsv' that map the format flags to strings. The function 'fmtdesc2s' is changed to get a parameter 'is_hsv' that decides which array to use. The new CSC flags V4L2_FMT_FLAG_CSC* are added to the arries. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-09-26v4l2-ctl: vidcap: Add support for the CSC APIDafna Hirschfeld2-4/+40
With the CSC API, capture drivers can allow userspace to request to set the colorspace fields of the pixelformat. This patch adds supports for this feature. when calling 'v4l2-ctl --set-fmt-video' on capture devices userspace can ask to change the fields 'colorspace', 'ycbcr/hsv_enc', 'quantization' and 'xfer_func' of the format if the driver supports it. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-09-26v4l-utils: sync with media_tree masterHans Verkuil6-3/+68
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2020-09-20dvbv5-zap: allow recording also the SDT tableMauro Carvalho Chehab1-0/+14
The SDT table can contain useful information required by players for listening some programs. It seems that VLC requires that, in order to properly detect programs with SMPTE 302m. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-18dvbv5-zap: add a warning when not recording PMT dataMauro Carvalho Chehab1-0/+6
There are several audio formats and at least one video format that are sent using Elementary Stream type 6 (private data). The only way to identify the stream format is by checking some descriptors that come together with the PMT table, being the registration descriptor the most important one, as it contains a FOURCC value that should uniquelly identify the stream type. Due to that, add a note when audio and/or video streams are recorded without PMT data. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-13dvb-file: reimplement get_pmt_descriptors()Mauro Carvalho Chehab1-71/+124
Change the implementation of this function in order to properly check the registration descriptor. As such descriptor can uniqelly identify streams with audio and video, check for it before doing the check for stream->type. While here, add other known fourcc types, as used at libVlc. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-13libdvbv5: use an array for the fourcc typeMauro Carvalho Chehab2-3/+4
While not too late, change the fourcc type to be an array, and display them as chars when printing. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-12libdvbv5: detect SMTPE 302m audio formatMauro Carvalho Chehab1-4/+19
When SMTPE 302m is used, the ES type is 6. Detecting weather it has audio or not should be done via registration descriptor. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-12libdvbv5: add support for the registration descriptorMauro Carvalho Chehab5-4/+188
Such descriptor works like a fourcc descriptor: it specifies the format of an Elementary Stream. It is needed in order to identify SMPTE s302m audio streams. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-09-11cec-ctl: don't spam log with PA changes unless pausedHans Verkuil1-10/+7
When a thread is started to poll for EDID changes, then that thread was logging the new Physical Address whenever it changed, but that messed up the logging of e.g. --stress-test-power-cycle. So now only log PA changes if the main thread is paused since that's when nothing else is happening. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Privacy Policy