[Intel-gfx] [PATCH igt 4/4] kms_frontbuffer_tracking: be aware of the new FBC Kernel workaround
Paulo Zanoni
paulo.r.zanoni at intel.com
Thu Feb 25 16:48:32 UTC 2016
We recently implemented a Kernel workaround that deactivates FBC in
case the FBC frontbuffer was ever CPU or WC mmapped. Change the test
suite to take this into account, otherwise we'll fail many tests with
!fbc_enabled assertions.
Also notice that if your Kernel doesn't have the workaround, then this
commit is going to break a lot of tests. The Kernel commit you need
is:
drm/i915: opt-out CPU and WC mmaps from FBC
Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
---
tests/kms_frontbuffer_tracking.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c
index aa124d3..671b0dd 100644
--- a/tests/kms_frontbuffer_tracking.c
+++ b/tests/kms_frontbuffer_tracking.c
@@ -1900,6 +1900,23 @@ static void update_wanted_crc(const struct test_mode *t, struct both_crcs *crc)
wanted_crc = crc;
}
+/*
+ * The recent Kernel versions have a workaround that will refuse to activate FBC
+ * if the FBC frontbuffer has ever been CPU or WC mmapped.
+ */
+static bool op_disables_fbc(const struct test_mode *t,
+ enum igt_draw_method method)
+{
+ if (method != IGT_DRAW_MMAP_CPU && method != IGT_DRAW_MMAP_WC)
+ return false;
+ if (t->plane != PLANE_PRI)
+ return false;
+ if (t->screen == SCREEN_PRIM || t->fbs == FBS_SHARED)
+ return true;
+
+ return false;
+}
+
static bool op_disables_psr(const struct test_mode *t,
enum igt_draw_method method)
{
@@ -1969,6 +1986,8 @@ static void draw_subtest(const struct test_mode *t)
igt_assert(false);
}
+ if (op_disables_fbc(t, t->method))
+ assertions |= ASSERT_FBC_DISABLED;
if (op_disables_psr(t, t->method))
assertions |= ASSERT_PSR_DISABLED;
@@ -2027,7 +2046,12 @@ static void multidraw_subtest(const struct test_mode *t)
target = pick_target(t, params);
for (m1 = 0; m1 < IGT_DRAW_METHOD_COUNT; m1++) {
+ if (op_disables_fbc(t, m1))
+ continue;
+
for (m2 = m1 + 1; m2 < IGT_DRAW_METHOD_COUNT; m2++) {
+ if (op_disables_fbc(t, m2))
+ continue;
igt_debug("Methods %s and %s\n",
igt_draw_get_method_name(m1),
--
2.7.0
More information about the Intel-gfx
mailing list