summaryrefslogtreecommitdiff
path: root/tests/kms_atomic_transition.c
AgeCommit message (Collapse)Author
2019-04-11igt/tests/kms_atomic_transition: Tolerate if can't have all planesStanislav Lisovskiy
With some upcoming changes i915 might not allow all sprite planes enabled, depending on available bandwidth limitation. Thus the test need to decrement amount of planes and try again, instead of panicking. v2: Removed excessive nested conditions, making code a bit more readable(hopefully). v3: Stopped using global n_planes variable as it might cause resources being unreleased. Using now parms[i].mask as a way to determine if plane has to be included into commit. v4: Removed unneeded n_overlays initialization. v5: Randomize which of sprite planes to remove if hitting resource limits. v6: Replace igt_warn with igt_info, to make IGT tests happier. v7: Removed unneeded retry logic, made plane random removal simplier. Great thanks to Maarten Lankhorst for suggestions. v8: Fail if we have less than 3 planes v9: Remove unneeded diffs Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2019-04-11igt/tests/kms_atomic_transition: Skip transition, if no changes doneStanislav Lisovskiy
While fixing used amount of planes, discovered that if wm_setup_plane is called with specific parameter that gives parms[i].mask & mask == 0 for all used planes, then subsequent wait_transition fails in assertion on fd_completed. So added return value to wm_setup_plane, which would allow to determine, if we really need to wait for any transitions. v2: Fixed commit message, to properly describe a reasoning for wm_setup_plane changes. Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2019-04-11igt/tests: Remove redundant alpha retryStanislav Lisovskiy
Using igt_plane_has_format_mod allows to save time not doing redundant retry, knowing if plane supports alpha beforehand. v2: Remove unneeded assertion also. Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2019-03-06igt/tests: Fix error checking in kms_atomic_transitionStanislav Lisovskiy
There is no guarantee that error return value will be always EINVAL, made a check more general as it can be ERANGE, ENOSPC, EINVAL and probably others, which all mean the same in context of this test case: i.e this sprite size is not valid. v2: Added macro to make check look a bit nicer. v3: Removed redundant debug line. v4: Added assertion if error is not EINVAL as expected, other errors except EINVAL are considered now a failures. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109225 Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Reviewed-by: Stuart Summers <stuart.summers@intel.com>
2018-11-06tests/kms_atomic_transition: Do not timeout when number of sprites is huge, v5.Maarten Lankhorst
We mostly care about the plane type, because sometimes the driver may do silly things when only a cursor is enabled for example, so we reduce the number of tests. This puts an upper bound on the number of plane combinations being tested, which is nice for gen11. Changes since v1: - Make 2 groups for overlay planes, and randomly put planes in either group. Changes since v2: - Include igt_rand.h to compiler error. Changes since v3: - Fix logical error resulting in crash. Changes since v4: - Fix logical error harder. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v3
2018-10-01igt: Require a display (KMS enabled) for KMS testsChris Wilson
Simple rule of thumb, if a kms_* test calls igt_display_init() in its global fixture, skip the entire test if the driver has disabled KMS. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-03-16lib: Add igt_hweight()Ville Syrjälä
Add the binary hamming weight helper to igt_aux.h. v2: Add just the one macro that works for 64 and 32 bits (Chris) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-01-30tests/kms_atomic_transition: Don't abuse the HSKEW flag to force a modesetVille Syrjälä
Since kernel commit e995ca0b8139 ("drm/i915: Provide a device level .mode_valid() hook") i915 will bluntly reject the HSKEW mode flag. Thus we can't abuse it to force a modeset. Since we don't particularly care about the visual results here we can risk making the display unhappy by eg. flipping the hsync polarity instead. Also add a comment documenting why we're doing this. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104848 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-01-03kms_atomic_transition: Remove skip_on_unsupported_nonblocking_modeset.Maarten Lankhorst
This weas a workaround to gracefully skip on i915 before nonblocking modeset support was added, but this is no longer needed. Remove the code, since it's safe to always assume such support is enabled. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104471 Reported-by: Marta Lofstedt <marta.lofstedt@intel.com> Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
2017-11-09kms_atomic_transition: Split out modeset tests on internal panelsImre Deak
Doing modeset on internal panels may have a considerable overhead due to the panel specific power sequencing delays. To avoid long test runtimes in CI split out the testing of internal panels from the plane modeset subtests and test only a reduced number of plane combinations on these: where only a single plane is enabled, all planes are disabled or all planes are enabled. v2: - Add code comment explaining the need for the separate internal-panels subtests. - Calculate the number of enabled planes only once. (Chris) - Disable the slow internal-panels subtests testing all combinations. (Petri) v3: (Maarten) - Skip the internal-panels subtests if no internal panels are found. - Also test transitions with all planes disabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103334 Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-10-24tests/kms_atomic_transition: Do not update unbound planes.Maarten Lankhorst
kms_atomic_transition was updating already disabled planes and committing them nonblockingly. This results in sporadic -EBUSY failures because planes that are unbound have their own timeline. The solution is not unbinding already unbound planes, making the test pass. There was also a related kernel bug causing failures in the same way, but that is now fixed. While at it, only check for fd completion in the nonblocking case, in the blocking case it's theoretically possible the commit completes before we check the that the commit didn't complete, most probably when the test is run in a debugger. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102671 Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-10-20lib/igt_kms: Rework pipe properties to be more atomic, v7.Maarten Lankhorst
In the future I want to allow tests to commit more properties, but for this to work I have to fix all properties to work better with atomic commit. Instead of special casing each property make a bitmask for all property changed flags, and try to commit all properties. This has been the most involved one, since legacy pipe commit still handles a lot of the properties differently from the rest. Changes since v1: - Dump all changed properties on commit. - Fix bug in igt_pipe_refresh(). Changes since v2: - Set pipe ACTIVE property changed flag on init. Changes since v3: - Add a missing igt_pipe_refresh() to kms_atomic_interruptible. Changes since v4: - Perform error handling when setting custom crtc properties. Changes since v5: - Only attempt to commit changes properties. Changes since v6: - Clear OUT_FENCE_PTR on succesful commit. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-10-03lib/igt_kms: Change output->pending_crtc_idx_mask to output->pending_pipeMaarten Lankhorst
igt_output_set_pipe with PIPE_ANY used to mean that we bind the output to any pipe, but this is now a deprecated alias for PIPE_NONE, and means the output will be unbound. Because of this it's better to change output->pending_crtc_idx_mask to an enum pipe, because only a single choice may be given for a pipe. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-10-02tests: Stop looking at plane private membersMaarten Lankhorst
Most of these tests have no reason to look at those members, so try other ways of getting the information. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-07-10igt/kms: Do not wait for fence completion during commitMaarten Lankhorst
This will make the IGT tests that use fences more useful, since they can perform the waiting themselves when required. To celebrate, also add plane-use-after-nonblocking-unbind-fencing, the fence version of plane-use-after-nonblocking-unbind. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Gustavo Padovan <gustavo.padovan@collabora.com>
2017-07-10tests/kms_atomic_transition: Do not clear in-fences after atomic commit.Maarten Lankhorst
This is already done in igt_display_commit* functions. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Gustavo Padovan <gustavo.padovan@collabora.com>
2017-07-10tests/kms_atomic_transition: Only request fence on enabled pipesMaarten Lankhorst
Trying to set a fence on disabled pipes will be rejected by the kernel: [ 1275.865029] [drm:drm_atomic_check_only [drm]] [CRTC:39:pipe B] requesting event but off Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99911 Acked-by: Gustavo Padovan <gustavo.padovan@collabora.com>
2017-07-10tests/kms_atomic_transition: Add test for plane completion ordering.Maarten Lankhorst
When a plane gets disabled, that commit has to complete before an atomic commit on that disabled plane only. Else for the old commit, new_plane_state may have been freed. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Gustavo Padovan <gustavo.padovan@collabora.com>
2017-07-04tests/kms_atomic_transitions: Use igt_display_require_output().Maarten Lankhorst
Use the convenience function instead of handrolling it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-06-16tests: Rename I915_MAX_PIPES to IGT_MAX_PIPESLeo (Sunpeng) Li
Name should not be driver-specific. Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-04-07tests/kms_*: Use correct DRM context versionDaniel Stone
DRM_EVENT_CONTEXT_VERSION is the latest context version supported by whatever version of libdrm is present. igt was blindly asserting it supported whatever version that may be, even if it actually didn't. With libdrm 2.4.78, setting a higher context version than 2 will attempt to call the page_flip_handler2 vfunc if it was non-NULL, which being a random chunk of stack memory, it might well have been. Set the version as 2, which should be bumped only with the appropriate version checks. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-03-21Restore "lib: Open debugfs files for the given DRM device"Chris Wilson
This reverts commit 25fbae15262cf570e207e62f50e7c5233e06bc67, restoring commit 301ad44cdf1b868b1ab89096721da91fa8541fdc Author: Tomeu Vizoso <tomeu.vizoso@collabora.com> Date: Thu Mar 2 10:37:11 2017 +0100 lib: Open debugfs files for the given DRM device with fixes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-21Revert "lib: Open debugfs files for the given DRM device"Tomeu Vizoso
This reverts commit 301ad44cdf1b868b1ab89096721da91fa8541fdc. When a render-only device is opened and gem_quiescent_gpu is called, we need to use the debugfs dir for the master device instead. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2017-03-21lib: Open debugfs files for the given DRM deviceTomeu Vizoso
When opening a DRM debugfs file, locate the right path based on the given DRM device FD. This is needed so, in setups with more than one DRM device, any operations on debugfs files affect the expected DRM device. v2: - rebased and fixed new API additions v3: - updated chamelium test, which was missed previously - use the minor of the device for the debugfs path, not the major - have a proper exit handler for calling igt_hpd_storm_reset with the right device fd. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Robert Foss <robert.foss@collabora.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-27tests/kms_atomic_transition: Add missing variable declarationDorota Czaplejewicz
Signed-off-by: Dorota Czaplejewicz <dorota.czaplejewicz@collabora.co.uk> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-02-27kms_atomic_transition: Add test for primary plane togging vs vblank.Maarten Lankhorst
When enabling atomic rmfb a bug was found where vblank waits were timing out. Add a testcase that tests if vblanks work regardless of primary plane visibility. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-02-20kms_atomic_transition: Initialize pipe_crcs to avoid segfaultBrian Starkey
igt_pipe_crc_new() is skipped for non-Intel devices, but the later calls to collect_crcs_mask() will attempt to retrieve CRC values if the pipe_crcs pointers are non-NULL. Zero-initialise pipe_crcs to avoid accessing garbage pointers on non-Intel devices. Signed-off-by: Brian Starkey <brian.starkey@arm.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-02-07kms_atomic_transition: Only call unprepare_fencing when prepare_fencing is ↵Maarten Lankhorst
called. Else we get a null pointer deref on the other tests. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-02-03kms_atomic_transition: Do not use vblank->reserved.Maarten Lankhorst
I used it for prototyping a patch locally, was never meant to be upstreamed without upstream support. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-02-02tests/kms_atomic_transition: add in_fences testsGustavo Padovan
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-02-02tests/kms_atomic_transition: add out_fences testsRobert Foss
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-02-02tests/kms_atomic_transition: add fencing parameter to run_transition_testsGustavo Padovan
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-02-02tests/kms_atomic_transition: use igt timeout instead of blockingGustavo Padovan
If the event never arrives we can timeout and end the test. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-01-31tests/kms_atomic_transition: Add support for dynamic number of planesRobert Foss
Add changes reflecting the new support for dynamic number of planes per pipe. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2016-11-29kms_atomic_transition: Only run tests on valid pipes.Maarten Lankhorst
Fixes hangs on systems with less pipes, oops! Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-11-29kms_atomic_transition: Fix compileMaarten Lankhorst
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-11-29kms_atomic_transition: Add test timeout to run_modeset_testsMaarten Lankhorst
This fixes the hang on kms_atomic_transitions.1x-modeset-transitions. Underlying cause still needs more looking at.. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-11-23kms_atomic_transition: Respect limits for sprite planes on earlier platforms.Maarten Lankhorst
Usually there is a maximum amount of width/height that a sprite plane can have, and on earlier platforms alpha sprite planes are usually unsupported. In case of SKL+ and VLV/CHV this is handled by only setting a maximum width, but on earlier platforms there's a hardware limitation for stride, width and height. Handle this by starting from cursor dimensions, and then increase width to max, followed by height to max. If the TEST_ONLY commit fails immediately with -EINVAL with cursor width/height in ARGB format, assume that ARGB is unsupported and fallback to XRGB. If that fails too fail the test. This should allow tests to pass on all earlier platforms too. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-08-22kms_atomic_transition: Add modeset tests for all plane combinations.Maarten Lankhorst
With the new patch series by Lyude for fixing SKL watermarks it was shown that watermarks for disabled planes may not be updated correctly on modeset. Ensure that this is tested by doing a test similar to plane-all-transition, but with modesets! Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-08-11kms_atomic_transition: Add nonblocking tests for plane transitionsMaarten Lankhorst
There is a potential race between place transitions and nonblocking modesets, so try nonblocking tests for those too. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-08-11kms_atomic_transition: Add modeset tests too.Maarten Lankhorst
Try a series of tests in which we try to enable any combination of crtc enabled. {1,2,3}x-modeset-transitions will run any combination of enabled crtc's to and from the number being tested. Any lower amount is skipped. Extra -nonblocking tests are added, which perform the same modeset tests with nonblocking commit. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-07-26kms_atomic_transition: run correctly when hitting hw limitsMaarten Lankhorst
On CHV with a 4K hdmi display it's possible to hit the wm upper limit, 1 rgb primary plane + 2 full size rgb secondary planes will hit a HW limit. To fix this try halving the horizontal width until we're below HW limits. This requires a kernel patch to make sure that the kernel considers actual width in wm calculations, but without it we get FIFO underruns anyway. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-07-26tests: Add kms_atomic_transitionMaarten Lankhorst
This is meant as a stress test, to ensure that all combinations of atomic transitions work correctly. This could be useful for other drivers too, so I kept it generic. For i915 this will mainly be a stress test on watermark calculations. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>