From patchwork Thu Feb 25 16:48:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zanoni, Paulo R" X-Patchwork-Id: 8425111 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 483EB9F314 for ; Thu, 25 Feb 2016 16:49:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81BE720270 for ; Thu, 25 Feb 2016 16:49:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EE4CE20212 for ; Thu, 25 Feb 2016 16:49:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 967776E916; Thu, 25 Feb 2016 16:49:21 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E9296E916 for ; Thu, 25 Feb 2016 16:49:20 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 25 Feb 2016 08:48:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,498,1449561600"; d="scan'208";a="894643749" Received: from jholm-mobl.amr.corp.intel.com (HELO panetone.amr.corp.intel.com) ([10.252.138.60]) by orsmga001.jf.intel.com with ESMTP; 25 Feb 2016 08:48:50 -0800 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 25 Feb 2016 13:48:32 -0300 Message-Id: <1456418912-25723-6-git-send-email-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456418912-25723-1-git-send-email-paulo.r.zanoni@intel.com> References: <1456418912-25723-1-git-send-email-paulo.r.zanoni@intel.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH igt 4/4] kms_frontbuffer_tracking: be aware of the new FBC Kernel workaround X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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),