diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-11-24 16:08:32 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-11-24 16:29:27 +0100 |
commit | 57259d714d3fe1170cf931af72648219856a9918 (patch) | |
tree | 0935c8d34785f96c0227b02834c2d2e2d50dadb3 /lib | |
parent | d8078911f63494eba67f8f07ffb56c4bdeae7bc9 (diff) |
lib/igt_debugfs: Don't setup crc in _new
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_debugfs.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c index b30f5e49..0b098eed 100644 --- a/lib/igt_debugfs.c +++ b/lib/igt_debugfs.c @@ -294,6 +294,9 @@ static bool igt_pipe_crc_do_start(igt_pipe_crc_t *pipe_crc) { char buf[64]; + /* Stop first just to make sure we don't have lingering state left. */ + igt_pipe_crc_stop(pipe_crc); + sprintf(buf, "pipe %s %s", kmstest_pipe_name(pipe_crc->pipe), pipe_crc_source_name(pipe_crc->source)); errno = 0; @@ -362,9 +365,9 @@ void igt_require_pipe_crc(void) * * This sets up a new pipe CRC capture object for the given @pipe and @source. * - * Returns: A pipe CRC object if the given @pipe and @source is available, NULL - * otherwise. Tests can use this to intelligently skip if they require a - * specific pipe CRC source to function properly. + * Returns: A pipe CRC object if the given @pipe and @source. The library + * assumes that the source is always available since recent kernels support at + * least INTEL_PIPE_CRC_SOURCE_AUTO everywhere. */ igt_pipe_crc_t * igt_pipe_crc_new(enum pipe pipe, enum intel_pipe_crc_source source) @@ -388,14 +391,6 @@ igt_pipe_crc_new(enum pipe pipe, enum intel_pipe_crc_source source) pipe_crc->pipe = pipe; pipe_crc->source = source; - /* make sure this source is actually supported */ - if (!igt_pipe_crc_do_start(pipe_crc)) { - igt_pipe_crc_free(pipe_crc); - return NULL; - } - - igt_pipe_crc_stop(pipe_crc); - return pipe_crc; } |