summaryrefslogtreecommitdiff
path: root/tests/kms_universal_plane.c
AgeCommit message (Collapse)Author
2018-10-04igt: Check drmModeGetResources()Chris Wilson
If KMS is not supported on the device, drmModeGetResources() will return NULL, often this is an indication that we should not attempt to run the test. Although it would be preferred to use something like igt_require_display() as the canonical check and assert that drmModeGetResources() did not hit an error, it is not always practical as the tests do not utilize the common igt_display abstraction. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@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>
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-04-07tests/kms_*: Use correct DRM context versionDaniel Stone
DRM_EVENT_CONTEXT_VERSION is the latest context version supported by whatever version of libdrm is present. igt was blindly asserting it supported whatever version that may be, even if it actually didn't. With libdrm 2.4.78, setting a higher context version than 2 will attempt to call the page_flip_handler2 vfunc if it was non-NULL, which being a random chunk of stack memory, it might well have been. Set the version as 2, which should be bumped only with the appropriate version checks. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-03-24lib/debugfs: Phase out igt_debugfs_fopen()Chris Wilson
Wrapping fdopen() proved dangerous, the underlying fd is not refcounted, and we must close it in the library or else we easily leak and exhaust all fd. Since we can't provide igt_debugfs_fopen(), move the burden onto the caller for those that require a stream FILE*. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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_universal_plane: 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-12kms_universal_plane: Skip tests if there are no valid outputs for the pipeMaarten Lankhorst
The tests shouldn't pass if nothing has been tested. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-12-08igt_kms: Remove support for drivers with <1 drm_planeLyude
We've had support for universal planes since kernel version 3.15, so there's not really a good reason to try supporting drivers that lack plane support now. As well, the current has_universal_planes logic is broken anyway as it makes the assumption that having display planes always means we have both a primary plane and a cursor plane (this isn't true on radeon/amdgpu and nouveau). So, remove this, and just check for whether or not we have a cursor plane. Signed-off-by: Lyude <lyude@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-10-14kms_universal_plane: Add gen9-specific testMatt Roper
Gen9 adds some new capabilities not present on previous platforms (primary plane windowing, 90/270 rotation, etc.). Add a new subtest to check how these new features interact with the use of the universal plane API. For now we just check whether pageflips work as expected in a windowed setting. We may want to add some rotation testing in future patches. 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-07-08kms_universal_plane.c: Update sanity checks for gen9Matt Roper
SKL and BXT have some new plane capabilities that previous generations didn't have; we need to update some of our universal plane tests to expect success rather than failure when running on these platforms. Signed-off-by: Matt Roper <matthew.d.roper@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-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-27tests/kms_universal_planes: Inline igt_assert(ret == 0) checksDaniel Vetter
This way the debug output in case of failures is nicer since we dump the entire test condition. Also replace one open-coded igt_assert_eq. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-27kms_universal_plane: Check for cursor fb leaksMatt Roper
We've been leaking the framebuffers that get created inside the legacy -> universal cursor compatibility layer and nobody noticed. Add an i-g-t test to check debugfs and ensure we end up the same number of framebuffers we started with after performing cursor operations. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-25tests: improve pipe enumerationThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-02-17tests/kms_universal_plane: Fix subtest enumerationMatt Roper
We shouldn't use the contents of data.display to determine which pipes to run subtests on since this structure is initialized in an igt_fixture and won't contain any useful data when enumerating subtests (i.e., --list-subtests won't return anything). Instead, just assume we have three pipes in the main loop and ensure that each subtest will skip if we don't really have that many. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Thomas Wood <thomas.wood@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-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-06igt/kms_universal_plane: Only test existing planesChris Wilson
Only attempt to test the number of planes that exist on the device so as not to trigger spurious failures. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=82233 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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-07-10tests: Run igt.cocciDaniel Vetter
New stuff caught. Plus manually simplify the massive igt_fail_on_f(file == NULL, ...) to a simple igt_assert(file). We already print the errno (if applicapable) and the condition, which is equally informative. Cc: Yi Sun <yi.sun@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Cc: Wendy Wang <wendy.wang@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-04kms_universal_plane: Don't assert outside of fixtures/subtestsDamien Lespiau
Doing otherwise breaks listing the subtests. The test was throwing an error out when universal planes were disabled as well because of that. Cc: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04tests/kms_universal_plane: Universal plane testing (v6)Matt Roper
Add a simple test to exercise universal plane support. v6: - Update to new universal plane interface (commit parameter rather than state-changing function). It should now be a lot more explicit which steps are being taken with legacy API's vs universal API's now. v5: - Check that we don't have more than one primary or cursor. This will catch accidental calls to drm_plane_init() in the kernel where drm_universal_plane_init() was intended (these don't cause a compile warning due to type compatibility between enum and bool). v4: - Test disabling the primary plane explicitly when it has previously been implicitly disabled due to clipping. - Skip test if igt_pipe_crc_new() fails v3: - For testing while crtc is off, switch between several different primary plane fb's before reenabling the crtc. This will help catch pin/unpin mistakes. v2: - Test that pageflips error out gracefully when the primary plane is disabled before the ioctl, or between ioctl and pageflip execution. - Test that nothing blows up if we try to disable the primary plane immediately after a pageflip (presumably before the pageflip actually completes). - Test that we can setup primary + sprite planes with the CRTC off and then have them show up properly when we enable the CRTC (drmModeSetCrtc with fb = -1). - Test that we can modeset properly after having disabled the primary plane - Test that proper error codes are returned for invalid plane programming attempts. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>