summaryrefslogtreecommitdiff
path: root/tests/kms_flip.c
AgeCommit message (Collapse)Author
2014-12-01tests/kms_flip: Fix assert about vblank wait durationVille Syrjälä
If we wait for one vblank, we may end up returning almost immediately, so trying to assert anything but >0 about the minimum duration is bogus. Instead wait for two vblanks and then we can assert that we should have be blocked for at least one frame. And move the upper bound to a little over two frames to match. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79050 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-13tests/kms_flip: add a timeout for the nonblocking-read testThomas Wood
kms_flip/nonblocking-read will block indefinitely if it fails, so introduce a timeout to indicate test failure. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85718 Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06tests: use igt_debugfs where possibleThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-24tests/kms_flip: Make flip-vs-panning-vs-hang change DSPSURFVille Syrjälä
Make sure DSPSURF will change during the panning operation in flip-vs-panning-vs-hang. This will now test agains bugs between the kernel's mmio vs. CS flip race handling and GPU resets. If the kernel is buggy if will fail to notice that the panning operation changed the base address before the GPU reset had a chance to deal with the pending page flips, and so the flip would never complete due to DSPSURFLIVE not matching the expected value. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-17lib: add common min and max macrosThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-08igt/kms_flip/nonblocking_read: Demonstrate that O_NONBLOCK is a mythChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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-08-30batch: Specify number of relocations to accommodateChris Wilson
Since relocations are variable size, depending upon generation, it is easier to handle the resizing of the batch request inside the BEGIN_BATCH macro. This still leaves us with having to resize commands in a few places - which still need adaption for gen8+. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29Prepare for 64bit relocation addressesChris Wilson
This reveal that quite a few locations were writing relocation offsets but only allowing for 32 bit addresses. To reveal such places in active tests, we also now double check that we do not use more batch space than declared. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-21kms_flip: Adjust to the new igt_create_fb*() APIDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-12lib/igt_kms: Simplify return value of kmstest_get_connector_configDaniel Vetter
A plain bool is enough. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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-07-19igt/kms_flip: Skip if headlessChris Wilson
If there are no connectors, we cannot perform any pageflips and so we have nothing to test. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73640&list_id=446828 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-11tests: enable extra connectors in kms_flip and kms_pipe_crc_basicThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-06-04tests/kms_flip: Move EBUSY to a new busy-flip subtestVille Syrjälä
The EBUSY checking is very fragile currently in case there's any kind extra delay in the test loop. At least the flip-vs-rmfb fails reliably on my IVB. So to make the test less fragile remove the EBUSY check from all the current flip tests, and instead add a specific busy-flip test. To better guarantee that we get the EBUSY add a blocking vblank wait just before we issue the first flip. This maximizes the time we have to submit two flips during one frame. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-27tests/kms_flip: Make flip-vs-panning-vs-hang change DSPSURFVille Syrjälä
Make sure DSPSURF will change during the panning operation in flip-vs-panning-vs-hang. This will now test agains bugs between the kernel's mmio vs. CS flip race handling and GPU resets. If the kernel is buggy if will fail to notice that the panning operation changed the base address before the GPU reset had a chance to deal with the pending page flips, and so the flip would never complete due to DSPSURFLIVE not matching the expected value. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-20tests/kms_flip: various improvementsDaniel Vetter
- Some debug logging for the ts continuity checks. - Add a plain vblank-vs-suspend test where kms_flip doesn't switch off the displays first. - Ensure that we do at least 2 rounds, the suspend tests bailed out after 1 round and so didn't test anything. - Frob the testnames a bit. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-20tests/kms_flip: Add vblank vs. gpu hang testcaseDaniel Vetter
Currently broken :( Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-16tests/kms_flip: test a fb backed by a bo too big/small for its own goodOscar Mateo
This is a "review by igt test" for a bug located in i915_gem_object_pin_to_display_plane and fixed by: commit 392013bdd4b6128795e33c84bd6d6d3fd66ff0a3 Author: Oscar Mateo <oscar.mateo@intel.com> Date: Fri May 16 11:23:12 2014 +0100 drm/i915: Gracefully handle obj not bound to GGTT in is_pin_display Otherwise, we do a NULL pointer dereference. I've seen this happen while handling an error in i915_gem_object_pin_to_display_plane(): If i915_gem_object_set_cache_level() fails, we call is_pin_display() to handle the error. At this point, the object is still not pinned to GGTT and maybe not even bound, so we have to check before we dereference its GGTT vma. v2: Chris Wilson says restoring the old value is easier, but that is_pin_display is useful as a theory of operation. Take the solomonic decision: at least this way is_pin_display is a little more robust (until Chris can kill it off). v2: Avoid code duplication by using igt_create_fb_with_bo_size() as requested by Ville Syrjälä (original author of the "too big" test idea). Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-15tests/kms_flip: nasty power management testsDaniel Vetter
These check whether everything is still ok wrt vblank handling after runtime pm and system suspend-resume. In addition to the usual checks they also ensure that the vblank frame counter isn't totally ridiculous, something Keith complained about aeons ago. With Ville's drm_vblank_on/off rework this should now be fixed and solid. v2: - Ignore seq_step, vblanks completely immediately when the crtc goes off - Only run system suspend/resume tests once. Cc: Keith Packard <keithp@keithp.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14tests/kms_flip: Fix vblank ts checkDaniel Vetter
Oops, fumbled that in the conversion. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14tests/kms_flip: Use assertsDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-30lib: extract kmstest_set_connector_dpmsDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-13lib/kmstest: Fix up tiled buffer creationDaniel Vetter
When extracting a raw __gem_set_tiling helper I've fumbled this in commit 590f6101402b51bca54f69c002380bda967484ea Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Wed Oct 9 20:50:50 2013 +0200 lib/drmtest: extract rawer __gem_set_tiling Fix things up so that we properly propaget the error again. Now to make this all properly work we also need to make kms_flip a notch more robust against such failures ... This only blows up on gen2/3 with the pan tests which want a too wide framebuffer for tiling. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-10tests: use lib igt_[get|set]_stop_rings()Mika Kuoppala
on gem_reset_stats, kms_flip and pm_rps. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75876 Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
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-23lib: extract igt_aux.[hc]Daniel Vetter
And shovel all the various helpers in there. Also move igt_set_vt_graphics_mode to igt_kms.h since the function is implemented in igt_kms.c. And it fits better. I kinda missed this in the prep work. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: unnecessary header removal for drmtest.h, part 1Daniel Vetter
Brought a few missing headers to light in ioctl_wrappers.h, too. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib/intel_batchbuffer: igt_ prefix for rendercopy/mediafill funcsDaniel Vetter
Now everything is prepared to pour some neat api docs over this all. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib/intel_batchbuffer: igt_ namespace for the buffer structureDaniel Vetter
Step one to properly namespace the rendercpy/mediafill functions. Als give the buf_height/width helpers a proper igt_ prefix. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: make rendercopy.h an internal headerDaniel Vetter
And move the public interfaces into intel_batchbuffer.[hc]. A bit messy since we are fairly inconsistent with our header #include handling. Also exclude rendercopy.h from the documentation. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-21kms_flip: Add dpms-vs-vblank-race and modeset-vs-vblank-race subtestsVille Syrjälä
dpms-vs-vblank-race and modeset-vs-vblank-race try to race wait for vblank ioctls from one thread against modeset/dpms ioctls from another. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-02-21kms_flip: Skip tests that try to inject GPU hangs if already terminally wedgedChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-21kms_flip: Assert that hang_gpu() should only fail is the GPU is already hungChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-21kms_flip: Fail the subtest if page flip hang recovery wasn't actually testedVille Syrjälä
Context banning can prevent the page flip hang tests from actaully testing anything, so make the relevant subtests fail in that case. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-02-21kms_flip: Restore rings to running state in unhang_gpu()Ville Syrjälä
If things go bad, make sure the rings aren't left in the stopped state. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-02-21kms_flip: Try to make hang_gpu() robust against hanging the GPUChris Wilson
On a bad day, hanging the GPU may be terminal. Yet even if the GPU is terminally wedged we expect modesetting (and pageflips) to continue. That deserves to be a dedicated test, but in the meantime we should strive to avoid falling over just because the code is not resilient. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-02-13test/kms_flip: fix up igt logging conversionDaniel Vetter
Silly me ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-13tests/kms_flip: use igt loggingDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-20kms_flip: Try to consume all fences after a flipChris Wilson
As a flip is outstanding, there is an issue that the kernel may not be able to release one of the fences that userspace requires and erroneous report EDEADLK (on gen2, gen3). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73696
2014-01-07tests/kms_flip: free the test_output struct when counting modesPaulo Zanoni
Looks like we have to do a lot of work just to count the number of modes... Caught by Valgrind. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-01-07tests/kms_flip: don't leak the connector_config structPaulo Zanoni
... in case we can't find a compatible mode. We already have config[0], we can't return without freeing it first. Caught by Valgrind. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-01-07tests/kms_flip: don't leak the CRTCPaulo Zanoni
The kms_flip program calls kmstest_get_connector_config, which returns a struct containing some allocated variables, including a pointer to the CRTC. The problem is that we copy the values returned by this structure to the test_output struct, but we ignore the CRTC pointer. So free the CRTC pointer instead of leaking it. Caught by Valgrind. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-01-07tests/kms_flip: don't leak the connector when setting DPMSPaulo Zanoni
Caught by Valgrind. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2013-12-31kmstest: Fix up lifetimes of cairo objectsChris Wilson
cairo_t is the short lived drawing context, whereas cairo_surface_t is the heavyweight object that persists and is also tied to underlying GEM objects. So make the kmstest API reflect the different weights and fix the lifetime and underlying object reference leaks. Based on the fix by Paulo Zanoni. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-12-10kms_flip: consolidate run_test_on_{crtc,crtc_pair}Imre Deak
No functional change. Signed-off-by: Imre Deak <imre.deak@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-10kms_flip: keep drm_fd open for the dpms restore exit handlerImre Deak
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69161 Signed-off-by: Imre Deak <imre.deak@intel.com>