aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-compliance
AgeCommit message (Collapse)AuthorFilesLines
2018-12-13Add property compliance supportprops2Hans Verkuil2-3/+102
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2018-12-10v4l2-compliance: test 'invalid request' error injectionHans Verkuil1-1/+4
Use the new vivid capability to inject an error into the request validation. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2018-12-10v4l2-compliance: test orphaned buffer supportPhilipp Zabel2-6/+63
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()]
2018-12-10v4l2-compliance: add filehandles classHans Verkuil2-10/+42
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>
2018-12-10v4l2-compliance: reopen if buffers might have been allocatedHans Verkuil1-0/+6
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>
2018-12-07v4l2-compliance: Remove spurious error messagesEzequiel Garcia1-4/+2
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>
2018-11-30v4l2-compliance: verify QBUF restores length and bytesusedHans Verkuil1-4/+16
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>
2018-11-30v4l2-compliance: better field and prepbuf/qbuf testsHans Verkuil1-1/+17
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>
2018-11-29v4l2-compliance: fix multiple issues when testing vividHans Verkuil3-27/+48
'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>
2018-11-28v4l2-compliance: use inject_error and improve MEDIA_REQUEST_IOC_QUEUE testsHans Verkuil1-23/+9
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>
2018-11-28v4l2-compliance: add inject_error helper methodHans Verkuil1-0/+9
This simplifies the error injection tests. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2018-11-28v4l2-compliance: test failure during req_validateHans Verkuil1-2/+16
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>
2018-11-27v4l2-compliance: add test to close the request after queueingHans Verkuil1-4/+14
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>
2018-11-27v4l2-compliance: test 'start streaming' error injectionHans Verkuil1-1/+17
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>
2018-11-27v4l2-compliance: work around vivid error injection controlsHans Verkuil3-17/+15
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>
2018-11-27v4l2-compliance: fixes output request handlingHans Verkuil1-6/+7
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')
2018-11-26v4l2-compliance: select the right mediaX for vividHans Verkuil1-3/+4
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>
2018-11-21v4l2-compliance: add Request API testsHans Verkuil3-3/+319
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>
2018-11-17v4l2-compliance: add --stream-from and --stream-from-hdr optionsHans Verkuil4-62/+311
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>
2018-11-15v4l2-compliance: relax SUPPORTS_DMABUF checkHans Verkuil1-3/+1
This check would fail with older kernels, which is a bit too strict. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2018-11-14v4l2-compliance: limit acceptable width/height to 65536 in ↵Philipp Zabel1-2/+2
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>
2018-11-13v4l-utils: fix SHA detectionHans Verkuil1-2/+2
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>
2018-11-06v4l2-compliance: flush stdout before calling fork()Guillaume Tucker1-0/+2
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>
2018-11-05v4l2-compliance: check bufffer capabilitiesHans Verkuil1-0/+14
Verify that the buffer capabilities match the actually detected capabilities. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
2018-11-05v4l2-compliance: replace CROPCAP fail by warnHans Verkuil2-1/+8
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>
2018-10-06buildsystem: Add all required files to dist targetGregor Jasny1-1/+2
2018-09-28v4l2-compliance: drop COLORSPACE_JPEG testHans Verkuil1-2/+1
FMT_(M)JPEG can have other colorspaces besides COLORSPACE_JPEG. Just drop this test. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-09-14v4l2-test-input-output: improve warning messageMauro Carvalho Chehab1-1/+1
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>
2018-09-14v4l2-compliance: improve S_PARM testHans Verkuil1-0/+22
Check for framerates 0/1 and 1/0 as well, not just 0/0. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-09-07v4l2-compliance: allow both regular and mplane variants for crop APIHans Verkuil1-4/+14
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>
2018-09-07v4l2-compliance: add test for V4L2_CTRL_WHICH_DEF_VALHans Verkuil1-0/+5
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>
2018-09-07v4l2-compliance: allow EILSEQ as well as errorHans Verkuil1-6/+21
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>
2018-09-06v4l2-compliance: improve VIDIOC_CREATE_BUFS checksHans Verkuil1-0/+20
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>
2018-07-30libdvbv5/v4l2-compliance: fix select() gcc-8.1 warningsHans Verkuil1-7/+10
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>
2018-07-26v4l2-compliance: add pad index checksHans Verkuil1-1/+24
Now that G_TOPOLOGY returns the pad index we can do some new consistency checks.
2018-07-25v4l2-compliance: show new flags and index fieldsHans Verkuil2-4/+16
Support the new entity flags field and the new pad index field. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-07-03v4l2-compliance: fix subdev selection testHans Verkuil1-0/+1
Add missing sel.which = which line. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reported-by: Todor Tomov <todor.tomov@linaro.org>
2018-07-02media-info: various improvementsHans Verkuil2-11/+22
- 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>
2018-07-01v4l2-compliance: show data link flagsHans Verkuil1-5/+3
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>
2018-07-01v4l2-compliance: improve the output of unknown legacy typesHans Verkuil1-1/+1
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>
2018-06-29v4l2-compliance: check that entity names are uniqueHans Verkuil1-0/+4
Entity names are unique within a topology. Check this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-06-29v4l2-compliance: use correct buf type for export_bufsHans Verkuil1-3/+3
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>
2018-06-25v4l2-compliance: remove wrong testHans Verkuil1-5/+0
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>
2018-06-23v4l2-compliance: enable 'reserved' checks for mediaHans Verkuil1-6/+6
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>
2018-06-23v4l2-compliance: show device pathsHans Verkuil1-7/+24
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>
2018-06-23v4l2-compliance: add missing ( in stringHans Verkuil1-1/+1
There was a ( missing in the link description: Link: 0x02000028 RGB/YUV Input -> Scaler) Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-06-22v4l2-compliance: make media topology easier to readHans Verkuil1-9/+22
Map various hex IDs to actual human readable names. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-06-07v4l2-compliance: allow entities without padsHans Verkuil1-2/+2
Allow entities without pads. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-06-04v4l2-compliance: fix logic bug in testParmHans Verkuil1-3/+5
The check for video outputs was not correct. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
2018-06-01v4l2-compliance: add --exit-on-fail/warn optionsHans Verkuil3-0/+29
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>

Privacy Policy