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>
This commit is contained in:
Daniel Vetter
2014-11-24 16:08:32 +01:00
parent d8078911f6
commit 57259d714d
8 changed files with 11 additions and 83 deletions
+2 -10
View File
@@ -230,7 +230,7 @@ static void test_crc_random(data_t *data)
}
}
static bool prepare_crtc(data_t *data, igt_output_t *output,
static void prepare_crtc(data_t *data, igt_output_t *output,
int cursor_w, int cursor_h)
{
drmModeModeInfo *mode;
@@ -267,11 +267,6 @@ static bool prepare_crtc(data_t *data, igt_output_t *output,
data->pipe_crc = igt_pipe_crc_new(data->pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
if (!data->pipe_crc) {
igt_info("auto crc not supported on this connector with pipe %i\n",
data->pipe);
return false;
}
/* x/y position where the cursor is still fully visible */
data->left = 0;
@@ -289,8 +284,6 @@ static bool prepare_crtc(data_t *data, igt_output_t *output,
/* get reference crc w/o cursor */
igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc);
return true;
}
static void cleanup_crtc(data_t *data, igt_output_t *output)
@@ -325,8 +318,7 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
for_each_pipe(display, p) {
data->pipe = p;
if (!prepare_crtc(data, output, cursor_w, cursor_h))
continue;
prepare_crtc(data, output, cursor_w, cursor_h);
valid_tests++;
-12
View File
@@ -359,18 +359,6 @@ static bool prepare_test(data_t *data, enum test_mode test_mode)
pipe_crc = igt_pipe_crc_new(data->pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
if (!pipe_crc) {
igt_info("auto crc not supported on this connector with crtc %i\n",
data->pipe);
igt_plane_set_fb(data->primary, NULL);
igt_output_set_pipe(output, PIPE_ANY);
igt_display_commit(display);
igt_remove_fb(data->drm_fd, &data->fb[0]);
igt_remove_fb(data->drm_fd, &data->fb[1]);
return false;
}
data->pipe_crc = pipe_crc;
-29
View File
@@ -247,21 +247,6 @@ test_plane(data_t *data, igt_output_t *output, enum pipe pipe, enum igt_plane pl
if (data->pipe_crc)
igt_pipe_crc_free(data->pipe_crc);
data->pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
if (!data->pipe_crc) {
igt_info("auto crc not supported on this connector with crtc %i\n",
pipe);
igt_plane_set_fb(primary, NULL);
igt_plane_set_fb(sprite, NULL);
igt_output_set_pipe(output, PIPE_ANY);
igt_display_commit(&data->display);
igt_remove_fb(data->drm_fd, &red_fb);
igt_remove_fb(data->drm_fd, &green_fb);
igt_remove_fb(data->drm_fd, &blue_fb);
return false;
}
/* set red fb and grab reference crc */
igt_plane_set_fb(primary, &red_fb);
@@ -410,20 +395,6 @@ test_crtc(data_t *data, igt_output_t *output, enum pipe pipe)
if (data->pipe_crc)
igt_pipe_crc_free(data->pipe_crc);
data->pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
if (!data->pipe_crc) {
igt_info("auto crc not supported on this connector with crtc %i\n",
pipe);
igt_plane_set_fb(primary, NULL);
igt_output_set_pipe(output, PIPE_ANY);
igt_display_commit(&data->display);
igt_remove_fb(data->drm_fd, &red_fb);
igt_remove_fb(data->drm_fd, &green_fb);
igt_remove_fb(data->drm_fd, &blue_fb);
return false;
}
/* set red fb and grab reference crc */
igt_plane_set_fb(primary, &red_fb);
-3
View File
@@ -151,9 +151,6 @@ test_read_crc_for_output(data_t *data, int pipe, igt_output_t *output,
pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
if (!pipe_crc)
return 0;
igt_pipe_crc_start(pipe_crc);
/* wait for N_CRCS vblanks and the corresponding N_CRCS CRCs */
-5
View File
@@ -136,11 +136,6 @@ static bool prepare_crtc(data_t *data)
data->pipe_crc = igt_pipe_crc_new(data->pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
if (!data->pipe_crc) {
igt_info("auto crc not supported on this connector with pipe %i\n",
data->pipe);
return false;
}
/* get reference crc for the white fb */
igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc);
+3 -10
View File
@@ -79,7 +79,7 @@ paint_squares(data_t *data, struct igt_fb *fb, drmModeModeInfo *mode,
cairo_destroy(cr);
}
static bool prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
igt_plane_t *plane)
{
drmModeModeInfo *mode;
@@ -91,11 +91,6 @@ static bool prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
/* create the pipe_crc object for this pipe */
igt_pipe_crc_free(data->pipe_crc);
data->pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
if (!data->pipe_crc) {
igt_info("auto crc not supported on this connector with pipe %i\n",
pipe);
return false;
}
mode = igt_output_get_mode(output);
@@ -149,8 +144,6 @@ static bool prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,
paint_squares(data, &data->fb, mode, IGT_ROTATION_0, plane);
igt_plane_set_fb(plane, &data->fb);
}
return true;
}
static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane)
@@ -200,8 +193,8 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane_type)
plane = igt_output_get_plane(output, plane_type);
igt_require(igt_plane_supports_rotation(plane));
if (!prepare_crtc(data, output, pipe, plane))
continue;
prepare_crtc(data, output, pipe, plane);
igt_display_commit2(display, commit);
/* collect unrotated CRC */
-3
View File
@@ -62,9 +62,6 @@ functional_test_init(functional_test_t *test, igt_output_t *output, enum pipe pi
drmModeModeInfo *mode;
test->pipe_crc = igt_pipe_crc_new(pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
igt_skip_on_f(!test->pipe_crc,
"auto crc not supported on this connector with pipe %i\n", pipe);
igt_output_set_pipe(output, pipe);