From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/4] tests/kms_cursor_crc: Handle display cleanup in init
Date: Mon, 29 Apr 2019 18:05:55 +0200 [thread overview]
Message-ID: <20190429160557.17889-3-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20190429160557.17889-1-maarten.lankhorst@linux.intel.com>
By handling display cleanup in init, we recover better when subtests fail.
With igt_display_reset, a lot of custom cleanup is now gone,
and we don't have to half-heartedly clean up at the end of every subtest.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
tests/kms_cursor_crc.c | 44 ++++++++++++++----------------------------
1 file changed, 14 insertions(+), 30 deletions(-)
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index 7e6c522c438b..ed44a2ab803e 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -337,6 +337,18 @@ static void test_crc_random(data_t *data)
}
}
+static void cleanup_crtc(data_t *data)
+{
+ igt_display_t *display = &data->display;
+
+ igt_pipe_crc_free(data->pipe_crc);
+ data->pipe_crc = NULL;
+
+ igt_remove_fb(data->drm_fd, &data->primary_fb);
+
+ igt_display_reset(display);
+}
+
static void prepare_crtc(data_t *data, igt_output_t *output,
int cursor_w, int cursor_h)
{
@@ -344,9 +356,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
igt_display_t *display = &data->display;
igt_plane_t *primary;
+ cleanup_crtc(data);
+
/* select the pipe we want to use */
igt_output_set_pipe(output, data->pipe);
- cursor_disable(data);
/* create and set the primary plane fb */
mode = igt_output_get_mode(output);
@@ -362,9 +375,6 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
igt_display_commit(display);
/* create the pipe_crc object for this pipe */
- if (data->pipe_crc)
- igt_pipe_crc_free(data->pipe_crc);
-
data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
@@ -379,31 +389,10 @@ static void prepare_crtc(data_t *data, igt_output_t *output,
data->curh = cursor_h;
data->refresh = mode->vrefresh;
- /* make sure cursor is disabled */
- cursor_disable(data);
- igt_wait_for_vblank(data->drm_fd, data->pipe);
-
/* get reference crc w/o cursor */
igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc);
}
-static void cleanup_crtc(data_t *data, igt_output_t *output)
-{
- igt_display_t *display = &data->display;
- igt_plane_t *primary;
-
- igt_pipe_crc_free(data->pipe_crc);
- data->pipe_crc = NULL;
-
- igt_remove_fb(data->drm_fd, &data->primary_fb);
-
- primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
- igt_plane_set_fb(primary, NULL);
-
- igt_output_set_pipe(output, PIPE_ANY);
- igt_display_commit(display);
-}
-
static void test_cursor_alpha(data_t *data, double a)
{
igt_display_t *display = &data->display;
@@ -466,7 +455,6 @@ static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int
{
prepare_crtc(data, data->output, cursor_w, cursor_h);
testfunc(data);
- cleanup_crtc(data, data->output);
}
static void create_cursor_fb(data_t *data, int cur_w, int cur_h)
@@ -602,10 +590,6 @@ static void test_rapid_movement(data_t *data)
timersub(&end, &start, &delta);
usec = delta.tv_usec + 1000000 * delta.tv_sec;
igt_assert_lt(usec, 0.9 * 400 * 1000000 / data->refresh);
-
- igt_assert_eq(drmModeSetCursor(data->drm_fd, crtc_id,
- 0, data->curw, data->curh), 0);
-
}
static void run_tests_on_pipe(data_t *data, enum pipe pipe)
--
2.20.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-04-29 16:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-29 16:05 [igt-dev] [PATCH i-g-t 0/4] kms_cursor_crc test improvements and cleanups Maarten Lankhorst
2019-04-29 16:05 ` [igt-dev] [PATCH i-g-t 1/4] tests/kms_cursor_crc: Run tests once per pipe Maarten Lankhorst
2019-04-29 16:05 ` Maarten Lankhorst [this message]
2019-04-29 16:05 ` [igt-dev] [PATCH i-g-t 3/4] lib/igt_kms: Update cursor when fb width/height changes too Maarten Lankhorst
2019-04-29 16:05 ` [igt-dev] [PATCH i-g-t 4/4] tests/kms_cursor_crc: Use igt_kms calls for everything Maarten Lankhorst
2019-04-29 16:57 ` [igt-dev] ✓ Fi.CI.BAT: success for kms_cursor_crc test improvements and cleanups Patchwork
2019-04-29 22:31 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-05-11 15:17 ` [igt-dev] [PATCH i-g-t 0/4] " Juha-Pekka Heikkilä
2019-05-13 15:07 ` Maarten Lankhorst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190429160557.17889-3-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox