summaryrefslogtreecommitdiff
path: root/tests/kms_concurrent.c
AgeCommit message (Collapse)Author
2022-05-20tests/kms_concurrent: Skip the subtest if the resolution is not supportedNidhi Gupta
The kms_concurrent is about testing mode setting with reducing the resolution and then again increasing it, for this the test will take the high resolution supported by the connector and then calculate the lowest resolution, if the calculated resolution is not supported by the connector it will assign the default resolution of 1024x 768 without checking. Added check to skip the subtest if the current mode is smaller than 1024 mode (igt_skip_on_f(mode_default->vdisplay < 1024)) becuase if the default resolution is greater then the highest resolution supported by the connector then the test should skip. Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com> Reviewed-by: Karthik B S <karthik.b.s@intel.com>
2022-05-20tests/kms_concurrent: For i915 devices run allocator in multiprocess modeZbigniew Kempczyński
Test calls igt_fork() so for i915 requires offset allocation arbitration (allocator in multiprocess mode) especially when same drm fd is used in children. Dedicated thread (intel_allocator_multiprocess_start()) is required to be started on the very beginning to handle offset allocations as well as stopping it (intel_allocator_multiprocess_stop()) before test exits. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Luciano Coelho <luciano.coelho@intel.com> Cc: Swati Sharma <swati2.sharma@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Tested-by: Luciano Coelho <luciano.coelho@intel.com>
2022-04-25tests/kms : Added dynamic test casesNidhi Gupta
Modified kms_sequence and kms_concurrent to include dynamic test cases. Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com> Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
2022-04-25tests/kms: sanitize the system state between subtestsNidhi Gupta
Before running the subtest we need to sanitize the system state to default, since we can't trust the state of previous subtest, used igt_display_reset() to sanitize the state. Replace newly defined function in particular test with existing library function. Below tests are modified: tests/kms_concurrent.c tests/kms_sequence.c Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com> Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
2022-03-28tests/kms_concurrent: check if second primary plane is validAbhinav Kumar
prepare_planes() in kms_concurrent loops through the list of planes and assigns them to the data->plane array. During this assignment, it skips planes which are of type DRM_PLANE_TYPE_PRIMARY as they are assigned separately. However, only one primary plane is assigned and prepared for the test. This causes an issue later on in the test when there are multiple primary planes as the second one is not added to the data->plane list causing a segmentation fault when trying to access the second primary plane. Check if the data->plane is valid before accessing its members to fix this crash. This fixes the crash and makes kms_concurrent pass on devices having multiple primary planes. localhost /usr/local/libexec/igt-gpu-tools # ./kms_concurrent IGT-Version: 1.26-NO-GIT (arm) (Linux: 5.17.0-rc2-lockdep-75821-g6200d34d858f aarch64) Starting subtest: pipe-A Testing resolution with connector eDP-1 using pipe A with seed 1648151339 Subtest pipe-A: SUCCESS (0.429s) Starting subtest: pipe-B Testing resolution with connector eDP-1 using pipe B with seed 1648151340 Subtest pipe-B: SUCCESS (0.592s) Test requirement not met in function igt_require_pipe, file ../igt-gpu-tools-9999/lib/igt_kms.c:2135: Test requirement: !(pipe >= display->n_pipes || !display->pipes[pipe].enabled) Pipe C does not exist or not enabled Subtest pipe-C: SKIP Test requirement not met in function igt_require_pipe, file ../igt-gpu-tools-9999/lib/igt_kms.c:2135: Test requirement: !(pipe >= display->n_pipes || !display->pipes[pipe].enabled) Pipe D does not exist or not enabled Subtest pipe-D: SKIP Test requirement not met in function igt_require_pipe, file ../igt-gpu-tools-9999/lib/igt_kms.c:2135: Test requirement: !(pipe >= display->n_pipes || !display->pipes[pipe].enabled) Pipe E does not exist or not enabled Subtest pipe-E: SKIP Test requirement not met in function igt_require_pipe, file ../igt-gpu-tools-9999/lib/igt_kms.c:2135: Test requirement: !(pipe >= display->n_pipes || !display->pipes[pipe].enabled) Pipe F does not exist or not enabled Subtest pipe-F: SKIP changes in v2: - add a comment on to explain the NULL check Reviewed-by: Mark Yacoub <markyacoub@chromium.org> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
2021-10-18tests/kms_concurrent: Use preferred modes's vrefreshVille Syrjälä
i915 will reject custom modes that don't match the laptop panel's fixed mode refresh rate. Thus we must generate our override modes with a matching refresh rate. Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4284 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-10-18lib/kms: Have igt_std_1024_mode_get() return a mode with specific refreshVille Syrjälä
Pass the desired refresh rate to igt_std_1024_mode_get(), and have it return a mode that will have said refresh rate. Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-10-18lib/kms: Have igt_std_1024_mode_get() return a copy of the modeVille Syrjälä
We want to provide override modes with different refresh rates. Start by making igt_std_1024_mode_get() return a copy rather than a pointer to the static const mode directly. And sprinkle the necessary free() calls, and some igt_memdups() into parallel codepaths, so we are consistnetly allocating and freeing everything. Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-10-11igt: s/tiling/modifier/ all overVille Syrjälä
Use a more reasonable variable name for modifiers. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.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-24tests/kms_concurrent: Fix regression in test_resolution_with_outputVidya Srinivas
Staring commit fea0e38e690c30c6 "Making the test more generic" test_resolution_with_output introduced setting igt_output_set_pipe to PIPE_NONE. This is triggering atomic check failure resulting in "enabled/connectors mismatch" under drm_atomic_helper_check_modeset. Patch fixes this issue. Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com> Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Tested-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
2021-08-31tests/kms_concurrent: Making the test more genericRodrigo Siqueira
Currently, the "kms_concurrent" does not work in non-intel drivers due to using specific modifiers and operations related to i915. This commit removes some of these particular codes in order to make them generic for other drivers. After applying this change, kms_concurrent passed on AMD hardware and VKMS. Changes since V1: - Use DRM_FORMAT_MOD_LINEAR instead of DRM_FORMAT_MOD_NONE Cc: Harry Wentland <harry.wentland@amd.com> Cc: Nicholas Choi <Nicholas.Choi@amd.com> Cc: Sean Paul <seanpaul@chromium.org> Cc: Mark Yacoub <markyacoub@chromium.org> Cc: Melissa Wen <melissa.srw@gmail.com> Cc: Arkadiusz Hiler <arek@hiler.eu> Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Reviewed-By: Nicholas Choi <Nicholas.Choi@amd.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-19Added test description for kms testsNidhi Gupta
Added description for following tests: tests/kms_atomic.c tests/kms_concurrent.c tests/kms_content_protection.c tests/kms_fbcon_fbt.c tests/kms_getfb.c tests/kms_lease.c tests/kms_panel_fitting.c tests/kms_pipe_b_c_ivb.c tests/kms_plane_lowres.c tests/kms_plane_scaling.c tests/kms_prop_blob.c tests/kms_rmfb.c tests/kms_sequence.c tests/kms_vrr.c tests/kms_pipe_crc_basic.c tests/kms_plane_alpha_blend.c tests/kms_draw_crc.c tests/kms_tv_load_detect.c tests/kms_busy.c tests/kms_force_connector_basic.c tests/kms_setmode.c Signed-off-by: Nidhi Gupta <nidhi1.gupta@intel.com> Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
2021-02-24tests: Make .seed unsignedVille Syrjälä
srand() takes an unsigned int, so let's make our seed such. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2021-02-24tests: Remove pointless struct member initializationVille Syrjälä
Initializing the seed and user_seed is pointless; .user_seed already defaults to false, and .seed will get overwritten anyway. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2021-02-24tests/kms_concurrent: Actually seed the rngVille Syrjälä
Add the missing srand() call to actually seed the random number generator. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2020-07-21tests/kms: Skip kms test cases for disabled pipesMohammed Khajapasha
Skip the kms test cases for disabled pipes with non-contiguous pipe display. Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-07lib/igt_fb: remove extra parameters from igt_put_cairo_ctxMelissa Wen
The function igt_put_cairo_ctx currently requires three parameters, but only one of them is used in it. This patch removes the useless parameters, making the code more readable and cohesive. It also applies the change to all occurrences of the function in the code. Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-04-09tests/kms_concurrent: Use maximum number of planes that display/platform ↵Mika Kahola
combination supports There was an error in commit 0ab05a51a059 ("tests/kms_concurrent: Test for maximum number of planes") that calculates the maximum number of supported planes. The patch proposes to test first if an atomic commit is successful with the selected number of planes. In case of a failure, the number of planes is reduced by one assuming that the failure was caused by bandwidth limit. The test loops at least as many iterations as there are planes defined by the platform. v2: Fix CI build failure (CI) Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
2020-04-09Revert "tests/kms_concurrent: Test maximum number of planes supported by the ↵Mika Kahola
platform" This reverts commit 2b65609b1de355ca501b58b7b03208f81c87b585. Signed-off-by: Mika Kahola <mika.kahola@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2020-03-27tests/kms_concurrent: Plug possible memory leaksMika Kahola
Free dynamically allocated memory that has a potential to leak memory. Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2020-03-27tests/kms_concurrent: Test maximum number of planes supported by the platformMika Kahola
There was an error in commit 0ab05a51a059 ("tests/kms_concurrent: Test for maximum number of planes") supported planes. This patch proposes a fix to this commit by first computing the number of planes that are within platform's bandwidth requirements, resets the display and then executes the actual testing. v2: Remove uninitialized variable (Stan) v3: Fix styling for commit reference (checkpatch) Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2020-03-20tests/kms_concurrent: Test for maximum number of planesMika Kahola
In some cases we ran out of bandwidth when executiong a test. An error such as this can be seen on dmesg "Bandwidth 16632 MB/s exceeds max available 6553 MB/s (7 active planes)" The patch tests first, how many planes the platform can support with the given resolution. The actual test is then performed by using the calculated maximum number of planes instead of maximum number of planes that the platform supports. Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2020-01-28tests/kms_concurrent: Move simultaneously allowed planes to main threadMohammed Khajapasha
High resolution consumes more bandwidth so if amount of max planes is calculated during low resolution switch back to high resolution will immediately fail with bandwidth problem. To avoid bandwidth exceed,move the simultaneously allowed planes to before switching to low resolution mode in main thread. Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2019-12-03tests/i915/kms: remove igt_skip_on_simulation()Swati Sharma
Removing igt_skip_on_simulation() from all the kms tests since this feature is not supported anymore. v2: Rebase Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-05-27kms_concurrent: Nuke custom main functionPetri Latvala
Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-04-02tests/kms_concurrent: Allow the test to proceed with fewer planesVille Syrjälä
We may not be able to enable all the planes simultaneously. In that case just keep going with fewer planes. The test already requires atomic so let's use TEST_ONLY unconditionally. Reviewed-by: José Roberto de Souza <jose.souza@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-04-01lib: Share the 1024x768 mode among testsJosé Roberto de Souza
Three test were duplicating this 1024x768 mode so lets move it to lib and share it. Reviewed-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-21tests: Use correct type for callocPetri Latvala
No actual difference, size of a pointer is the same as pointer-to-pointer. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Mika Kahola <mika.kahola@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
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-02-01lib/igt_fb: Add igt_put_cairo_ctx as counter to igt_get_cairo_ctxMaarten Lankhorst
This will allow support for NV12 in the future, where igt_get_cairo_ctx will return a RGB image to draw with, which will be converted in igt_put_cairo_ctx so tests don't have to add special support for NV12. This is the same as cairo_destroy + checking for errors, but not all tests use this correctly so it's better to have a single handler for it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-10-20tests/kms_concurrent: Fix testcase fails.Maarten Lankhorst
igt_pipe_refresh was added for the forked helper, we could just call it from the fork to prevent races against MODE_ID. The static 1024x768 mode is allocated on the stack and returned, which will result in a garbage mode. Make the fallback mode global to prevent this. igt_output_set_pipe is unneeded, override_mode is enough to force the right mode. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103342 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-08-14lib/kms: Add for_each_pipe_staticDaniel Vetter
for_each_pipe cannot be used for enumerating testcases, so provide something that can. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Petri Latvala <petri.latvala@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-06-16tests: Increase value of I915_MAX_PIPES to 6Leo (Sunpeng) Li
Increasing max pipe count to 6 to support AMD GPU's. Since some tests' behavior depends on this value, small changes are made to remove this dependency: * kms_ccs: Early abort if wanted_pipe is out-of-bounds. * kms_concurrent: Check if pipe is within bounds first. * kms_pipe_color: Prevent skipping of subsequent tests by placing generated tests in a 'igt_subtest_group'. * kms_plane: Move pipe and plane index checking to subtest group level. v2: Change invalid pipe check on kmstest_pipe_name() to use I915_MAX_PIPE v3: Change tabs to spaces in 'enum pipe' Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Tested-by: Tomi Sarvela <tomi.p.sarvela@intel.com>
2017-05-03tests/kms_concurrent: Concurrent and interruptible subtests for atomicMika Kahola
This test case introduces concurrently running test cases for atomic modesetting. The first test or thread draws blue backround with black holes on it. These holes are covered by rectangular, blue planes that are placed randomly like in test case 'kms_plane_multiple'. The second thread changes resolution from higher to lower one and back. For: VIZ-7022 v2: use igt_fork instead of pthreads to create concurrent test runs (Maarten) v3: use igt_display calls instead of raw drm calls for display updates (Maarten) Various cleanups on accessing drm connector (Maarten) Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>