summaryrefslogtreecommitdiff
path: root/tests/kms_cursor_crc.c
AgeCommit message (Collapse)Author
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>
2015-03-23lib/core: add interactive debug point to igt_failDaniel Vetter
Useful for inspecting the screen state in kms tests when they fail. Also move the screen clearing in kms_cursor_crc to the bottom. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-12tiling: Convert framebuffer helpers to use fb modifiersTvrtko Ursulin
This converts the IGT API only, underneath legacy set_tiling is still used. v2: One got away in kms_flip. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-03-06igt.cocci: Replace igt_assert() with igt_assert_CMP() where possibleMatt Roper
The integer comparison macros give us better error output by including the actual values that failed the comparison. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-10kms_cursor_crc: Kernel now checks for integer overflowMatt Roper
As of kernel commit commit a679064a7e9e8799177a64a31668a34a1bc6a4f1 Author: Matt Roper <matthew.d.roper@intel.com> Date: Fri Jan 30 16:22:37 2015 -0800 drm/i915: Switch planes from transitional helpers to full atomic helpers the kernel now checks for cursor coordinates that would result in integer overflow and returns -ERANGE, similar to the checking that was already done for other plane types. We update kms_cursor_crc here to reflect this small behavior change: * Check for success at extreme boundary conditions INT_MAX-{width,height} rather than INT_MAX * Add new check for success at SHRT_MAX; if the driver were to internally use short values and overflow, we could have the cursor reappear on the screen. * Add a test for failure with proper error code at INT_MAX-{width,height}+1 Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2014-12-09tests/kms_cursor_crc: Restore the valid pipe/connector combo checkVille Syrjälä
The valid pipe/connector combo check was lost in commit 57259d714d3fe1170cf931af72648219856a9918 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Mon Nov 24 16:08:32 2014 +0100 lib/igt_debugfs: Don't setup crc in _new Restore it to make the test again useful on CHV. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-09kms_cursor_crc: Remove value to 'return' in a void functionDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-11-24lib/igt_debugfs: Don't setup crc in _newDaniel Vetter
The problem is that this causes writes to registers, and if the pipe is off they might go nowhere (e.g. when runtime pm is enabled). Furthermore we can only really check once the modeset setup is done, but again most tests set up the CRC structure before calling igt_commit and friends. We could add crc restore support to the kernel's rpm code, but that will end up being rather invasive and fragile hard-to-test code. Now originally this was needed back when CRC support wasn't available everywhere. But that's fixed now. So given all this just drop that sanity check and make sure that we only touch the debugfs file (and so the hw state) when we know the pipe is running in the desired configuration. A complementary kernel patch will try to catch offenders by returning -EIO if the pipe is off. v2: Forgot to git add one hunk. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86092 Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-11-06docs: add some test descriptionsThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-17tests/kms_cursor_crc: HSW/BDW only have square cursorsPaulo Zanoni
When I look at cursor_size_ok() (from the Kernel's intel_display.c), I see that only 845g and i865g support non-square cursors, so SKIP the tests on HSW/BDW instead of failing them. This problem happened because support for non-square cursors was being developed for HSW/BDW, but it ended up not being merged due to a small problem and priority changes. Let's make those tests SKIP until we have proper support on the Kernel: after that, we can revert this patch. v2: Improve commit message. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84268 Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-09-30lib: add a function to indicate activityThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30test/kms, pm: use drm_open_any_masterImre Deak
These tests require DRM master right, so make sure they have it from the beginning. This gives an early indication if another DRM master is running and makes the given test skip (with a proper explanation of the reason) instead of exiting with error. Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-09-26kms_cursor_crc: Remove two unused local variablesDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-09-18tests/kms_cursor_crc: Add basic non-square cursor testingVille Syrjälä
To minimally verify that non-square cursors work on the platforms where they're supported perform the tests first with WxH cursor and then repeat with WxH/3 cursor. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-08-29igt: Prettify igt_assert_eq() failure messagesChris Wilson
This just improves the language about the exact failure to reduce confusion. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-21kms_cursor_crc: Use I915_TILING_NONE to create fbsDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-12lib/igt_kms: set_vt_graphics_mode is a low-level helperDaniel Vetter
So give it a kmstest_ prefix and shuffle it around a bit. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: Unify pipe name helpersDaniel Vetter
And add api doc while at it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12tests/kms_cursor_crc: Align opening {Daniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-11lib/igt.cocci: Add stanza for for_each_pipeDaniel Vetter
Damien dodged this ... Also run the script while at it. v2: Don't just capture identifiers for pipe, but also expressions. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-04tests/kms_cursor_crc: Call drmModeMoveCursor() directlyMatt Roper
We're calling drmModeSetCursor() to change the cursor image and never actually doing a display commit (aside from when we display the cursor), so call the move ioctl directly rather than igt_plane_set_position() to ensure the changes actually take effect. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04tests/kms_cursor_crc: Combine data_t and test_data_tMatt Roper
If a subtest fails, cleanup_crtc() never gets called and then the test_data_t structure for the test is lost, including the CRC file descriptor that we never got a chance to release; this causes all subsequent tests to fail with -EBUSY at igt_pipe_crc_new(). The split between permanent data_t and temporary test_data_t doesn't seem to serve a purpose, so just combine the fields from both into data_t. This will prevent us from losing the CRC filedescriptor so that we can properly close and reopen it after a failed test. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-06-02kms_cursor_crc: Test cursor size change ioctlAntti Koskipaa
Now that we support cursor changes other than 64x64, a bug was found where the size change was only applied at cursor enable time, rather than at every update. Add a testcase for that. Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14tests: sprinkle igt loggingDaniel Vetter
All the cases that simply dump some debug information and couldn't be converted to some of the fancier macros. Some information output removed when it's redundant with the subtest status. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-25kms_cursor_crc: Fix the test on platforms where the pipe->port mapping has ↵Ville Syrjälä
restrictions On gen2 for instance the LVDS port can only be fed from pipe B. Check whether the combinations is valid before trying to run the test. Also clean up the state back to PIPE_ANY properly so that following tests can again go through all the combinations. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75131 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25kms_cursor_crc: Wrap igt_require() in igt_fixtureVille Syrjälä
igt_require() must be within a fixture or subtest. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25kms_cursor_crc: Replace snprintf()+%s with just %dVille Syrjälä
There's no point in first printing the int to temp string using %d and then printing that out with %s. Just stick the %d into the final string. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25kms_cursor_crc: Allow the test to run without cursor cap supportVille Syrjälä
Assume that only 64x64 cursor size is supported if the cursor size caps aren't supported by the kernel. This allows the test to run on older kernels. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25kms_cursor_crc: Wrap cursor fb creating into igt_fixtureVille Syrjälä
We don't want to attempt creating the cursor fb when enumerating subtests. So wrap it into igt_fixture. Also destroy the cursor fb after the tests. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25kms_cursor_crc: Simplify the pipe_crc messVille Syrjälä
Instead of allocating an array of igt_pipe_ctc_t objects, just allocate one and stick it into test_data. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25kms_cursor_crc: Add background pictureAntti Koskipaa
This gives the cursor something to be on, instead of just a black background. Slows the test down only one second over six minutes. Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>