Age | Commit message (Collapse) | Author |
|
A black FB on amdgpu returns a CRC of (0, 0, 0), which IGT considers
suspicious. All our CRC values are also 16-bit so a value of 0xffffffff
can't be obtained.
Drop the suspicious CRC checks on amdgpu by checking the device in
crc_sanity_checks. We need the drm_fd for this so pass in pipe_crc
to the function to get it. It makes more sense to me to do it this
way than to duplicate code and the explanation on both calls to
crc_sanity_checks.
v2: rebase
Cc: Leo Li <sunpeng.li@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
|
|
No one is using anything but the "auto" crc source, so the enum
listing other options is quite pointless. Let's switch to just
using the string instead of the enum. That way any hypothetical
test that wants to use a more specific crc source can just
pass in the proper string.
v2: Assert the string isn't NULL (Chris)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Deal with frame counter wraparound correcrtly.
v2: Make the comparison functions available for everyone (Chris)
Add some docs (gtk-doc seems obtuse so not 100% warning free)
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #v1
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Read sizeof - 1 to buf so it stays null-terminated.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
We have tons of issues with crc mismatches, but often by that time
there was already a fifo underrun, which disables further fifo
underrun reporting. Reset fifo underrun reporting before we capture a
crc so that it's easier to figure out why the crc mismatch happened.
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
|
|
For one shot crc collection, let's use the same helper function as we
use for continuous crc collection. With this patch, we first drain the
pipe from queued crc values and read the fresh crc.
v2: We don't need to drain the pipe right after we start
collecting crc's (Dhinakaran)
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
|
|
Function to open a debugfs directory of a connector associated to
a device.
v2:
instead of string manipulation openat used [Chris]
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
All users of igt_pipe_crc_get_single() want a blocking read even if
the fd was opened in nonblocking mode. Make it so.
v2: Fix the docs for igt_pipe_crc_get_single()
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
|
|
tests/kms_frontbuffer_tracking and tests/kms_psr read debugfs nodes
several times after opening the directory once. There is already an
implementation of this in the kms_frontbuffer_tracking, moving that
functionality to the library will allow us to share the code with kms_psr
and kms_fbcon_fbt
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
|
|
A pair of igt_pipe_crc_drain() and igt_pipe_crc_get_single() has a bug in which
you're not sure whether the new CRC is captured because the vblank irq may race
against the CRC irq and delivered to userspace too soon.
When receiving a vblank event, igt_pipe_crc_drain() will then drain all crc's,
but not the new (stale) crc, which is then delivered and immediately returned
by igt_pipe_crc_get_single().
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Now crc framework does not wait for first CRC during open, User need
to wait for crc if he wants so.
This patch make changes in igt_pipe_crc_start to make sure we wait
until first crc available after open to keep the tests behaviour same.
Without this if driver is skipping few initial crcs there will be
mismatch in expected and actual number of crcs returned by crc
framework.
Changes Since V1:
- poll instead of read_one_crc (Maarten)
Changes Since V2:
- poll without timeout, we already have igt_timeout (Maarten)
Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
|
|
This will fix the PSR tests to fail slightly faster, since they wait
indefinitely for a CRC that never comes during open.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
[mlankhorst: Increase timeout to 10 seconds for HSW CRC w/a.]
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
|
|
igt_debugfs.c: In function 'igt_assert_crc_equal':
igt_debugfs.c:353:3: warning: 'index' may be used uninitialized in this function [-Wmaybe-uninitialized]
igt_debugfs.c: In function 'igt_check_crc_equal':
igt_debugfs.c:375:3: warning: 'index' may be used uninitialized in this function [-Wmaybe-uninitialized]
Fixes: 7422d7540a3b ("lib/igt_debugfs: Introduce CRC check function, with logic made common")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
|
|
When using igt_debugfs_*() inside a tight loop, the overhead of calling
xstat64 (from is_mountpoint()) creeps up in the profiles. Eliminate it
by caching the resultant path for finding/mounting debugfs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
|
|
read_crc returns an error instead of 0 on timeout now, so handle
this correctly. This is a small error introduced in
commit 7d48c0252c384d18318de89c54817bdfe9c832fc
Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Date: Fri Feb 2 13:34:25 2018 +0100
lib/igt_debugfs: Add igt_pipe_crc_get_single and igt_pipe_crc_drain, v4.
It causes the kms_chv_cursor_fail to take 27 minutes, so fix this..
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
|
|
Collecting CRC may result in a modeset and extra vblank waits. On some
tests this will increase the runtime a lot, so it makes sense to
keep it enabled, and only collect the most recent CRC when needed.
Changes since v1:
- Fix read_crc semantics. (Ville)
Changes since v2:
- Remove EAGAIN assert, can be reached from drain_crc.
Changes since v3:
- Do not infinitely loop in igt_pipe_crc_drain().
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com> #v2
Tested-by: Vidya Srinivas <vidya.srinivas@intel.com>
|
|
Why open code a printf/write loop, when we already have a function
providing it?
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com
|
|
For reasons entirely not clear to me meson gtkdoc runs in strict
xml parsing mode, whereas automake gtkdoc doesn't. And gtkdoc itself
is tooooooooo dense to correctly escape this stuff.
Paper around this.
v2: {foo} instead of of tripy <foo> (Joonas)
v3: More fixups (Joonas)
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
This patch gets rid of the Android support, deleting all the hacks and
moving code around to the places it belongs.
Android build is not really maintained properly and rots rather fast.
With recent push for Meson here and Android going for Soong it will only
accelerate.
It's a good time to drop the illusion of providing any support.
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Kalyan Kondapally <kalyan.kondapally@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
|
|
Since the tools want to work without the module loaded, remove the
assumption that we want to load the driver to find debugfs.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjala <ville.syrjala@linux.intel.com>
|
|
is_mountpoint() asserts rather than report the error. Normally this
isn't a problem, except for atypical selftests.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
In kernel v4.10 the legacy crc api has been replaced by a generic
drm crc API. Remove support of the i915 legacy CRC api, since
this is no longer needed.
Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
[mlankhorst: Put the igt_require_pipes_crc() changes in their own commit.]
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #irc
|
|
commit 8038e09be5a3ac06 ("drm/crc: Only open CRC on atomic drivers when
the CRTC is active.") rejects opens on the CRC when the CRTC is not
configured. Use fstat instead to check this file exists, so we don't
accidentally rely on the legacy CRC path.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> #irc
|
|
As the driver itself keeps a cache of objects, these too need to be
flushed prior to producing a stable count of objects.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102655
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
|
|
Some distros (such as Gentoo) are removing the include of
sys/sysmacros.h from sys/types.h. Explicitly include sysmacros.h in
files where we use the minor() and major() functions.
Signed-off-by: James Ausmus <james.ausmus@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
|
|
By using ftw, we avoid the issue of having to handle directory recursion
ourselves and can focus on the test of checking the reading a
sysfs/debugfs does not break runtime suspend. In the process, disregard
errors when opening the individual files as they may fail for other
reasons.
v2: Bracket the file open/close with the wait_for_suspended() tests.
Whilst the fd is open, it may be keeping the device awake, e.g.
i915_forcewake_user.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Jari Tahvanainen <jari.tahvanainen@intel.com>
|
|
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
When running the full chamelium test binary, it occurs that the hpd
storm exit handler (that restores its initial value) will fail when
trying to acquire DRM master.
This happens even though the previously-held DRM file descriptor was
closed already.
Since there is no need to get DRM master for debugfs access purposes,
open the DRM node without requesting master to fix the issue.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
|
|
Commit 34a54192e1fb ("lib/igt_debugfs: Add extended helper to format
crc to string") introduced the following compiler warning:
igt_debugfs.c: In function ‘igt_crc_to_string_extended’:
igt_debugfs.c:373:4: warning: format not a string literal, argument
types not checked [-Wformat-nonliteral]
i == (crc->n_words - 1) ? '\0' : delimiter);
This patch addresses the warning while also preventing a possible bad
memory access access if n_words is > 64. I have no clue why we
care about the padding size (crc_size), but since this was added
recently, I'd rather leave it alone.
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
|
|
This introduces a igt_crc_to_string_extended helper that allows
formatting a crc to a string with a given delimiter and size to print
per crc word.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
Reviewed-by: Lyude <lyude@redhat.com>
|
|
This introduces an igt_check_crc_equal function in addition to
igt_assert_crc_equal and makes the CRC comparison logic from the latter
common. In particular, an igt_find_crc_mismatch function indicates
whether there is a mistmatch and at what index, so that the calling
functions can print the diverging values.
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
Reviewed-by: Lyude <lyude@redhat.com>
|
|
The documentation was lying. The igt_crc_to_string() is threadsafe and
does not return a pointer to an internal buffer.
Actually the caller is responsible for the memory that is allocated (and
they are for all the current cases), so let's put that in the doc too.
While I was at it I got rid of strdup() in favor of an early allocation.
Cc: Martin Peres <martin.peres@intel.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Martin Peres <martin.peres@intel.com>
|
|
Not all elements in the crc array may be valid, so only use the valid
ones to generate the string.
Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
|
|
It's not used anymore, so remove it.
Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
|
|
Keep the debugfs dir found during pipe_crc init around for the entire
duration of the test.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
The function igt_debugfs_open() would not close the debugfs dir before
returning. Tests that do a lot of pipe CRC comparaions, such as
kms_cursor_crc, would eventually fail.
(kms_cursor_crc:3853) igt-debugfs-CRITICAL: Test assertion failure function igt_pipe_crc_do_start, file igt_debugfs.c:387:
(kms_cursor_crc:3853) igt-debugfs-CRITICAL: Failed assertion: err == 0
(kms_cursor_crc:3853) igt-debugfs-CRITICAL: Last errno: 24, Too many open files
(kms_cursor_crc:3853) igt-debugfs-CRITICAL: error: -24 != 0
83884e97e187 ("Restore "lib: Open debugfs files for the given DRM device"")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Wrapping fdopen() proved dangerous, the underlying fd is not refcounted,
and we must close it in the library or else we easily leak and exhaust
all fd. Since we can't provide igt_debugfs_fopen(), move the burden onto
the caller for those that require a stream FILE*.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
As we can export igt_debugfs_dir() to cache the path to our debugfs
directory, encourage a few more users to take advantage.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
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>
|
|
The contents of errno are strictly only valid after a syscall (or library
function) reported an error.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
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>
|
|
igt_debugfs.c: In function 'igt_drop_caches_has':
igt_debugfs.c:890:9: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
fscanf(file, "0x%" PRIx64, &mask);
^
CC igt_aux.lo
CC igt_gt.lo
igt_gt.c: In function 'igt_force_gpu_reset':
igt_gt.c:382:8: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result]
fscanf(file, "%d", &wedged);
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Introduce a new fork helper that spawns a process that just repeatedly
calls i915_gem_shrink_all() and watch what happens as we try to use
objects that have been shrunk.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Recently we added i915_hpd_storm_ctl into i915's debugfs directory,
which allows us to control the thresholds i915 uses for detecting
hotplug interrupt storms from userspace, along with the ability to
entirely disable them. This adds some helper functions into IGT to
enable making use of this feature, along with adding some chamelium
tests for it.
Signed-off-by: Lyude <lyude@redhat.com>
|
|
buf array may overflow with when writing '\0' if
MAX_LINE_LEN bytes are read during read().
Signed-off-by: Robert Foss <robert.foss@collabora.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
|
|
mount("/sys/kernel/debug") will return an error if something is already
mounted there. So let's check for that before calling mount(). This
allows many of the tools (eg. intel_reg) to work even when no drm
drivers are loaded since the earlier "/sys/kernel/debug/dri" & co.
path checks will fail in that case and we will fall back to attempting
to mount debugfs ourselves.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
|
Since we're not modifying these anywhere, let's make them const so as to
not break code doing comparisons against compile-time CRCs.
Signed-off-by: Lyude <lyude@redhat.com>
Tested-by: Robert Foss <robert.foss@collabora.com>
|
|
The kernel has now a new debugfs ABI that can also allow capturing frame
CRCs for drivers other than i915.
Add alternative codepaths so the new ABI is used if the kernel is recent
enough, and fall back to the legacy ABI if not.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Robert Foss <robert.foss@collabora.com>
|