summaryrefslogtreecommitdiff
path: root/scripts/vsp-lib.sh
AgeCommit message (Collapse)Author
2020-07-14Add license and copyright informationLaurent Pinchart
Add SPDX tags to describe license and copyright information to all files in the repository. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
2019-02-19vsp-lib: Reset controls to defaults on each test runKieran Bingham
Some of our tests set flipping and rotation controls, and the VSP instance can be used again by later tests. If these controls are not reset, then that operation is applied to later tests incorrectly causing those tests to fail. In an ideal world, tests should clean up after themselves, and leave the system in a known state. However the world is not ideal and we would not be able to guarantee any previous system state before a test was run anyway. Therefore it is more effective to reset state at the beginning of a test. To repair this - reset all control values to their defaults at the start of every test during test_init() Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-02-19vsp-lib: trivial: Fix spelling of ReferenceKieran Bingham
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-05-21vsp-lib: Capture the kernel log messages in test log filesLaurent Pinchart
It can be useful to capture kernel log messages in test log files for diagnostic purpose. Add a simple mechanism to do so by capturing the full kernel log at the end of the test. The kernel log is cleared first before starting the test to avoid capturing unrelated messages. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> --- Changes since v1: - Don't clear the kernel log
2017-08-30vsp-lib: Add support for RPF-BRS-WPF pipelinesLaurent Pinchart
Reuse the BRU code, using the brx generic name to cover both BRU and BRS. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
2017-08-30vsp-lib: Use the correct media device name to count BRU inputsLaurent Pinchart
Use the media device under test, not the default media0. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Tested-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
2017-03-03tests: Add HGT testNiklas Söderlund
Test HGT histogram during video streaming. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-03-03vsp-lib: Add option to specify histogram typeNiklas Söderlund
There are two kinds of histogram that can be generated, HGO and HGT. Let the histogram compare function know which type it should use. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-03-03vsp-lib: Fix typo in commentLaurent Pinchart
HSV is not written HSB. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-02-13vsp-lib: Add sru-uds and uds-sru pipelinesLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-02-13vsp-lib: Add pipeline description to the frame file nameLaurent Pinchart
If different pipelines from the same test generate the same output frame size and format from the same input format, the frame binary file names will collide. To avoid overwriting output files, add the pipeline description to the file name. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-02-13vsp-lib: Initialize __vsp_wpf_index to default value in pipe_reset()Laurent Pinchart
This avoids having to store the index in all pipe configuration functions, as the vast majority of them use WPF.0. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-02-13vsp-lib: Fix reference frame generation for HSV input formatsLaurent Pinchart
gen-image doesn't support processing HSV input frames. Fortunately the HSV tests don't require it either, when they take an HSV input frame they just pass it straight to the WPF. We can thus set the input format to RGB for reference frame generation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-02-12vsp-lib: Support RPF frame croppingKieran Bingham
Pass the optional '--crop (X,Y)/WxH' parameter through reference_frame allowing the input to be cropped for comparison Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-02-12vsp-lib: Filter non-filesystem regular charactersKieran Bingham
Parameters can contain characters not suited to use in filenames. Add '=','(', and ')' to the filtering, and replace with '_' This reduces extra escaping, and quoting when working with the output filenames of failed tests and VSP_KEEP_FRAMES=1 Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-02-10vsp-lib: sort output frames correctlyKieran Bingham
In the event of failed frames, or VSP_KEEP_FRAMES being set, the output file names do not sort such that the reference frame is next to the failed frame. This can make comparing reference frames and the relevant output frames tedious and difficult. Re-arrange the output filenames such that the sort order will match the option parameters correctly, followed by either the reference frame identifier, or the frame number at the end of the filename string Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-10-24tests: Add YVU 3-planar formats in RGB and WPF testsLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-16vsp-lib: Add support for RPF-HST-WPF pipelineLaurent Pinchart
This will be used to test RGB to HSV conversion. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-16tests: Skip VYUY tests on Gen3 platformsLaurent Pinchart
The Gen3 platforms don't support VYUY, skip the related tests. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-14vsp-lib: Print a message when a test can't be runLaurent Pinchart
Tests that can't be run due to lack of mandatory features are currently silent, make them print a message to avoid confusing the user. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-14vsp-lib: Fix fuzzy comparisonLaurent Pinchart
A typo caused fuzzy comparison to be used in all tests. Fix it, and make sure the fuzzy comparison gets properly enabled when using rotation. Fixes: ccd867a84863 ("vsp-lib: SRU and rotation are not perfectly emulated by gen-image") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-13vsp-lib: SRU and rotation are not perfectly emulated by gen-imageLaurent Pinchart
Turn on fuzzy comparison for rotation and for the SRU regardless of the scaling ratio. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-13tests: Provide SRU unit testKieran Bingham
Provide a pipeline configuration in vsp-lib, and simple tests for the SRU processing unit Signed-off-by: Kieran Bingham <kieran@bingham.xyz> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-13vsp-lib: Add option to keep all frames when tests succeedLaurent Pinchart
When the environment variable VSP_KEEP_FRAMES is set to 1, all frames will be kept regardless of the test results. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-13vsp-lib: Don't average chroma when generating test input framesLaurent Pinchart
This avoids double-averaging due to chroma interpolation at the RPF. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-13vsp-lib: Use the gen-image -i argumentLaurent Pinchart
Replace the now defunct -y argument with -i. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-13vsp-lib: Fix alpha value handlingLaurent Pinchart
Take both the input and output formats into account to compute the alpha value effectively output by the hardware. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-13vsp-lib: Use both input and output formats to name frame filesLaurent Pinchart
Tests can run with a single output format and different input formats. If multiple failures are recorded the frame files overwrite each others. Fix this by naming them with both the input and output formats. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-26vsp-lib: Only remove binaries related to current testLaurent Pinchart
Removing all .bin files when starting a test removes not only the result of previous runs of the current test as desired, but also the result of all tests run previously. Fix it by only removing binaries related to the current test. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-21vsp-lib: Write frames to temporary directory by defaultLaurent Pinchart
This speeds up tests by avoiding the need to access flash memory or, worse, NFS. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-20vsp-lib: Add support for pausing and resuming yavtaLaurent Pinchart
When the --pause argument to vsp_runner() is specified, the corresponding yavta instance will pause after capturing or outputting the given number of frames and wait for a signal before resuming. The new vsp_runner_wait() and vsp_runner_resume() functions can be used to respectively wait for yavta to pause and instruct it to resume. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-20vsp-lib: Replace vsp-runner script with a function from vsp-libLaurent Pinchart
This allows reusing variables internal to vsp-lib and getting rid of the mdev and format arguments to the vsp-runner invocations. As part of the transition, handle additional options with an explicit list of supported options instead of passing them straight to yavta. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Add CLU and LUT pipelines supportLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Add support for passing parameters to reference frame generatorLaurent Pinchart
The parameters currently supported are horizontal and vertical flipping, rotation, LUT and CLU. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Store the scaling configuration internallyLaurent Pinchart
This allows deciding whether to compare output frames using the exact or fuzzy algorithm internally, removing the need for an explicit argument to the compare_frames function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Store the number of BRU inputs internallyLaurent Pinchart
Instead of getting the number of BRU inputs from an explicit argument to the compare_frames function, store it internally when configuring the pipeline. This simplifies the test scripts by removing the reftype argument to the compare_frames function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Don't pass WPF index and format to comparison functionsLaurent Pinchart
The information is already known to the pipeline configuration functions, store it internally and reuse it instead of having to pass it explicitly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Handle logging internallyLaurent Pinchart
Remove the need to pipe individual commands to the logger from the test scripts by moving all logging code internally to vsp-lib and vsp-runner. As an interesting side effect the removal of shell pipes from the test scripts avoids running functions in subshells. This makes it possible for the pipeline configuration functions to set variables that can be used later. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Declare all local variables as localLaurent Pinchart
Stop the global namespace pollution. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Add set control supportLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Support controls as device featuresLaurent Pinchart
Enhance the feature checking code to allow checking for the presence of a particular control on a particular entity. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Create a function to get subdev from entity nameLaurent Pinchart
And use the function in the vsp-runner script instead of duplicating the same code in multiple locations. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Support optional features for testsLaurent Pinchart
Add a third argument to test_init() to pass a list of optional features. If more than one media device supports all the required features, select the one that supports the highest number of optional features. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Add YUV422M and YUV444M supportLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-19vsp-lib: Use gen-image to generate frames at runtimeLaurent Pinchart
Replace the build time reference frames generation system by runtime generation of the frames. This saves a lot of disk space and allows tests to easily use new reference frames. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-06-16Add gen-image toolLaurent Pinchart
The tool is used to generate test images in a variety of formats from a PNM input image. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-05-19Initial commitLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>