summaryrefslogtreecommitdiff
path: root/lib/igt_debugfs.c
AgeCommit message (Collapse)Author
2016-11-07igt: Add a test for reordering execbufsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-19lib: Add support for DROP_FREED in igt_drop_caches_set()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-16lib: Export igt_debugfs_mount()Chris Wilson
Not everything we want from debugfs is under debugfs/dri. But we do want to share the code to find the debugfs mount point (and mount it if is not found). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-27lib/debugs: nuke igt_crc_equal againDaniel Vetter
This was intentionally left out of the abi since CRC have fairly low entropy and can't be reliably compared for inequality in testcases. Spotted while fixing up warnigns in docs, but given that igt_assert_crc_equal has a big comment explaining why only the positive assert exists I'm not sure all those docs are all that useful :( Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-27lib: update docs for igt_debugfsDaniel Vetter
- gtk-doc requires that the names in comments match the ones in the header declaration. - igt_debugfs_dir works together with igt_sysfs_get(). Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-09lib/debugfs: Adjust path creation for opening /debugfs/.../dir/%dChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-28lib: Fix reporting of debugfs mountpointChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-20lib/debugfs: Fix probe path for opening i915 debugfs dirChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-20igt/vgem_basic: Exercise opening sysfs/debugfsChris Wilson
For fun, debugfs/.../names currently explodes, so lets capture that and make sure that basic access to debugfs does no harm. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-23lib/crc: Update doc for igt_pipe_crc_get_crcsDaniel Vetter
Noticed while discussing CRC tests with Ville that this was totally wrong. v2: Ville pointed out that it only does not block when opened using igt_pipe_crc_new_nonblocking. Still different from igt_pipe_crc_collect_crc, which will always block. v3: Fix type (Ville). Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-21lib: add crc comparison function without an assertLionel Landwerlin
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-01-08lib: Add igt_pipe_crc_new_nonblock()Ville Syrjälä
Add support for reading the CRC in non-blocking mode. Useful for tests that want to start the CRC capture, then do a bunch of operations, then collect however many CRCs that got generated. The current igt_pipe_crc_new() + igt_pipe_crc_get_crcs() method would block until it gets the requested number of CRCs, whreas in non-blocking mode we can just read as many as got generated thus far. v2: __attribute__((warn_unused_result)), document the new igt_pipe_crc_get_crcs() return value (Daniel) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-12-21lib: Use igt_assert_eq() to check for crc component countVille Syrjälä
It's nice to see just how many components the crc claims to have when the count don't match what we expect. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-16gem_flink_race/prime_self_import: Improve test reliabilityDerek Morton
gem_flink_race and prime_self_import have subtests which read the number of open gem objects from debugfs to determine if objects have leaked during the test. However the test can fail sporadically if the number of gem objects changes due to other process activity. This patch introduces a change to check the number of gem objects several times to filter out any fluctuations. v2: Moved the common code to a library and made the loop android specific (Daniel Vetter) v3: Renamed get_stable_obj_count -> igt_get_stable_obj_count Signed-off-by: Derek Morton <derek.j.morton@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-09-25lib: fix fopen mode in igt_debugfs_searchThomas Wood
Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-24lib: add igt_debugfs_searchThomas Wood
Add igt_debugfs_search to search each line in a debugfs file for a specified substring. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-09-08lib: various documentation fixesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-12lib/core: Add igt_reset_timeoutDaniel Vetter
Convenience wrapper suggested by Chris for igt_set_timeout(0, NULL). v2: While at it add an empty line in kms_flip to make set/reset_timeout a visual block. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-12lib/core: Add optional reason for timeout failureDaniel Vetter
"Timed out" isn't a terribly informative message, allow users to set something more informative. Inspired by a request from Jesse. Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-05lib: add igt_debugfs_read()Paulo Zanoni
A helpful function for when you want to read a whole debugfs file to a string and don't want to worry about opening and closing file descriptors and asserting buffer sizes. We've been using this already for kms_frontbuffer_tracking and kms_fbcon_fbt, so the only test with new code here is kms_fbc_crc. Also notice that for kms_fbc_crc we had to increase the buffer size since the file can sometimes be bigger than 64 bytes - depending on the reason why FBC is disabled. Of course, there are probably many other programs we can patch, but I'm not doing this now. v2: Add the macro to wrap sizeof() (Daniel). v3: Add documentation for the macro too (Daniel). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-02docs: various documentation fixesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-06-27doc: Remove i-g-t/intel prefixes and capitalize section titlesDamien Lespiau
Looks better! Signed-off-by: Damien Lespiau <damien.lespiau@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-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>