summaryrefslogtreecommitdiff
path: root/tests/kms_frontbuffer_tracking.c
diff options
context:
space:
mode:
authorPaulo Zanoni <paulo.r.zanoni@intel.com>2015-10-30 18:05:58 -0200
committerPaulo Zanoni <paulo.r.zanoni@intel.com>2015-11-27 09:57:35 -0200
commitd2a17f4bc4d466ac19fd00ae7fe7998d6626460e (patch)
tree25508d3f6abe2878f92fa4d2c5c282df515821fc /tests/kms_frontbuffer_tracking.c
parent98bb8428b2939311015b45ca59d7d9c65949c9bf (diff)
kms_frontbuffer_tracking: add tilingchange subtest
During the review of a recent FBC patch, Ville pointed a problem that happens when we use the page flip IOCTL to switch between buffers that have different tiling formats. This test should catch the problem introduced by that patch - which was not merged, by the way, so the test should be passing. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Diffstat (limited to 'tests/kms_frontbuffer_tracking.c')
-rw-r--r--tests/kms_frontbuffer_tracking.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index d90bb25e..4734f253 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -2989,6 +2989,51 @@ static void stridechange_subtest(const struct test_mode *t)
igt_remove_fb(drm.fd, &new_fb);
}
+/**
+ * tilingchange - alternate between tiled and untiled in multiple ways
+ *
+ * METHOD
+ * This test alternates between tiled and untiled frontbuffers of the same
+ * size and format through multiple different APIs: the page flip IOCTL,
+ * normal modesets and the plane APIs.
+ *
+ * EXPECTED RESULTS
+ * FBC gets properly disabled for the untiled FB and reenabled for the
+ * tiled FB.
+ *
+ * FAILURES
+ * Bad Kernels may somehow leave FBC enabled, which can cause FIFO underruns
+ * that lead to CRC assertion failures.
+ */
+static void tilingchange_subtest(const struct test_mode *t)
+{
+ struct igt_fb new_fb, *old_fb;
+ struct modeset_params *params = pick_params(t);
+ enum flip_type flip_type;
+
+ prepare_subtest(t, NULL);
+
+ old_fb = params->fb.fb;
+
+ create_fb(t->format, params->fb.fb->width, params->fb.fb->height,
+ LOCAL_DRM_FORMAT_MOD_NONE, t->plane, &new_fb);
+ fill_fb(&new_fb, COLOR_PRIM_BG);
+
+ for (flip_type = 0; flip_type < FLIP_COUNT; flip_type++) {
+ igt_debug("Flip type: %d\n", flip_type);
+
+ /* Set a buffer with no tiling. */
+ params->fb.fb = &new_fb;
+ page_flip_for_params(params, flip_type);
+ do_assertions(ASSERT_FBC_DISABLED);
+
+ /* Put FBC back in a working state. */
+ params->fb.fb = old_fb;
+ page_flip_for_params(params, flip_type);
+ do_assertions(0);
+ }
+}
+
static int opt_handler(int option, int option_index, void *data)
{
switch (option) {
@@ -3378,6 +3423,9 @@ int main(int argc, char *argv[])
igt_subtest_f("%s-stridechange", feature_str(t.feature))
stridechange_subtest(&t);
+
+ igt_subtest_f("%s-tilingchange", feature_str(t.feature))
+ tilingchange_subtest(&t);
}
if (t.feature & FEATURE_PSR)