summaryrefslogtreecommitdiff
path: root/tests/kms_async_flips.c
AgeCommit message (Collapse)Author
2022-06-16tests/kms_async_flips: first async flip discarded on i915Arun R Murthy
The i915 KMD will use the first async flip to update the watermarks as per the watermark optimization in DISPLAY13. Hence the actual async flip will happen from the subsequent flips. For alternate sync async test, a dummy async flip has to be done to allow the KMD to perform the watermark related updates before writing to the surface base address. Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com> Reviewed-by: Karthik B S <karthik.b.s@intel.com>
2022-06-09tests/kms_async_flips: Test RefactoringKarthik B S
Replace drm function call with existing library functions igt_display_reset() before all subtests v2: -Move conversion to dynamic subtest to a separate patch (Bhanu) -Use igt_output_get_mode to get default mode (Bhanu) -Add 'is_atomic' check before igt_display_commit2 (Bhanu) v3: -Move test_init after the checks to skip subtest (Bhanu) -Update the logic to call make_fb() in test_init() v4: -Move patch after patch to convert tests to dynamic to avoid code duplicaton. (Bhanu) v5: -Update commit message. (Bhanu) -Move skip checks in the dynamic subtests before the start of the subtest to optimize the test. (Bhanu) -Close drm_fd at the end of the subtest. v6: -Fix identation for braces. (Andre) v7: -Remove '-' from commit description. (Kamil) Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: André Almeida <andrealmeid@igalia.com>
2022-06-09tests/kms_async_flips: Convert tests to dynamicKarthik B S
Convert test to dynamic subtests at pipe-output level. Also, restrict the test to run with one output by default. Add support to run on all outputs using the extended flag. v2: -Get the mode after igt_display_reset() (Bhanu) v3: -Move patch to start of series to avoid code duplication (Bhanu) -Use for_each_pipe() instead of for_each_pipe_static() (Bhanu) v4: -Add helper to avoid code duplication (Andre) v5: -Add more details in the commit message (Kamil) Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: André Almeida <andrealmeid@igalia.com>
2022-05-24tests/kms_async_flips: Support more vendorsAndré Almeida
kms_async_flips uses igt_draw_ and i915 modifiers, which make this test fails for other vendors that are not Intel. Use more generic functions and modifiers so other devices can be tested. Since i915's "Linear memory does not support async flips", we can't use DRM_FORMAT_MOD_LINEAR and need to keep using I915_FORMAT_MOD_X_TILED. Signed-off-by: André Almeida <andrealmeid@igalia.com> Reviewed-by: Melissa Wen <mwen@igalia.com> Reviewed-by: Alex Hung <alex.hung@amd.com>
2022-03-28Revert "tests/kms_async_flips: Make the crc test faster"Karthik B S
This reverts commit 9cb64a757d2ff1e180b1648e611439d94afd697d. This patch was added to speed up the test and get better results with shard-skls. But even with this we're still seeing failure on shard-skl. Also, with this change we're seeing commit failure on setups having HDMI displays connected. Although the failure is not caused by this patch, reverting this patch anyway as we're not getting the intended improvement on shard-skl as well. Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-02-18tests/kms_async_flips: Make the crc test fasterVille Syrjälä
Use a smaler mode for the crc test so we don't have to draw so many pixels. Gives me 50% more flips on a tgl with 4k screen. Hopefully this help out those poor shard-skls a bit. Reviewed-by: Karthik B S <karthik.b.s@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-02-18tests/kms_async_flips: Fix the crc test vblank requestVille Syrjälä
The test fails to populate the horrible vblank ioctl flags correctly unless it happens to be running on the first crtc. Use the helper we have to cook up the necessary magic flags. Should make the test work on some CHV machines that have to use pipe C due to their restricted pipe->port routing capabilities. Reviewed-by: Karthik B S <karthik.b.s@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-11-03tests/kms_async_flips: Skip test when running with Intel's PSR2 selective ↵José Roberto de Souza
fetch enabled Intel's PSR2 selective fetch adds other planes to state when necessary, causing the async flip to fail because async flip is not supported in cursor plane. v2: - adding a description to the skip message Cc: Petri Latvala <petri.latvala@intel.com> Cc: Karthik B S <karthik.b.s@intel.com> Cc: Vandita Kulkarni <vandita.kulkarni@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2021-10-11igt: s/DRM_FORMAT_MOD_NONE/DRM_FORMAT_MOD_LINEAR/Ville Syrjälä
DRM_FORMAT_MOD_LINEAR is the more sensible name for DRM_FORMAT_MOD_NONE. Use the better name. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-09-27tests/kms_async_flips: Add CRC test to make sure the correct fb is being ↵Ville Syrjälä
scanned out Use CRC to confirm that the old fb is no longer being scanned out after the async flip completes. We do this by immediately rendering garbage into the old fb after receiving the flip event. Should fail if someone is improperly using mailbox style flips while claiming to do async flips. v2: Only fill a single column of pixels instead of the whole fb to allow the test to do more async flips per frame for a more stressful experience Reviewed-by: Karthik B S <karthik.b.s@intel.com> #v1 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-07-15Nuke local versions of DRM_FORMAT and DRM_MODELucas De Marchi
Use the definition from kernel headers. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-07-15Remove local copies of I915 macrosLucas De Marchi
Just use the one from the kernel headers. Updated with: git grep -l LOCAL_I915 | \ xargs sed -i -e '/^#define LOCAL_I915/d' -e 's/LOCAL_\(I915[[:alnum:]_]*\)/\1/g' Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-04-29tests/kms_async_flips: Fix flip timestamp checksVille Syrjälä
Check the flip timestamp from the event (not the time we got the event) against the vblank timestamps. Also if things are going well we should expect the flip timestamp to in fact match the first vblank timestamp, so allow them to be equal. Cc: Karthik B S <karthik.b.s@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2021-01-22tests/kms_async_flips: Skip the Y<->X tile test on pre-sklVille Syrjälä
Pre-skl display engine does not support Y-tiling so the addfb will fail. Skip the test on such platforms. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2020-11-20tests/kms_async_flips: Modify assert to fix failure seen on few platformsKarthik B S
Failure is seen on CI on few platforms as one of the flips in between is taking longer time. To fix this, added a check to assert for individual flips only for the alternate-sync-async-flip subtest. In the async-flip-with-page-flip-events subtest we anyway check the overall FPS at the end, so we do not need a check for individual flips and this should take care of some random flip taking more time in between. Also, reduced the MIN_FLIPS_PER_FRAME from 8 to 5 based on the failure seen in CI. Bug: https://gitlab.freedesktop.org/drm/intel/-/issues/2521 Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Kunal Joshi <kunal1.joshi@intel.com>
2020-09-25tests/kms_async_flips: Add test to validate asynchronous flipsKarthik B S
Asynchronous flips are issued using the page flip IOCTL. The test consists of two subtests. The first subtest waits for the page flip event to be received before giving the next flip, and the second subtest doesn't wait for page flip events. The test passes if the IOCTL is successful. v2: -Add authors in the test file. (Paulo) -Reduce the run time and timeouts to suit IGT needs. (Paulo) -Replace igt_debug's with igt_assert's to catch slow flips. (Paulo) -Follow IGT coding style regarding spaces. (Paulo) -Make set up code part of igt_fixture. (Paulo) -Skip the test if async flips are not supported. (Paulo) -Replace suggested-by. (Paulo) -Added description for test and subtests. v3: -Rename the test to kms_async_flips. (Paulo) -Modify the TODO comment. (Paulo) -Remove igt_debug in flip_handler. (Paulo) -Use drmIoctl() in has_async function. (Paulo) -Add more details in igt_assert in flip_handler. (Paulo) -Remove flag variable in flip_handler. (Paulo) -Call igt_assert in flip_handler after the warm up time. v4: -Calculate the time stamp in flip_handler from userspace, as the kernel will return vbl timestamps and this cannot be used for async flips. -Add a new subtest to verify that the async flip time stamp lies in between the previous and next vblank time stamp. (Daniel) v5: -Add test that alternates between sync and async flips. (Ville) -Add test to verify invalid async flips. (Ville) -Remove the subtest async-flip-without-page-flip-events. (Michel) -Remove the intel gpu restriction and make the test generic. (Michel) v6: -Change the THRESHOLD from 10 to 8 as failures are seen on CI on platforms <= gen10. -In older platforms(<= gen10), async address update bit in plane ctl is double buffered. Made changes in subtests to accomodate this. -Moved the igt_assert from flip_handler to individual subtest as we now have four subtests and adding conditions for the assert in flip handler is messy. v7: -Change flip_interval from int to float for more precision. -Remove the fb height change case in 'invalid' subtest as per the feedback received on the kernel patches. -Add subtest to verify legacy cursor IOCTL. (Ville) v8: -Add a cursor flip before async flip in cursor test. (Ville) -Make flip_interval double for more precision as failures are seen on older platforms on CI. v9: -Replace BUFS macro. (Ville) -Query cursor resolution from the kernel. (Ville) -Rename THRESHOLD to MIN_FLIPS_PER_FRAME. (Ville) -Use XRGB8888 instead of ARGB8888. (Ville) -Rename has_monotonic_timestamp to require_monotonic_timestamp. (Ville) -Make logic in alternate_sync_async subtest more readable. (Ville) -Rename get_vbl_timestamp_us() function. (Ville) -Rename has_async() to has_async_flip. (Ville) -Make data_t static. (Ville) -Fix leaking fb and res pointers. (Ville) -Remove async_capable variable. (Ville) -Move initialization to a function. (Ville) -Have a generic has_drm_cap() helper. (Ville) -Warm up logic removed. -Added TODO's for follow up work. v10: -Move flip timestamps inside data_t. (Ville) -Remove the redundant first flip in invalid subtest. (Ville) v11: -Pass cap ID to the igt_has_drm_cap helper instead of the whole structure. (Ville) -Fix the patch ordering. (Ville) Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Karthik B S <karthik.b.s@intel.com> [vsyrjala: Fix integer vs. pointer mismatch] Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>