Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Use the new vivid capability to inject an error into the
request validation.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Test that V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS is reported equally for
both MMAP and DMABUF memory types. If supported, try to orphan buffers
by calling reqbufs(0) before unmapping or closing DMABUF fds.
Also close exported DMABUF fds and free buffers in testDmaBuf if
orphaned buffers are not supported.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco: rebase, add missing m2m_q cleanup in testDmaBuf()]
|
|
Add a simple class to store filehandles. The destructor will close
all pending filehandles on error. This ensures that when working with
requests no request or media filehandles remain open after a test fails.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Some of the tests allocate buffers, but if there was a failure
in that test, then the buffers wouldn't be freed.
Do that one level up in v4l2-compliance.cpp. Otherwise this would
cause confusing knock-on failures later in the test.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Get rid of a couple confusing error messages, namely:
test VIDIOC_G_FMT: OK
fail: v4l2-test-formats.cpp(464): pix_mp.plane_fmt[0].reserved not zeroed
fail: v4l2-test-formats.cpp(752): Video Output Multiplanar is valid, but TRY_FMT failed to return a format
test VIDIOC_TRY_FMT: FAIL
fail: v4l2-test-formats.cpp(464): pix_mp.plane_fmt[0].reserved not zeroed
fail: v4l2-test-formats.cpp(1017): Video Output Multiplanar is valid, but no S_FMT was implemented
test VIDIOC_S_FMT: FAI
Where only the first message "pix_mp.plane_fmt[0].reserved not zeroed"
is accurate.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Check that QBUF fills in the correct length and bytesused values.
Especially important if they have to come from a previous PREPARE_BUF
call.
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
|
|
When queueing a buffer to an OUTPUT device with V4L2_FIELD_ANY, then
VIDIOC_QBUF shall return a non-ANY field value. Check this.
If a buffer has been prepared before VIDIOC_QBUF was called, then
for USERPTR and DMABUF the userpointers and dmabuf fds are ignored
and instead it will return the ones used when VIDIOC_PREPARE_BUF was
called. Check this.
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
|
|
'v4l2-compliance -m0' for the vivid driver resulted in several
failures that are now fixed:
1) The bus_info argument to mi_get_media_fd() wasn't used for every call,
causing problems for multiple vivid instances.
2) Various capability values (e.g. valid_buftypes) that differ for
different inputs were not reset to 0 when testing a new input.
3) Store the buffer capabilities in the node for easy access.
4) Fix an issue with the EXPBUF test which isn't available in some circumstances
(streaming from a VBI device when the input isn't SDTV).
5) Add tests for V4L2_BUF_CAP_SUPPORTS_REQUESTS
6) Fix an issue with selecting the right VBI format (raw vs sliced)
7) Fix an issue with swradio that needs min_bufs buffers before it can
start streaming. It was luck that it worked for other devices since
they all needed a minimum of 2 buffers, whereas swradio needed 8.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
The error injection test for MEDIA_REQUEST_IOC_QUEUE failed for already
prepared buffers since in that case it won't call buf_prepare again and
vivid cannot inject the error there.
So skip that test for every other buffer (all even buffers are prepared,
all odd buffers aren't).
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
This simplifies the error injection tests.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Test what happens if the validation of a queued request fails.
Testing using vivid and its error injection feature.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Close some of the request fds after they are queued. This tests if
what are basically orphaned requests are still handled correctly.
And no, they weren't and patches to fix this are on their way :-)
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
If the driver under test is vivid, then make use of the 'start streaming'
error injection feature to test what happens when it fails.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
v4l2-compliance refuses to work with vivid if vivid is loaded without
the no_error_inj=1 module option since some of the compliance tests
trigger the error injection, thus failing the test.
Make v4l2-compliance smarter by ignoring all vivid class controls if
it detects that the driver is in fact vivid. This allows it to
successfully pass all tests.
The main reason for this change is that this allows us to use the
error injection controls to test how the kernel handles various error
conditions that are otherwise hard to test.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
An earlier patch modified the 'output' counter for output buffer types
in captureBufs() which caused the wrong request fd to be set.
Remove the change to the output counter and make the index calculation
for the buf_req_fds array more robust.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: 99dfae1aa052 ('v4l2-compliance: add --stream-from and --stream-from-hdr options')
|
|
The vivid driver is unusual since it creates multiple media devices
for one driver instance. Use the bus_info to match the right media
device.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
|
|
Add the Request API tests. These tests are currently primarily
targetted at vivid/vimc, and will need to be improved to handle
actual codecs like cedrus and (in the future) vicodec.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
One major missing piece of functionality has been to read the contents
of output buffers from a file. This made it impossible to test decoders
in particular.
New --stream-from and --stream-from-hdr (matching --stream-to and
--stream-to-hdr from v4l2-ctl) options have been added to support this.
It is also possible to specify files for specific pixelformats by
prefixing the filename with '<fourcc>=', i.e.:
FWHT=test.fwht
Multiple files for different pixelformats can be given this way.
The file given without a prefix is used as the default file if no
file for the current pixelformat was found.
Note: the compliance test for codecs is still under development and
it may not always work.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
This check would fail with older kernels, which is a bit too strict.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
VIDIOC_SUBDEV_G/S_FMT test
Fail if the driver returns unrealistically large frame sizes.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
|
|
Check if there is a .git directory at the top-level, and only
then get the SHA of the HEAD.
If the release tarball (which doesn't have a .git directory) is
extracted inside another git repo, then the current SHA code
would find the SHA of the enclosing git repo, which is not what
you want.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
In order to avoid corrupt log output, flush stdout before calling
fork() when running streaming tests. This is to prevent any remaining
characters in the stdout buffer from being output both in the parent
and child process.
Signed-off-by: Guillaume Tucker <guillaume.tucker@collabora.com>
Signed-off-by: Hans Verkuil <hansverk@cisco.com>
|
|
Verify that the buffer capabilities match the actually detected
capabilities.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
While it is really a bug, the v4l2 core hasn't been updated
yet to handle this correctly. So for the time being just issue
a warning until the v4l2 core has been fixed. Then it can go back
to fail_on_test.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
|
|
|
|
FMT_(M)JPEG can have other colorspaces besides COLORSPACE_JPEG.
Just drop this test.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
The message produced when v4l2_input.audioset leads to a
wrong diagnosis. Currently, it prints a message saying
that there's no audio inputs, but, in the sequence, it
lists 1 audio input:
test VIDIOC_G/S/ENUMINPUT: OK
fail: v4l2-test-input-output.cpp(520): No audio inputs, but G_AUDIO did not return ENOTTY or EINVAL
fail: v4l2-test-input-output.cpp(564): invalid audioset for input 0
test VIDIOC_G/S_AUDIO: FAIL
Inputs: 2 Audio Inputs: 1 Tuners: 1
Fix the message to not lead the developer to try addressing
a different problem.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
|
|
Check for framerates 0/1 and 1/0 as well, not just 0/0.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
According to the spec both regular and mplane variants should be
supported for the crop API (just as happens with the selection API).
Test this.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
This 'which' value was never tested for G/S/TRY_EXT_CTRLS.
Add a test for this.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
If the UVC driver couldn't get/set a control it used to return EIO,
but this has changed to EILSEQ with a recent kernel change.
Actually, EIO is now split into multiple errors, but I am getting
EILSEQ where I used to get EIO.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Add tests for the multiplanar case:
- check that a mismatch in num_planes will return -EINVAL
- check handling of too small plane sizes
The second test was only done when streaming, now it is also done
when v4l2-compliance is called without the -s option.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
The same fds argument is passed twice to the select() call.
This leads (with gcc 8.1) to this warning (same warning for v4l2-compliance):
dvb-dev-local.c:614:7: warning: passing argument 2 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
&set, NULL, &set, NULL));
^~~~ ~~~~
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Now that G_TOPOLOGY returns the pad index we can do some new
consistency checks.
|
|
Support the new entity flags field and the new pad index field.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Add missing sel.which = which line.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Todor Tomov <todor.tomov@linaro.org>
|
|
- consistently use the mi_ prefix for the exported functions
- add missing MEDIA_TYPE_DTV_CA
- add mi_func_requires_intf() and test for this in v4l2-compliance
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Show the data link flags. Interface link flags are not shown since
they are always the same. Drop the unwanted "Entity Link" messages.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Instead of text like this:
Entity: 0x00000003 (Name: 'vicodec-enc-proc', Type: Unknown legacy device node type (0001ffff))
just print this:
Entity: 0x00000003 (Name: 'vicodec-enc-proc', Type: Unknown Device Node)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Entity names are unique within a topology. Check this.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Also require an explicit buf type instead of defaulting to 0 for
export_bufs().
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Reported-by: Ezequiel Garcia <ezequiel@collabora.com>
|
|
The code checked that sinks pads come before source pads when
enumerating pads. However, there is no such requirement, so
remove this test.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
The media core code has been updated to properly zero these
reserved arrays, so we can now check them with v4l2-compliance.
Uncomment those checks.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
When logging the topology also translate major/minor numbers
for a device node into an actual device path.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
There was a ( missing in the link description:
Link: 0x02000028 RGB/YUV Input -> Scaler)
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Map various hex IDs to actual human readable names.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
Allow entities without pads.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
The check for video outputs was not correct.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|
|
These options simplify debugging: when the first fail or warning
occurs, the application will call exit(1) instead of continuing.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
|