summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2022-07-31kmstest: Implement test runner when executed directlyLaurent Pinchart
Run all tests from the current directory when the kmstest.py script it executed directly, as opposed to being imported by individual tests. This simplifies running all tests. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-31tests: Only call execute() if the test is run directlyLaurent Pinchart
Only run a test automatically if the Python test script is executed directly. This will allow importing tests as modules in a test runner. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-31tests: crc: Skip test if CRC support isn't availableLaurent Pinchart
If CRC support isn't available (most likely caused by debugfs not being mounted), the CRCReader constructor will throw an exception that the crc test doesn't handle. Move construction of the CRCReader earlier and skip the test if it fails. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-31kmstest: Fix exception handling in CRCReader constructor and destructorLaurent Pinchart
If an exception occurs in the CRCReader constructor, the self.dir, self.ctrl and self.data members may not be set. This causes another exception to be thrown by the destructor when it tries to access those members. Fix it by initializing all the members first, and only closing the dir and ctrl file descriptors if they have been successfully opened. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-31kmstest: Fix CRC directory name stringLaurent Pinchart
The CRC directory name string was converted to a Python formatted string literal incorrectly, with the f prefix within the string instead of just before it. Fix it. Fixes: dcbc93a117b0 ("tests: Convert to formatted string literals") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-31tests: modes: Fix access to RuntimeError message textLaurent Pinchart
The RuntimeError class has no message member. Use args[0] instead. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-07-31tests: brxalloc: Fix test start log messageLaurent Pinchart
The test start log message incorrectly prints the same connector twice instead of the source and destination connectors. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-06-29tests: Rename kms-test-planeposition.py to kms-test-plane-position.pyLaurent Pinchart
Match the name scheme of other tests by renaming kms-test-planeposition.py to kms-test-plane-position.py. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29tests: Add plane zpos testLaurent Pinchart
Add a test that enables multiple planes with different zpos values. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29kmstest: Support specifying zpos value for planesLaurent Pinchart
Add an optional zpos argument to the atomic_plane_set() function to allow controlling the zpos of a plane. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29tests: Add plane alpha testLaurent Pinchart
Add a test that enables multiple planes with different alpha values. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29kmstest: Support specifying alpha value for planesLaurent Pinchart
Add an optional alpha argument to the atomic_plane_set() function to specify the alpha value for the plane. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29kmstest: Support specifying property values in percentsLaurent Pinchart
If the property is a string that ends with a '%' character, treat it as a percentage of the range reported by the property and convert it to the corresponding numerical value. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29kmstest: Move props value formatting to AtomicRequestLaurent Pinchart
Centralize props value formatting in the AtomicRequest.add() function to avoid having to call it manually through the code base. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29tests: allplanes: Log the plane IDsLaurent Pinchart
Plane IDs are useful for debugging, log them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29tests: Convert to formatted string literalsLaurent Pinchart
Use formatted string literals to replace legacy printf-style string formatting. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2022-06-29tests: Replace double quotes with single quotesLaurent Pinchart
The code base mixes single and double quotes. Standardize on single quotes except for triple-quoted strings (to match the PEP8 coding style) and where the string contains single quotes to avoid the need to escape them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
2020-08-08tests: crc: Compute reference CRC values and compare themLaurent Pinchart
Instead of only checking that the CRC value is constant, compute the expected CRC value, and compare it to the hardware-generated CRC. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-08tests: crc: Introduce Composer classLaurent Pinchart
The Composer gathers the computation of planes position. It is currently only used to configure the planes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-08tests: crc: Disable CRTC regarless of test statusLaurent Pinchart
The CRTC should be disabled when the test completes, regardless of whether it succeeds or fails. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-08kmstest: Add additional geometry classesLaurent Pinchart
Add Dist, Point and Size classes in addition to the Rect class. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-08kmstest: Extend Rect classLaurent Pinchart
Add a helper isEmpty() method to the Rect class, as well as a __repr__() method to pretty-print the rectangle. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-08tests: crc: Fix AtomicRequest usageLaurent Pinchart
Commit 3cd7e6814cea ("kmstest.py: Fix CRTC disabling") modified the CRC test to use the kmstest.AtomicRequest class, but failed to pass the correct argument to the constructor. Fix it. Fixes: 3cd7e6814cea ("kmstest.py: Fix CRTC disabling") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-08tests: planeposition: Test disabling and enabling off-screen planesLaurent Pinchart
Add a test to enable an off-screen plane, in addition to the existing tests that move enabled planes on screen. This new test crashes the DU driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-08tests: formats: Improve error reportingLaurent Pinchart
Improve the formats test by counting the number of formats that failed and reporting failures appropriately. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-08-08tests: formats: Add progress reportingLaurent Pinchart
Improve the formats test by adding progress reporting, as the test is long. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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-06-19kmstest.py: Add output_connectors() helper to skip writeback connectorsLaurent Pinchart
Add a generator method to the KMSTest class to enumerate all non-writeback connectors, and use it through tests. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
2019-06-19tests: Add an output routing testLaurent Pinchart
Add a test that moves an output connector between multiple CRTCs with a single mode set operation at each step, without going through disable and reenable cycles. This helps testing the routing configuration code paths in the commit tail handler. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
2019-06-19tests: Extend BRU/BRS allocation test to cover M3-NLaurent Pinchart
The BRU/BRS allocation test only covers the H3 ES2.0 SoC as that was the only hardware platform supported by the DU driver that offered the required features at the time the test was written. Now that M3-N is supported in the DU driver, support it in the test script. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
2019-06-19tests: Add a plane formats testLaurent Pinchart
Add a new test script that tests all formats supported by planes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
2019-06-18tests: Add a legacy mode set testLaurent Pinchart
Perform mode sets through the legacy API to test the DRM core legacy code paths, as well as the rcar-du code paths that could be exercised differently by the atomic legacy mode set helpers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-06-18kmstest.py: Capture the last kernel messages before closing the logLaurent Pinchart
When stopping a test, kernel messages can be logged after the event loop is stopped. Capture them before closing the log. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
2019-06-18kmstest.py: Fix CRTC disablingLaurent Pinchart
The KMSTest.atomic_crtc_disable() method deactivates a CRTC but doesn't fully disable it, which requires setting the MODE_ID to 0. Furthermore it doesn't de-associate the CRTC from connectors and planes, which causes atomic check failures as a fully disabled CRTC can't be associated with connectors. It can also lead to the next test failing due to resources still being allocated to the CRTC. To fix this, introduce an AtomicRequest class that wraps around pykms.AtomicReq, and stores a copy of all the properties. When the request is committed the properties are added to a global state, which is then used to locate and release connectors and planes associated with the CRTC in KMSTest.atomic_crtc_disable(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
2018-04-23tests: crc: Add CRC computation testLaurent Pinchart
The test exercises the CRC API by enabling CRC computation on the pipeline output, capturing CRC values and verifying that they all match. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-04-23kmstest.py: Add CRC reader classLaurent Pinchart
The CRCReader class uses the DRM/KMS debugfs-based CRC API to configure CRC computation on a CRTC and read the computed CRC values. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-04-22tests: brxalloc: Add BRU/BRS dynamic allocation testLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2018-02-26kmstest.py: Add atomic_plane_disable() function to KMSTest classLaurent Pinchart
The function can be used to disable planes selectively. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-12-15kmstest.py: Update to the latest kmsxx Python bindingsLaurent Pinchart
Commit 706a44abb3aa ("Update to latest pybind11") of kmsxx broke the test suite by changing the signature of the AtomicRequest::commit function. Update the test suite accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
2017-11-26tests: planeposition: Wait 3s after moving planes off-screenLaurent Pinchart
Add a 3s delay after each off-screen position test, as we do for partially off-screen tests, in order to allow time for visual inspection. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-11-13tests: planeposition: Accept off-screen planesLaurent Pinchart
The DU driver now accepts off-screen planes (but obviously don't display them). Update the test accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-09-21Makefile: Fix installation scripts wildcardLaurent Pinchart
The Makefile incorrectly refers to test scripts as *.sh while it should use *.py. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2017-08-16Initial importLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>