summaryrefslogtreecommitdiff
path: root/tests/kms_vblank.c
AgeCommit message (Collapse)Author
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-10tests/kms_vblank: Adopt to use allocatorBhanuprakash Modem
For newer gens kernel will reject relocations returning -EINVAL so we should just provide the allocator handle to inject the hang. V2: * Drop is_i915_device() check Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2021-07-28tests/kms_vblank: Turn on hardware before testing invalid vblank.Mark Yacoub
[Why] Before any hardware is on, the vblank is off and its ref counter is in an initialized state as each driver handles toggling it differently. Ioctl DRM_IOCTL_WAIT_VBLANK could return 0 such as on i915, or an invalid integer that doesn't mean much, such as on Zork running Kernel 5.4 due to the kernel workaround that increments the vblank ref count to prevent a get from enabling the interrupt. [How] For invalid_subtest(), active the CRTCs to turn the hardware on so DRM_IOCTL_WAIT_VBLANK returns something meaningful. Tested on ChromeOS Zork(amdgpu) and Trogdor(msm) Changes since v5: Explicitly set the data pipe and output. Changes since v4: Use igt_get_single_output_for_pipe to get igt_output_t. Changes since v3: Turn on only 1 output instead of all. Changes since v2: 1. Updated Signed-off-by. Changes since v1: 1. Update Commit message 2. Rename variable p to pipe_number Signed-off-by: Mark Yacoub <markyacoub@chromium.org> Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@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-02Revert "tests/kms_vblank: Turn on hardware before testing invalid vblank."Arkadiusz Hiler
This reverts commit 34d6af931ddf962cd0c86b7c9086e333aca2dd66. Pushed by accident. I've looked at the wrong test results. Seems to be crashing. Signed-off-by: Arkadiusz Hiler <arek@hiler.eu>
2021-07-02tests/kms_vblank: Turn on hardware before testing invalid vblank.Mark Yacoub
[Why] Before any hardware is on, the vblank is off and its ref counter is in an initialized state as each driver handles toggling it differently. Ioctl DRM_IOCTL_WAIT_VBLANK could return 0 such as on i915, or an invalid integer that doesn't mean much, such as on Zork running Kernel 5.4 due to the kernel workaround that increments the vblank ref count to prevent a get from enabling the interrupt. [How] For invalid_subtest(), active the CRTCs to turn the hardware on so DRM_IOCTL_WAIT_VBLANK returns something meaningful. Changes since v4: Use igt_get_single_output_for_pipe to get igt_output_t. Changes since v3: Turn on only 1 output instead of all. Changes since v2: 1. Updated Signed-off-by. Changes since v1: 1. Update Commit message 2. Rename variable p to pipe_number Signed-off-by: Mark Yacoub <markyacoub@chromium.org> Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
2021-05-19tests/kms_vblank: Reset the state before exiting the testBhanuprakash Modem
Before starting the next subtest, clean up the states to default values, those are assumed by other tests. Cc: Imre Deak <imre.deak@intel.com> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com> Reviewed-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
2021-02-19tests/kms_vblank:Added subtest descriptionArundhati Hagaragi
Added description for all subtests Signed-off-by: Arundhati Hagaragi <arundhati.hagaragi@intel.com> Cc: Modem, Bhanuprakash <Bhanuprakash.Modem@intel.com> v2: Modified description to be more specific. (Bhanu) Reviewed-by: Bhanuprakash Modem <bhanuprakash.modem@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-11-19Remove unused intel_bufmgr.h headersDominik Grzegorzek
Delete intel_bufmgr include where it is not necessary. Signed-off-by: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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-01-31lib: Find the associated runtime-pm sysfs for the deviceChris Wilson
Remove the hardcoded path to the igfx (00:00:02.00) and instead pass in the fd of the DRM device we wish to control, and look up the associated device/power/ under sysfs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Imre Deak <imre.deak@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-04-10igt: tests: kms_vblank: Stop using magic valueStanislav Lisovskiy
Lot of tests fail, when assertion checking how many vblanks should have passed during suspend/resume is compared to magic value 150. At the same time even for failed cases, sometimes it is clearly visible that there were no issue - simply suspend took longer on that machine. If suspend took around 10 s and we get roughly 60 vblanks per second the value then should be around 600 and not 150. This change removes 150 magic value and starts to use calculation of what it is expected to be instead of being hardcoded. v2: Add possible error delta interval, where expected vblanks must lie, i.e: [estimated_vblanks - err, estimated_vblanks + err] v3: Made an error range for estimated vblanks a bit less strict. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104894 Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.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-09-05igt/kms_vblank: Exercise some EINVALChris Wilson
Feed some impossible garbage into drmWaitVblank and expect the kernel to report EINVAL. v2: Cancel the double negative of ~invalid_flags Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-08-31tests/kms_vblank: Test if we have functional rpm before testingChris Wilson
We want to test that provoking a vblank interrupt works correctly after waking up from runtime-pm. First though, we must wait for the device to enter runtime-suspend. If the device cannot, e.g. we haven't enabled the DMC firmware, the test should skip because our external requirements are not met. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107768 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-07-17igt/kms_vblank: Check if hangs are allowedChris Wilson
Before running a hang test, check if we can inject a hang and expect recover to work. If we can't control a hang, skip the subtest. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-02-05tests/kms_vblank: Fix spurious test failure.Maarten Lankhorst
igt_system_suspend_autoresume() calls igt_require(), which isn't allowed to be called from a forked child. Run subtests directly from the test body, except when a forked test is requested. Changes since v1: - Fixed to actually compile.. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104783 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-01-24kms_vblank: Remove teardown code from cleanup_crtcMaarten Lankhorst
New way of doing things is calling igt_display_reset() before any setup code. This way if the configuration stays the same, the initial modeset will be a noop. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-01-24kms_vblank: Add tests implemented in kms_flipMaarten Lankhorst
In kms_flip there are some tests for testing whether the vblank counter is monotonically increasing. Add these subtests to kms_vblank, where they belong. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-01-24tests/kms_flip: Move kms_flip.vblank-vs-hang to kms_vblank, v4.Maarten Lankhorst
There's no need to test this more than once. Add a NOHANG flag which can be used to specify that a subtest can not be run when hanging. If it's set on either the subtest or the mode, the -hang test for this combination will not be generated. Changes since v1: - Merge the patch that renamed HANG to NOHANG. - Rebase after 'reorganize subtests by type'. - Allow subtests to specify NOHANG too. Changes since v2: - Mark accuracy test with NOHANG, gpu reset disables interrupts, causing the test to fail. Changes since v3: - Rebase on top of subtest split changes. - Add nohang comment to accuracy test. (Daniel) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-01-24kms_vblank: Reorganize subtests by pipe, v2.Maarten Lankhorst
Changes since v1: - Move per-pipe subtests to its own function and fix indent. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-12-11igt/kms_vblank: To set a mode requires DRM_MASTERChris Wilson
Fixes: ba86514759c6 ("kms_vblank: Switch from using crtc0 statically to explicitly setting mode.") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104208 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2017-12-08tests/kms_vblank: Add test to ensure DRM_CAP_CRTC_IN_VBLANK_EVENT works ↵Maarten Lankhorst
correctly This was implemented correctly only on the atomic ioctl before, but it should really be working on all 3 ioctl's involved, so ensure we always set crtc_id correctly with a testcase. The following events are tested: - Pageflip with event. - Atomic commit with event. - wait_vblank ioctl with event. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-03-19igt/kms_vblank: Exercise contention of drmWaitVblankChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-01-31tests/kms_vblank: 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_vblank: Stop looking at output->valid.Maarten Lankhorst
Use the proper iterator macros to prevent ever having an invalid config. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-07-04kms_vblank: Switch from using crtc0 statically to explicitly setting mode.Robert Foss
Previously crtc0 was statically used for VBLANK tests, but that assumption is not valid for the VC4 platform. Instead we're now explicitly setting the mode. Also add support for testing all connected connectors during the same test. 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>
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-04-06igt/kms_vblank: Simple accuracy testChris Wilson
Queue 60 event to arrive at the same vblank from different points in time and make sure it just works. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02igt/kms_vblank: Include a test for comparing blocking drmWaitVblankChris Wilson
The other aspect of the spinlock/interrupt on-off overhead is that when we wait for vblank it immediately turns off, and then we immediately turn it back on for the next wait. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-26igt.cocci: check the return values of various functionsThomas Wood
Add rules to fix unused-result warnings when compiling with _FORTIFY_SOURCE defined and apply them to the library and tests. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-19igt/kms_vblank: Simple harness for measuring speed of drmWaitVBlankChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>