summaryrefslogtreecommitdiff
path: root/tests/kms_atomic.c
AgeCommit message (Collapse)Author
2021-12-13tests/kms_atomic: Add a new test case for FB_DAMAGE_CLIPS plane propertyDeepak Rawat
Some simple test cases to use FB_DAMAGE_CLIPS plane property. Issue a plane update with damage with a clips on different scenarios and verify the state. v2: use drm_mode_rect instead of local struct and array instead of malloc. Signed-off-by: Deepak Rawat <drawat@vmware.com> Signed-off-by: Jeevan B <jeevan.b@intel.com> Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
2021-11-16Revert "test/kms_atomic: Skip plane overlay test for amdgpu"Rodrigo Siqueira
This reverts commit 080869f804cb86b25a38889e5ce9a870571cd8c4. Thanks to Simon's patch to amd-staging-drm-next, we recently re-enabled overlay support in our driver. We don't need to skip overlay tests in the kms_atomic anymore; for this reason, this commit reverted the skip when we have overlay tests. Cc: Simon Ser <contact@emersion.fr> Cc: Harry Wentland <harry.wentland@amd.com> Cc: Nicholas Choi <Nicholas.Choi@amd.com> Cc: Hayden Goodfellow <Hayden.Goodfellow@amd.com> Cc: Mark Yacoub <markyacoub@chromium.org> Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Reviewed-by: Simon Ser <contact@emersion.fr>
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-01tests/kms_atomic: igt_require_pipe_crc for plane_immutable_zposMark Yacoub
[Why] kms_atomic:plane_immutable_zpos subtest uses CRC in debugfs which is not supported by some drivers. [How] igt_require_pipe_crc before the test begins. Test: kms_atomic:plane-immutable-zpos on ChromeOS Trogdor(msm) Signed-off-by: Mark Yacoub <markyacoub@chromium.org> Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
2021-08-31test/kms_atomic: Skip plane overlay test for amdgpuRodrigo Siqueira
Currently, amdgpu does not support an overlay strategy. As a result, plane_overlay fails on amdgpu; since this is a driver limitation, this commit skips the overlay test for amdgpu. Changes since V1: - Improve skip message 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-08-31tests/kms_atomic: Initialize array values before checking themRodrigo Siqueira
Currently, the subtest plane-immutable-zpos fails due to a lack of initialization of a set of arrays allocated in the stack. Later on in the test, there is a check if some of the array components are NULL which is always false because of the random values in the memory. This commit fixes this issue by initializing all arrays with zero at the beginning of the plane_immutable_zpos function, and now it passes for amdgpu. 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-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-01-30meson: Turn on -WerrorAshutosh Dixit
We can choose which compile warnings to enable, but once they are enabled treat all warnings as error. This enforces stricter checks against compile warnings creeping in. v2: Fix redefinition warning errors from i915/gem_userptr_blits v3: Fix the even more pedantic clang compilation v4: Do not alter whitespace in lib/tests/igt_describe! Note: clang does not build assembler/ Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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-06tests/kms_atomic: Changed test names into standard conventionSwati Sharma
All the subtests in kms_atomic have test names in non-standard convention, changing those to standard convention. '-' is the normal delimeter in subtest names. Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2020-04-06tests/kms_atomic: Add test to validate immutable zposSwati Sharma
i915 implements immutable zpos property whereas the existing test case is written to validate mutable zpos. Added a new sub-test to validate immutable zpos. Test validates the reported zpos property of plane by making sure only higher zpos plane covers the lower zpos one (lower plane covers full screen, upper plane is 64x64). Only two planes at a time are tested in increasing fashion to avoid combinatorial explosion. By transitive property, if (p1, z1) < (p2, z2) and (p2, z2) < (p3, z3) then (p1, z1) < (p3, z3) where p and z denotes planes and zpos v2: -Removed intel only checks [Martin] -Used XRGB8888 pixel format as used in other IGTs -Added documentation [Martin] -Removed skip, instead continue if plane doesn't support zpos [Martin] -Sorted planes in increasing order of zpos [Martin] v3: -Fix description [Martin] -Avoid sorting [Ankit] v4: -Change in commit message [Ankit] -Few minor changes [Ankit] v5: -Use igt_assert_lt() and not plain assert [Petri] -Changed upper plane to 64x64 [Ville] -Removed no-use break condition [Ville] -Enabled cursor test testing too, changed pixel format to ARGB8888 from XRGB8888 [Ville] -New FBs at every iteration is pointless, removed [Martin, Ville] v6: -Version 5 brought regression to legacy platforms, changed pixel format to XRGB8888 and skipped cursor plane validation as of now TODO: Enable cursor plane validation Issue: https://gitlab.freedesktop.org/drm/intel/issues/404 Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2019-03-13kms_atomic: Add subtest for testing zpos plane propertyTomeu Vizoso
We use a 16-bit pixel buffer format for the overlay plane, as some older HW might not be capable of driving a 32-bit pixel format. Changes since v2: - use 0 for igt_paint_color_alpha() alpha parameter, as ARGB1555 uses just 1 bit for (of) alpha (Philipp Zabel) Changes since v1: - fix 'commitintg' with 'committing' (Philipp Zabel) - replace RGB565 with ARGB1555 (Philipp Zabel) - test plane if it supports the pixel format supplied (Philipp Zabel) Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
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-12lib/igt_fb: Add igt_fb_supported_format()Maarten Lankhorst
This makes it possible to iterate whether a format is supported or not, without each driver having to open code it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> Tested-by: Vidya Srinivas <vidya.srinivas@intel.com>
2018-02-05tests/kms_atomic: Add the test for CRTC_ID/FB_ID mismatch.Maarten Lankhorst
This check was missing, and caused a WARN_ON that dates back to the original design of atomic. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-10-20tests/kms_atomic: Convert/rewrite tests to use igt_kms framework, v2.Maarten Lankhorst
Now that we can set individual properties through the igt_kms api, we no longer need to duplicate functionality from igt_kms. Set invalid properties directly, and rewrite kms_atomic.c to use igt_display. This will allow us to remove a lot of code in kms_atomic.c, and benefit from how igt_kms can set up a valid configuration, instead of having to inherit it from fbcon. Changes since v1: - Fix test failure when atomic_invalid_params is run standalone. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Daniel Stone <daniels@collabora.com> [mlankhorst: Use kmstest_set_connector_dpms (mkahola)] Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-08-30tests/kms_atomic: subtest atomic_invalid_params requires CRTCMarta Lofstedt
Check for valid crtc is missing in igt@kms_atomic@atomic_invalid_params. This leads to segfault on machines where the subtest should be skipped. Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-06-28tests/kms_atomic: Add test for new DRM_MODE_PAGE_FLIP_EVENT behavior.Maarten Lankhorst
DRM_MODE_PAGE_FLIP_EVENT is now rejected if no CRTC is affected by the changes. Make sure the TEST_ONLY test keeps working, and test with DRM_MODE_PAGE_FLIP_EVENT. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-03-20tests/kms_atomic: test that TEST_ONLY does not clobber stateMika Kahola
We need to make sure that TEST_ONLY really only touches the free-standing state objects and nothing else. Test approach here is the following: - Create a config and submit it with TEST_ONLY. - do dpms off/on cycle with the current config to reconfigure hw - read back all legacy state to make sure none of that is clobbered v2: use ATOMIC_RELAX_NONE instead of CRTC_RELAX_MODE when checking crtc or plane state (Maarten) rename subtest and function that executes this test (Maarten) Signed-off-by: Mika Kahola <mika.kahola@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-02-03igt: Skip MI_STORE_DWORD_IMM on gen2Chris Wilson
On gen2 MI_STORE_DWORD_IMM operates on a physical, not virtual, address i.e. we can't use it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-02tests/kms_atomic: stress possible fence settingsGustavo 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: use global atomic properties definitionsGustavo 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>
2016-12-14igt/kms_atomic: Match CRTC harder for special planesDaniel Stone
Our heuristic for finding planes was previously matching the type, and ensuring that the plane was valid for that CRTC. However, VC4 now has primary/cursor planes which can wander multiple CRTCs, so we could pick a PRIMARY plane which was not the kernel's idea of crtc->primary, causing plane_primary_legacy to fail; ditto for cursor. Make find_plane try harder, by preferring to return planes which are already on the requested CRTC. Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Robert Foss <robert.foss@collabora.com>
2016-09-26kms_atomic: plane_primary: Allow modeset if atomic check returns -EINVALLiu Ying
Allowing modeset may prevent the test case from failing in case the atomic check phase finds the userspace doesn't allow modeset for the commit and returns -EINVAL. A real case is to run the test case on imx-drm which requires a full modeset when we change an active plane's configuration, e.g., pixel format and stride. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Marius Vlad <marius.c.vlad@intel.com> Cc: Micah Fedke <micah.fedke@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Signed-off-by: Liu Ying <gnuiyl@gmail.com>
2016-09-26kms_atomic: Expose atomic commit flags to crtc_commit_atomic()Liu Ying
This patch exposes atomic commit flags to crtc_commit_atomic() so that users of the macro may control the flags. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Marius Vlad <marius.c.vlad@intel.com> Cc: Micah Fedke <micah.fedke@collabora.com> Cc: Daniel Stone <daniels@collabora.com> Signed-off-by: Liu Ying <gnuiyl@gmail.com>
2016-04-20kms_atomic: Fix crtc_id comparison failing.Robert Foss
Fixed ctrc_id comparison failing due to bad initialization of crtc variable. Signed-off-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-14tests: Open any driverTomeu Vizoso
For those tests that now pass on drivers other than i915, call drm_open_driver_master with DRIVER_ANY. Also do so from igt_enable_connectors. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-04-05kms_atomic: Skip rather than fail on non-atomic driversMatt Roper
i915 does not yet support the atomic modesetting interface by default; at the moment it must be turned on explicitly via an 'i915.nuclear_pageflip' kernel command line option. We should skip (rather than fail) this IGT test when running on kernels that don't advertise support for atomic modesetting. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93014 Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-02-26kms_atomic: drop unnecessary connector looping from plane_primary testMatt Roper
Local variable num_connectors is never initialized before being auto-incremented in the loop. If we wind up with a non-zero garbage value, it will lead us to try to write to an out-of-bounds array index. We should probably initialize it to zero before use. However on closer inspection, the plane_primary test doesn't actually wind up using the connector list or number of connectors, so just remove the whole block of code; it was probably brought in by accident as part of a copy-paste operation. Cc: Daniel Stone <daniels@collabora.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-01-29tests/igt_fb: rename igt_get_all_formats to igt_get_all_cairo_formatsPaulo Zanoni
I recently had this discussion with Daniel where I didn't want to use igt_drm_format_to_bpp() because it uses the format_desc array, and igt_fb currently assumes that all the format_desc formats have a matching valid Cairo format, so I wouldn't be able to easily add formats such as ARGB2101010. The function that has the assumption mentioned above is igt_get_all_formats: its current users call igt_get_all_formats, and then call cairo-dependent functions, such as igt_get_cairo_ctx on the returned formats. In order to document the current behavior and prevent any problems in case we start adding new formats without matching Cairo versions to format_desc, rename igt_get_all_formats to igt_get_all_cairo_formats and make it explicitly check for CAIRO_FORMAT_INVALID. Requested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-08lib: Extract some common fb create+fill methods into helpersVille Syrjälä
Several tests do one or more of the following: * igt_create_fb() + igt_paint_test_pattern() * igt_create_color_fb() + igt_paint_test_pattern() * igt_create_fb() + igt_paint_image() Extract them into new helpers: igt_create_pattern_fb(), igt_create_color_pattern_fb(), igt_create_image_fb(). v2: Fix typos, and improve API docs (Thomas) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-03kms_atomic: Add basic atomic modesetting testsDaniel Stone
Add tests for KMS atomic modesetting, to exercise the basic interface and test failure/corner cases. Should ensure coherency between the legacy and atomic interfaces. v2: New patch. v3: Disable connector checking for now, as it was causing GPU hangs on newer kernels. v4: Rebase. v5: Use do_ioctl or do_ioctl_err consistently. Use igt_assert_*() helper macros rather than igt_assert() directly. Move assertions into helper/check functions. Define atomic commit helper. v6: Use do_ioctl_err, and define macros to move errors to actual callsite, rather than helper functions. Co-authored-by: Micah Fedke <micah.fedke@collabora.com> Signed-off-by: Daniel Stone <daniels@collabora.com>