summaryrefslogtreecommitdiff
path: root/tests/kms_cursor_crc.c
AgeCommit message (Collapse)Author
2022-07-06tests/kms_cursor_crc: Fix -Wformat-truncationAshutosh Dixit
[72/1181] Compiling C object tests/kms_cursor_crc.p/kms_cursor_crc.c.o ../tests/kms_cursor_crc.c: In function ‘run_size_tests.constprop’: ../tests/kms_cursor_crc.c:702:50: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size between 4 and 14 [-Wformat-truncation=] 702 | snprintf(name, sizeof(name), "%dx%d", w, h); | ^~ ../tests/kms_cursor_crc.c:702:46: note: directive argument in the range [-2147483648, 1024] 702 | snprintf(name, sizeof(name), "%dx%d", w, h); | ^~~~~~~ Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-06-22tests/kms_cursor_crc: Test CleanupBhanuprakash Modem
Sanitize the system state before starting the subtest. Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
2022-06-22tests/kms_cursor_crc: Convert tests to dynamicBhanuprakash Modem
Convert the existing subtests to dynamic subtests at pipe level. V2: * Fix nested igt_fixture in igt_subtest. V3: * Add output name to subtest Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Swati Sharma <swati2.sharma@intel.com>
2021-10-18tests/kms_cursor_crc: use same test path for alpha and size tests as all ↵Juha-Pekka Heikkila
other tests Use same test path for alpha and size tests as all other tests. This allow to remove duplicate code. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-10-18tests/kms_cursor_crc: take alpha into use when draw cursorJuha-Pekka Heikkila
Draw with alpha information included. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-10-18tests/kms_cursor_crc: move create_cursor_fb above alpha testsJuha-Pekka Heikkila
This is so it can be taken into use also in alpha tests. While at it take alpha into account on fb creation by clearing alpha to zero Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-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-08-19tests/kms_cursor_crc: Separate hw and sw runs on testsJuha-Pekka Heikkila
Reset display structure settings and commit them in before starting test in case some earlier test left tail. Separate hw and sw test runs for optimizing test. Simple cleanup. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Mika Kahola <mika.kahola@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-06-22tests/kms_cursor_crc: use flipping instead of frontbufferJuha-Pekka Heikkila
take out frontbuffer usage from this test as it may fail this test on frontbuffer related issues instead of cursor issues v2(vsyrjala): fix cursor size change test to run only one loop Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2021-04-19tests/kms_cursor_crc: Let's not create full screen framebuffers in a loopJuha-Pekka Heikkila
Avoid creating full screen size fbs in a loop just to throw them away. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2021-03-30tests/kms_cursor_crc: Test maximum cursor sizeVille Syrjälä
Run the standard set of tests using the max cursor size if the other tests didn't already cover it. v2: Use igt_require_f() to explain why the max-size tests skips (Lyude) Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-03-30tests/kms_cursor_crc: Extract run_size_tests()Ville Syrjälä
Refactor the common size tests into their own function and just call it twice. Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-03-30tests/kms_cursor_crc: Remove the max_w==max_h requirementVille Syrjälä
The test works fine even if the max cursor size is not square. Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-03-24tests/kms_cursor_crc: Test 32x32 cursorsLyude Paul
Since pre-nve4 only has two cursor sizes (32x32 and 64x64), we should at least test both of them. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Martin Peres <martin.peres@free.fr> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Jeremy Cline <jcline@redhat.com>
2021-03-24tests/kms_cursor_crc: Probe kernel for cursor size supportLyude Paul
Currently we just assume that every cursor size up to data->cursor_max_w/h will be supported by the driver, and check for support of nonsquare cursors by checking if we're running on i915 and if so, which variant of Intel hardware we're running on. This isn't really ideal as we're about to enable 32x32 cursor size tests for nouveau, and Intel hardware doesn't support cursor sizes that small. So, fix this by removing has_nonsquare_cursors() and replacing it with a more generic require_cursor_size() function which checks whether or not the driver we're using supports a given cursor size by attempting a test-only atomic commit. v3: * Also probe for cursor support on systems without atomic support Signed-off-by: Lyude Paul <lyude@redhat.com> Cc: Martin Peres <martin.peres@free.fr> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Jeremy Cline <jcline@redhat.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2021-03-18tests/kms_cursor_crc: Add vblank wait for restore imageMohammed Khajapasha
Add igt_wait_for_vblank() once restore image is done and frontbuffer mark as dirty. Cc: Juha-Pekka Heikkila <juha-pekka.heikkila@intel.com> Cc: Kahola, Mika <mika.kahola@intel.com> Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2020-09-10tests/kms_cursor_crc: Stripping rendercopy implementation to use cairoKamati Srinivas
Rendercopy implementation is stripped to use cairo for restoring image. With cairo, no more crc errors are observed and dead code is removed. Cc: Heikkila, Juha-pekka <juha-pekka.heikkila@intel.com> Signed-off-by: Kamati Srinivas <srinivasx.k@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2020-07-21tests/kms: Use crtc offset to read vblank event for a pipeMohammed Khajapasha
Pass crtc_offset parameter to read a vblank event for a pipe to vblank helper functions. Signed-off-by: Mohammed Khajapasha <mohammed.khajapasha@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-20test/kms_cursor_crc: release old pipe_crc before create a new oneMelissa Wen
When a subtest fails, it skips the cleanup, and its pipe_crc remains allocated. As a consequence, the following subtest also fails (timeout) when trying to create a new one. This patch releases any remaining pipe_crc to enable the creation of a new one for the next subtest. Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2020-07-16test/kms_cursor_crc: update subtests descriptions and some commentsMelissa Wen
Add descriptions for some subtests and detail a little more the comments in test_cursor_alpha. Signed-off-by: Melissa Wen <melissa.srw@gmail.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@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>
2019-12-31lib/igt_buf: Extend igt_buf to include two color surfacesImre Deak
UV FBs have two color surfaces so extend the igt_buf struct accordingly to support blitting such FBs. The patch is produced with the coccinelle patch below. No functional changes. @@ @@ struct igt_buf { ... - uint32_t stride; ... - uint32_t size; + struct { + uint32_t stride; + uint32_t size; + } surface[2]; ... }; @@ struct igt_buf b; @@ <... ( - b.stride + b.surface[0].stride | - b.size + b.surface[0].size ) ...> @@ struct igt_buf *b; @@ <... ( - b->size + b->surface[0].size | - b->stride + b->surface[0].stride ) ...> @@ identifier I; expression E1; expression E2; @@ ( struct igt_buf I = { - .size = E1, - .stride = E2, + .surface[0] = { + .size = E1, + .stride = E2, + }, }; | struct igt_buf I = { - .size = E1, + .surface[0] = { + .size = E1, + }, }; | struct igt_buf I = { - .stride = E1, + .surface[0] = { + .stride = E1, + }, }; ) v2: - Rebase on latest upstream. (Mika) Cc: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2019-12-30tests/kms_cursor_crc: Fix user space read too slow errorJuha-Pekka Heikkila
Having crc running continuously cause this test sometime fill crc buffer, fix this problem as well as do some generic cleanups. v2: Take out gem_sync() v3: Use rendercopy if available, otherwise Cairo surface for restoring test image v4: take out useless assert and restructure a bit Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.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-11-28tests/kms_cursor_crc: start crc only once per testJuha-Pekka Heikkila
starting pipe crc causes modeset on psr panels which take lot of time. Fix this by starting crc only in the beginning and stop at the end of test. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-11-13tests/kms_cursor: use safe values for test image to avoid rounding errorsJuha-Pekka Heikkila
instead of 0.5 use 1.0 for white color, this is due to bit replication effect. Also set cairo to use same blending mode as what HW uses. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2019-05-13tests/kms_cursor_crc: Use igt_kms calls for everything.Maarten Lankhorst
Instead of doing direct drm calls, we can use the core to do it for us. This can be used to increase logging verbosity, but it will also allow us to test on overlay planes by changing all references from DRM_PLANE_TYPE_CURSOR to DRM_PLANE_TYPE_OVERLAY. This fails on gen9-10 because of the alpha rounding error bug, but it can be useful for testing if the tests themselves are broken. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2019-05-13tests/kms_cursor_crc: Handle display cleanup in initMaarten Lankhorst
By handling display cleanup in init, we recover better when subtests fail. With igt_display_reset, a lot of custom cleanup is now gone, and we don't have to half-heartedly clean up at the end of every subtest. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2019-05-13tests/kms_cursor_crc: Run tests once per pipeMaarten Lankhorst
Instead of running tests on all pipes and all outputs, change the tests to only run once on each pipe, with igt_get_single_output_for_pipe() to select an output. This way we'll test all pipes and all outputs at least once, but not all combinations. This reduces the amount of time required for each test with dual/triple outputs. In order to reduce the test time further, only run the DPMS/suspend tests once for each pipe. They should not be dependent on cursor size. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
2019-02-04tests/kms_cursor_crc.c: Remove framebuffer at the end of the testMamta Shukla
Use igt_remove_fb(data->drm_fd, &data->fb) to remove locally created framebuffer at the end of the hardware test loop in test_cursor_size() function for cursor-size-change subtest in kms_cursor_crc. Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
2019-02-04tests/kms_cursor_crc.c: Improve test_cursor_alpha()Mamta Shukla
In the kms_cursor_crc, the subtest to check exterme alpha values failed due to different CRCs observed in hardware and software rendering. This patch fixes CRC mismatch error in cursor-alpha-opaque and cursor-alpha-transparent subtests by improving the order in which cursor was rendered in hardware test. Changes made in test_cursor_alpha() to ensure cursor rendering in hardware test and acquire CRC value: - Add drmModeSetCursor() to set cursor image. - Remove igt_display_commit() to reduce the chance of getting crc values cleared before it is acquired. - Add igt_remove_fb() to remove locally created framebuffer after disabling the cursor plane in HW test Also, aligned this function with test_cursor_size and after these changes got passing results for alpha blending support added in VKMS CRC API. Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109350
2019-01-12tests/kms_cursor_crc: Add test to check extreme alpha values for cursor planeMamta Shukla
Add test to check extreme alpha values i.e. fully opaque and fully transparent for cursor plane and verify by calculating hardware and software CRC. Signed-off-by: Mamta Shukla <mamtashukla555@gmail.com> Reviewed-by: Harry Wentland <harry.wentland@amd.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-08-21tests/kms_cursor_crc: Open DRM device with DRIVER_ANYHaneen Mohammed
So that this test can be run in drivers other than i915. Remove devid and only check it if the driver is i915. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@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-07-03tests/kms_cursor_crc: Fix the cursor tests to work on CHVMaarten Lankhorst
On CHV pipe C when the cursor is visible with a negative X coordinate a FIFO Underrun will occur. The kernel worked around this by disallowing cursor updates on pipe C at negative X coordinates when the cursor is visible. This was done in the following kernel commit: commit ef8dd37af85a8f37ca3a29074647511e52c56181 Author: Ville Syrjälä <ville.syrjala@linux.intel.com> Date: Fri Dec 18 19:24:39 2015 +0200 drm/i915: Workaround CHV pipe C cursor fail kms_chv_cursor_fail was created to test this issue, but it also happens in kms_cursor_crc, so workaround it there too. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97960
2017-06-01tests/kms_cursor_crc: Test non-square cursors on IVB+Ville Syrjälä
IVB+ have the cursor "FBC" feature, meaning they support a somewhat limited form of non-square cursors. Let's test that. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.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-01-31tests/kms_cursor_crc: 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>
2017-01-05kms_cursor_crc: Stop looking at output->validMaarten Lankhorst
Use the proper iterator macros to prevent ever having an invalid config. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-10-13lib/igt_aux: Add support for various system suspend/resume optionsImre Deak
To have a more accurate idea about any suspend/resume issues we can perform the s/r until various phases in the s/r sequence. This way we can isolate the given problem as being a device driver, kernel core or BIOS related issue. Actual subtests using these new s/r phases will be added as follow-up. While at it also add the freeze suspend target, it's something we also would need to test. Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-10-16kms_cursor_crc: Add test for unthrottled cursor movementMatt Roper
We've had bugs in the past that caused cursor updates to be synced to vblank, resulting in sluggish cursor movement. Add a test to try to make sure we don't regress and reintroduce these bugs. Cc: kalyan.kondapally@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-11kms_cursor_crc: Move comment to the appropriate placeDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-03-23tests/kms_cursor_crc: Add dpms and suspend testsDaniel Vetter
There was some confusion about whether we restore cursors correctly after dpms and suspend/resume. Apparently we still do! Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-23lib/debugfs: Add igt_assert_crc_equalDaniel Vetter
Because of hash collisions tests should only ever compare crc checksums for equality. Checking for inequality can result in random failures. To ensure this only expose and igt_assert function and use that. Follow-up patches will rework the code for tests which don't follow this requirement and try to compare for CRC inequality. v2: Rebase on top of Matt's kms_plane changes. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>