summaryrefslogtreecommitdiff
path: root/tests/kms_psr_sink_crc.c
AgeCommit message (Collapse)Author
2015-10-12Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()Ville Syrjälä
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it. Mostly done with coccinelle, with some manual help: @@ identifier I; expression E1, E2, E3, E4, E5, E6; @@ ( - I = __gem_mmap__gtt(E1, E2, E3, E4); + I = gem_mmap__gtt(E1, E2, E3, E4); ... - igt_assert(I); | - I = __gem_mmap__cpu(E1, E2, E3, E4, E5); + I = gem_mmap__cpu(E1, E2, E3, E4, E5); ... - igt_assert(I); | - I = __gem_mmap__wc(E1, E2, E3, E4, E5); + I = gem_mmap__wc(E1, E2, E3, E4, E5); ... - igt_assert(I); ) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09Make gem_mmap__{cpu,gtt,wc}() assert on failureVille Syrjälä
Rename the current gem_mmap__{cpu,gtt,wc}() functions into __gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name that assert that the pointer is valid. Most callers will expect a valid pointer and shouldn't have to bother with failures. To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g' over the entire codebase. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09Sprinkle igt_assert(ptr) after gem_mmap__{cpu,gtt,wc}Ville Syrjälä
Do the following ptr = gem_mmap__{cpu,gtt,wc}() +igt_assert(ptr); whenever the code doesn't handle the NULL ptr in any kind of specific way. Makes it easier to move the assert into gem_mmap__{cpu,gtt,wc}() itself. Mostly done with coccinelle, with some manual cleanups: @@ identifier I; @@ <... when != igt_assert(I) when != igt_require(I) when != igt_require_f(I, ...) when != I != NULL when != I == NULL ( I = gem_mmap__gtt(...); + igt_assert(I); | I = gem_mmap__cpu(...); + igt_assert(I); | I = gem_mmap__wc(...); + igt_assert(I); ) ...> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
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-06-11tests/kms_psr_sink_crc: test even if PSR is disabled by defaultPaulo Zanoni
Use the igt_set_module_param_int() call to enable it, then restore the previous value after we are done testing. With this, we can change the psr_enabled() function to psr_possible(): the only requirement should be that we have a PSR capable sink. The test should now be able to make "Source_OK" and "Enabled" become true whenever it wants. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-15lib: Add a user data pointer to the argument parsing functionsDamien Lespiau
It can be useful to have one of those to carry state between the handler parsing the options and the rest of the test. Right now the only thing we can do is to use global variables for that. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-04-16tests/kms_psr_sink_crc: Make render size and stride based on modified fb sizeRodrigo Vivi
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-04-16test/kms_psr_sink_crc: Add dpms off/on tests.Rodrigo Vivi
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-04-16test/kms_psr_sink_crc: Split plane setup operationsRodrigo Vivi
No functional changes. This reorg will allow to do some operations like dpms off/on with different places to wait for psr to get active. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-04-16tests/kms_psr_sink_crc: remove timeout option from wait_psr_entry.Rodrigo Vivi
No functional changes. Just making timeout unique for any case. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-04-16lib/igt_aux: Introduce igt_interactive_debug_manual_check.Rodrigo Vivi
This is an extention of igt_debug_wait_for_keypress that also can have customized message and return key pressed. v2: This is actualy a v2. V1 was an extension of original igt_debug_wait_for_keypress but it was nacked. v3: Make [Y/n] check inside aux function as suggested by Daniel. Also renaming and adding first use case along with the axu function. v4: Simplify function name and make it assert pressed key is different from n/N as suggested by Daniel. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-04-16tests/kms_psr_sink_crc: Add manual mode.Rodrigo Vivi
Sink CRC is the most reliable way to test PSR. However in some platforms apparently auto generated packages force panel to keep calculating CRC invalidating our current sink crc check over debugfs. So, this manual test help us to find possible gaps on this platforms where we cannot trust on sink crc checks. v2: Accept Daniel's suggestions: * Avoid strcpy * don't override assert definition * Make --interactive-debug for every testcases instead using local --manual v3: Sink CRC can be unreliable for other platforms as well so let's skip and warn when we detect the misbehaviour instead hardcoded per platform. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-04-16tests/kms_psr_sink_crc: Make plane_move visible to human eyesRodrigo Vivi
this will allow manual tests when crc isn't available. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-04-16tests/kms_psr_sink_crc: Make mmaps visible to human eyesRodrigo Vivi
this will allow manual tests when crc isn't available. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-04-16tests/kms_psr_sink_crc: Make render visible to human eyesRodrigo Vivi
This will allow manual tests when crc isn't available. v2: Remove unused and non-sense buf->size and decrease buf->stride a bit as suggested by Daniel. v3: Fix v2 mistake and get buf->size back with a value that makes more sense. TBD: to be changed for variable size depending on modified fb size on following patch Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-04-16tests/kms_psr_sink_crc: Make blt visible to human eyesRodrigo Vivi
This will allow manual tests when crc isn't available. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@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-11igt/kms_psr_sink_crc: Prettify i915_edp_psr_status failuresChris Wilson
Change the formatting asserts into requires and add the contents into the debug log. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89525
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-25lib: remove handled option arguments from argvThomas Wood
Remove options from argv that have been handled by getopt to allow additional non-option parameters to be processed in the test application. This fixes issues when using options such as --debug with tests that accept additional non-option parameters. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-04ioctl_wrappers: Pass in offset to CPU mmapsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-23tests/*: lib/igt.cocci found something!Daniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-10Revert "tests/kms_psr_sink_crc: Wait 2 vblanks before grabing the new crc."Rodrigo Vivi
This reverts commit d190a1f9668680c7a429110c91f8faa27949b220. Author: Rodrigo Vivi <rodrigo.vivi@intel.com> Date: Wed Sep 3 21:26:29 2014 -0400 tests/kms_psr_sink_crc: Wait 2 vblanks before grabing the new crc. Sink CRC is fixed on kernel to wait as many vblanks as needed. It was fixed by: commit ad9dc91b6e21266bfc6f466db4b95e10211f31ee Author: Rodrigo Vivi <rodrigo.vivi@gmail.com> Date: Tue Sep 16 19:18:12 2014 -0400 drm/i915: Fix Sink CRC This this fix in place we don't need this extra 2 vblanks on test case itself. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@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-24tests/kms_psr_sink_crc: Use optionsDaniel Vetter
Env variables are a bit more annoying since much harder to discover. With options you can just see what they do with --help. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-09-11tests/kms_psr_sink_crc: Wait 2 vblanks before grabing the new crc.Rodrigo Vivi
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11tests/kms_psr_sink_crc: Fix blt submissionRodrigo Vivi
Putting back a missing dword. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11tests/kms_psr_sink_crc: Check color ref CRCRodrigo Vivi
Black screen is forbidden on this test. So let's fail if sink crc shows it is back. Also there are many cases where we know for shure it should be all green, so let's check for them. Instead of checking colors we could print with sw using cairo and check if we have identical crc like cursor testcases. However with PSR the chance of artifacts is low and chance of getting blank screen or unchanged screen is high. So even drawing on sw and comparing both CRCs we can have the same result. However the risk is that screen never changed. So the safest way is to compare if screen changed and check the green color when we know it should be green or not green. v2: Hardcoded green was simply wrong because green CRC can change depending on display.Split R, G and B on CRC and bitewise them with mask to verify it is green. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11tests/kms_psr_sink_crc: Fix all testcases.Rodrigo Vivi
In order to get all test cases fixed and the matrix planes-operations working it was needed to use the common new igt kms functions for all cases. Previously only sprite testcase was using it. Fixed the fb colors in a way to make tests more clear and be impossible to see black screen during the tests. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11tests/kms_psr_sink_crc: Start splitting tests in test_planes and operations.Rodrigo Vivi
This will allow us to test input/write oprations on any kind of plane. At this point PLANE_ONOF is just the new name of TEST_SPRITE and PLANE_MOVE is the one for TEST_CURSOR_MOVE. They will be extended and fixed on the following patche(s). v2: fix conflict after changing previous patch Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11tests/kms_psr_sink_crc: Cleaning up tests a bitRodrigo Vivi
This is needed to be able to split tests in a matrix that tests different input/write methods and operations for different type of planes. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11tests/kms_psr_sink_crc: Removing context tests.Rodrigo Vivi
This tests are unecessary. Mainly now with the software tracking for PSR. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11tests/kms_psr_sink_crc: Adding test debug optionsRodrigo Vivi
Just to make life easier and be eable to easily test with PSR disabled to know exactly what to expect when running it for real v3: Use igt_debug helpers and add env option for running with psr disabled on this test without have to recompile like v1 or changing igt infrastructure like v2. I tried to add --disable-psr or local --dry-run but than it fails to print subtests so this was the safest way. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2014-09-11tests/kms_psr_sink_crc: Fix edp_psr debugfs interfaceRodrigo Vivi
Tests were broken on platforms that doesn't have psr or on new kernel that contains new interface. A lot more need to be done to get these tests really useful, but for now lets avoid it breaking tests framework. v2: Doesn't duplicate kernel's HAS_PSR. skip based on debugfs output. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@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-21kms_psr_sink_crc: 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-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-07tests/kms_psr_sink_crc: Fix delayed gtt/cpu write testsDaniel Vetter
- Drop the flip from the name - we don't do that. And the blt is really just to have a bit of fun with the domain tracking. - The real test is 1) dirty with gpu 2) grab 1st crc 3) set_domain for cpu access 4) wait a long time 5) dirty more with cpu 6) grab 2nd crc. This fixes failures since with the old tests we wouldn't have noticed the cpu rendering really. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13tests: run igt.cocciDaniel Vetter
Re-run with correct igt_fail rules. Again manually fixup missing includes for igt_core.h. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13tests/pm_psr_sink_crc: Fix longjmp funDaniel Vetter
igt_fixture and igt_subtests use longjmp/setjmp internally, which means local variables at the same stack frame are at risk. Best practice is to move them out right in front of the igt_main block. It would be awesome if someone could come up with a cocci patch to auto-fix this, but unfortunately my attempts failed. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13Revert "tests: Run igt.cocci over tests"Daniel Vetter
This reverts commit 6903ab04e5f9048e3932eb3225e94b6a228681ba. The igt_assert conversion rule is broken and doesn't invert the check as it should. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13tests: Run igt.cocci over testsDaniel Vetter
Cocci is awesome Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13tests/kms_psr_sink_crc: Skip properlyDaniel Vetter
Aside: The test has way too many bool return values that are then always checked with igt_assert. Imo cleaner to switch to a more declarative approach and shovel the igt_assert/require into those functions instead. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79962 Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-11tests/kms_psr_sink_crc: Create test to test PSR by checking panel CRC.Rodrigo Vivi
v2: Wait psr enable with timeout and more subtest added. v3: Add wait for v_blank leeting test more reliable and preparing to add Baytrail per-pipe tests. v4: Call busy_ioctl on mmap_gtt to match the real usage and remove the need of inactivate on set_domain, what was semantically wrong. v5: Adding more test cases to cover mmap_gtt with and without followed by busy ioctl and also without busy and waiting 10 seconds between set_domain and actual write. v6: rebase after kms_plane added and debugfs api changed. Plus adding more test cases. v7: Some rework and sprite test added Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>