summaryrefslogtreecommitdiff
path: root/tests/kms_plane.c
AgeCommit message (Collapse)Author
2018-10-08tests: kms_plane: Disable XBGR8888Maxime Ripard
For some reason, the XBGR8888 CRC check will fail in the kms_plane tests. Since that format will be enabled and checked by that test in the next commit, make sure we don't introduce a regression for no particular reason. Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Martin Peres <martin.peres@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-08-14tests: Replace calls to igt_pipe_crc_drain + get_single with ↵Maarten Lankhorst
igt_pipe_crc_get_current() This is a more race free of accomplishing the same. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-06-08tests/kms_plane: crc check plane pixel formatsVille Syrjälä
Insted of just trying out each pixel format once, let's try each one with a set of colors (RGB,CMY,white,black). We'll grab a reference CRC for each using XRGB8888, and then compare that with the CRC we get with any other format. We have to use a solid color fb because chroma subsampling would generally prevent us from getting a match if we had any color transitions in the fb contents. We also abuse the legacy LUT to drop the precision down to 6 bits so that still errors causes by the RGB<->YCbCr conversion end up being ignored. v2: don't set Broadcast RGB prop if it's not there v3: Drop the Broadcast RGB prop since igt_kms already does it (Maarten) v4: Don't check ARGB8888 twice on cursors Add vblank wait after the commit to make sure we grab the crc for the new fb Don't turn the plane off between every check Fix the commit message to say we keep only 6 msbs, 7 is too much Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #v3
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-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>
2018-01-15tests/kms_plane: Run test for all supported pixel formats, v2.Mahesh Kumar
This patch adds a subtest related to pixel format testing. The test tries to create framebuffer with all supported pixel formats on every plane, and tries to draw them using cairo and commits the same on display. Changes since v1: - Make the test more generic and try on all planes, including legacy cursor. Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com> Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-11-30kms_plane: Enumerate outputs before planes in panning subtestsImre Deak
Enumerating outputs before planes allows us to calculate the reference CRC only once for each subtest instead of calculating it for each plane tested. This removes an extra modeset during the test of each plane, speeding up things, especially on internal panels with long power cycle delays. In addition when testing multiple outputs we'll now test all planes for a given output in one go, so we can avoid the full modeset we currently have when switching from one output to another when testing a given plane. Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-11-30kms_plane: Enumerate outputs before planes in position subtestsImre Deak
Enumerating outputs before planes allows us to calculate the reference CRC only once for each subtest instead of calculating it for each plane tested. This removes an extra modeset during the test of each plane, speeding up things, especially on internal panels with long power cycle delays. In addition when testing multiple outputs we'll now test all planes for a given output in one go, so we can avoid the full modeset we currently have when switching from one output to another when testing a given plane. While at it remove the redundant igt_skip_on() for non-existant pipes and planes, we check for these already earlier. Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-08tests/kms_plane: Appease gcc -Wempty-bodyDaniel Vetter
Not exactly sure what's the point, but oh well. Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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-06-16tests: Increase value of I915_MAX_PIPES to 6Leo (Sunpeng) Li
Increasing max pipe count to 6 to support AMD GPU's. Since some tests' behavior depends on this value, small changes are made to remove this dependency: * kms_ccs: Early abort if wanted_pipe is out-of-bounds. * kms_concurrent: Check if pipe is within bounds first. * kms_pipe_color: Prevent skipping of subsequent tests by placing generated tests in a 'igt_subtest_group'. * kms_plane: Move pipe and plane index checking to subtest group level. v2: Change invalid pipe check on kmstest_pipe_name() to use I915_MAX_PIPE v3: Change tabs to spaces in 'enum pipe' Signed-off-by: Leo (Sunpeng) Li <sunpeng.li@amd.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Tested-by: Tomi Sarvela <tomi.p.sarvela@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_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-16kms_plane: Use for_each_valid_output_on_pipe.Maarten Lankhorst
This is better because some outputs may not be used on all pipes. This correctly causes some tests to skip on CHV/VLV when there is no output for a given pipe. 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>
2016-07-26igt_kms: Remove pan members from igt_plane, v2.Maarten Lankhorst
They're duplicates with src_x/y, so just use those. Changes since v1: - Fix order of parameters in calls to igt_fb_set_position. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
2016-05-04tests/kms_plane: Skip the test when configuration couldn't be appliedFeceoru, Gabriel
This could happen when the selected pipe cannot be used with the connected port due do HW constrains. v2: Apply review comment (Marius) bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86763 Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-05-04tests/kms_plane: Skip on no connected outputsFeceoru, Gabriel
When no display is connected all kms_plane subtests pass although no testing is done. Change it by reporting the subtests as skipped. Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@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-14lib/debugfs: wait_for_keypress("crc") when collecting CRCPaulo Zanoni
Let's just steal the "crc" namespace and add this by default to igt_pipe_crc_collect_crc() instead of adding more calls to other tests. If tests want special waits on just some of their collect_crc() calls, they can use another name instead of "crc". This is very useful when developing, especially when the CRC we get is wrong: we want to look at the screen to see what's going on before we can think about how to fix the problem. So let's add this to the lib instead of adding this to every single test I need to debug. v2: Add some documentation (Daniel). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-03-23tests: Remove usage of igt_crc_equal and _non_nullDaniel Vetter
Tests should positively check for crc matches, not for mismatches. Enforce this by only exposing and igt_assert function for comparing crcs. For the few tests which didn't just do this as consistency checks but to do functional tests add FIXME comments that some reference crc values are missing. 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-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-06tests/kms_plane: Ensure planes recover from DPMSMatt Roper
i915 was using the main atomic 'disable plane' to turn off sprite planes during a CRTC disable. This was problematic because it modified the plane state, preventing us from recovering the original state later. One such case was that during a DPMS OFF followed by a DPMS ON, any sprite planes would not be restored properly. Let's add a test that toggles DPMS off and on and ensures that the CRC remains the same (i.e., planes are successfully restored unchanged). 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-01-20kms_plane: Add test that suspends/resumes before getting crcAnder Conselvan de Oliveira
This adds a test that does a suspend/resume cycle between configuring a plane and getting the crc value for the pipe. The intention is to test if the user requested stated is restored properly, instead of being clobbered by the state read out from the hardware. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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-08-21kms_plane: Adjust to the new igt_create.*fb() APIDamien 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-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-09kms_plane: Specify the pipe when grabbing reference CRCsDamien Lespiau
When changing the pipe we were using, test_grab_crc() wasn't correctly setting the pipe constraint before waiting for the CRC on the pipe, and so we ended up waiting for a CRC on a pipe that wasn't lit up. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07kms_plane: Add a debug message when grabbing the CRC of a colored fbDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07kms_plane: Add panning test for primary planeYi Sun
Get CRCs of a full red and a full blue surface as reference. Create a big framebuffer that is twice width and twice height as the current display mode. Fill the top left quarter with red, bottom right quarter with blue Check the scanned out image with the CRTC at position (0, 0) of the framebuffer and it should be the same CRC as the full red fb Check the scanned out image with the CRTC at position (hdisplay, vdisplay) and it should be the same CRC as the full blue fb v2: Fix a few things here and there (Damien) Cc: Lei Liu <lei.a.liu@intel.com> Cc: Yi Sun <yi.sun@intel.com> Signed-off-by: Lei Liu <lei.a.liu@intel.com> Signed-off-by: Yi Sun <yi.sun@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07kms_plane: Make the gathering of reference CRCs test agnosticDamien Lespiau
We're going to add tests for panning. Both position and panning tests share the need to grab reference CRCs of single coloured fb, so let's separate this function from the position test. Cc: Lei Liu <lei.a.liu@intel.com> Cc: Yi Sun <yi.sun@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
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-03-26lib/igt_fb: switch to igt_ prefix from kmstest_Daniel Vetter
Shorter and more in line with our general igt_ prefix for everything which isn't somehow intel or i915-gem or otherwise hw specific - these helpers here are all fully generic framebuffer handling functions based on kms + cairo. Well, the actual buffer alloc is done with i915 gem, but meh ;-) Two special cases: - bpp_depth_to_drm_format and drm_format_to_bpp completely lacked prefixes, so just add igt_. - write_fb was a bit misleading given that we have gem_write for uploading to buffers. Rename that to write_fb_to_png to make it crystal clear what this thing does even without looking at docs. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26lib/igt_kms: s/kmstest_create_fb2/kmstest_create_fb/Daniel Vetter
Simplify the name since the old _fb function is now gone. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-26lib: remove kmstest_create_fbDaniel Vetter
Use the new-style function using drm fourcc codes instead everywhere. To easily use thew fourcc based interface also expose bpp_depth_to_drm_format from the library. Finally include drm_fourcc.h from the igt_kms.h header since pretty much everyone needs this now. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: more unecessary header removalDaniel Vetter
This time big with media_fill.h Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-17lib/igt_debugfs: s/igt_pipe_crc_check/igt_require_pipe_crc/Daniel Vetter
Functions which provide feature checks through igt_skip should be of the form <prefix>_require_<feature>. Otoh feature checks which return in a boolean whether the feature is available should be of the form <prefix>_has_<feature>, e.g. gem_has_blt. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-17lib/igt_debugfs: Remove debugfs from pipe crc functionsDaniel Vetter
All tests have now lost explicit references to igt_debugfs_t! Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-12lib/igt_debugfs: drop drm_fd argument from igt_pipe_crc_newDaniel Vetter
It's nowhere used and removing it gives us a cleaner, more orthogonal interface. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-18kms_plane: Remove spurious inclusion of glib.hDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11lib: Fix igt_ouput_get_plane() typo (output)Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>