summaryrefslogtreecommitdiff
path: root/lib/igt_debugfs.c
AgeCommit message (Collapse)Author
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-04-21docs: avoid escaping characters in documentation commentsThomas Wood
Avoid having to escape certain characters in documentation comments by not allowing docbook markup tags. Markdown formatting in documentation comments is still supported. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
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-23lib: Only warn about suspicious CRCsDaniel Vetter
It is theoretically possible to hit these in the wild, so only warn about them. Dropping the test is probably too much since these caught some real bugs in the past. Signed-off-by: Daniel Vetter <daniel.vetter@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-02-13lib/igt_gt: Document and consolidateDaniel Vetter
Also move forcewake and stop_rings code from igt_debugfs to igt_gt since it fits better. And move the hang injection fork helpers from igt_aux to igt_gt, too. Also push the intel_gen call into igt_hang_ring while at it. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2014-12-09lib/igt_debugfs: Throw away the two first CRCsVille Syrjälä
On CHV we sometimes see not just one but two bad CRCs. No real idea what would cause that, but let's just throw away the second CRC as well to gain some stability for the tests. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.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-30doc: various spelling and typo fixesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-12lib: Try harder to drop-cachesChris Wilson
If at first we don't succeed, try again. (For as long as the errno says to at least!) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29igt: Prettify igt_assert_eq() failure messagesChris Wilson
This just improves the language about the exact failure to reduce confusion. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26lib/igt_* Use igt macros in igt libariesDaniel Vetter
Except in igt_core since that would lead to some hilarious recursions. v2: Don't fflush any more, spotted by Chris. 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-07pipe_crc: Make collect_crc() ensure the CRC looks somewhat validDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07pipe_crc: Warn if the CRC values is 0xffffffffDamien Lespiau
This is what we read when the CRC logic in in a powered down well. We really don't want that to happen. In theory, it's possible 0xffffffff to be a valid CRC value, so I don't assert here. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-06-13lib/igt_debufs: Add IGT_NO_FORCEWAKE environment variableVille Syrjälä
If IGT_NO_FORCEWAKE is set, skip the forcewake open. Useful when you want to poke at register without otherwise disturbing the GPU. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-06-13lib/igt_debugfs: Don't fail if debugfs is already mountedVille Syrjälä
Remove the igt_assert() from the debugfs mount. It will fail if debugfs is already mounted. With the assert in place it's very annying to use igt without i915 loaded (eg. to dump BIOS configured registers). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-06-05lib/igt_debugfs: Fix spelling docsDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14lib: set a timeout when reading crc valuesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com> Acked-by: Damien Lespiau <damien.lespiau@intel.com>
2014-04-16lib: Fix potential out of bounds access in ring stop codeVille Syrjälä
The subsequet code expects the read() to not have filled the entire buffer, and yet we allow it to do so. Reduce the size passed to read() by 1 to make the code sane. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-16lib: Fix assert failure in ring stop codeVille Syrjälä
The assert in igt_set_stop_rings() is a bit bogus. Suppsoedly it was meant to assure that the caller always restores the rings to running state after stopping them. But in its current form it will trigger any time someone calls the function and the rings were already stopped. So you can't even restore the rings to running state w/o the assert triggering. Fix it up so that it'll ignore the current ring state when we're trying to restore the rings back to running state. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-10lib: add igt_get_stop_rings and igt_set_stop_ringsMika Kuoppala
Multiple tests are introducing hangs by fidding with i915_ring_stop debugfs entry. Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-03-26lib: fold igt_display into igt_kmsDaniel Vetter
For 1 function and 2 types we kinda don't need separate files. Especially now that igt_kms is much more focused on the actual modeset stuff with all the framebuffer helpers extracted to igt_fb. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-23lib: Use @include tag for include filesDaniel Vetter
Occasionally useful to read documentation ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: unnecessary header removal for drmtest.h, part 2Daniel Vetter
I've left unistd.h in it - it's not strictly required but most users of drmtest.h want it for the open helpers, and then you kinda need to close that file descriptor again ... 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: add #include "foo.h" lines like in manpagesDaniel Vetter
Should help in alleviating the header mess we have atm. 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 igt_debugfs_initDaniel Vetter
And also move the igt_debugfs_t type out of the headers. 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-17lib/igt_debugfs: Remove debugfs from igt_debugfs_fopenDaniel Vetter
Also add a missing igt_assert to kms_fbc_crc and again add the missing Returns: section to the api doc. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-17lib/igt_debugfs: Remove debugfs from igt_debugfs_openDaniel Vetter
Also update the api docs a bit since the Returns: section was missing. v2: Readd the accidentally lost line for @filename. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-16lib/igt_debugfs: implement a singleton igt_debugfs_t instanceDaniel Vetter
Allows us to remove every so little bit of boilerplate from tests, once it's all rolled out. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-14lib: extract igt_open_forcewake_handleDaniel Vetter
... and I immediately regret that I've killed the return value for igt_debugfs_init, since we have callers which need to work without the forcewake stuff, e.g. the reg dumper needs to work without i915 loaded. Put this new helper to good use in the mmio code and the pm_pc8 testcase. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-12lib/igt_debugfs: api docsDaniel Vetter
Again issues with an enum, this time intel_pipe_crc_source. The typedefs seem to work better here though. 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-03-12lib: make igt_debugfs_open infallibleDaniel Vetter
(Almost) no one cared anyway. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-12lib: move prefault helpers to igt_debugfs.cDaniel Vetter
This way all debugfs library code is in one place, ready for some api documentation care. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-11lib/crc: Add a helper to read a single CRC valueDamien Lespiau
In this case, we also take care of starting/stopping the CRC collection. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11lib/crc: Factor out reading a single CRC valueDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-12-06lib: make igt_pipe_crc_start never failDaniel Vetter
It's what callers expect - pipe_crc_new is the function where we pass a potential failure back to callers. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-06lib: add igt_pipe_crc_checkDaniel Vetter
No need to duplicate this all over the place. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-27lib: Fix pipe_crc->ctl_fd assertVille Syrjälä
Use the correct fd in the assert(). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2013-11-04lib: drop return value from igt_drop_cachesDaniel Vetter
No one actually cares, everyone expects it to just work. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-04lib: Add igt_drop_caches_set()Oscar Mateo
This is basically a "drop cache" interface to the igt_debugfs facilities. Also, update existing users. Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Cc: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01lib: make igt_install_exit_handler never failDaniel Vetter
Most callers didn't bother checking, so just move the asserts into the function itself. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01lib: consolidate pipe crc exit handlerDaniel Vetter
No need to sprinkle this all over: - exit handlers will only be registered once - they're always called when exiting, so no need to explictly call them. This allows us to hide all the pipe crc cleanup in the library. Cc: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01tests: use "auto" pipe CRC sourceDaniel Vetter
Makes stuff work on DP ports on gmch platforms automatically. Cc: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01lib: Don't forget to close the pipe ctl fd in igt_pipe_crc_reset()Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>