From patchwork Mon Apr 4 21:18:20 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: 8744511 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 28BB49F7C9 for ; Mon, 4 Apr 2016 21:18:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69A262024F for ; Mon, 4 Apr 2016 21:18:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 84A7120272 for ; Mon, 4 Apr 2016 21:18:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 14AF06E686; Mon, 4 Apr 2016 21:18:52 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 98EE76E688 for ; Mon, 4 Apr 2016 21:18:50 +0000 (UTC) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP; 04 Apr 2016 14:18:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,442,1455004800"; d="scan'208";a="947919727" Received: from pdsanabr-mobl5.amr.corp.intel.com (HELO panetone.amr.corp.intel.com) ([10.254.177.196]) by orsmga002.jf.intel.com with ESMTP; 04 Apr 2016 14:18:33 -0700 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Mon, 4 Apr 2016 18:18:20 -0300 Message-Id: <1459804700-3804-3-git-send-email-paulo.r.zanoni@intel.com> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1459804700-3804-1-git-send-email-paulo.r.zanoni@intel.com> References: <1459804638-3588-1-git-send-email-paulo.r.zanoni@intel.com> <1459804700-3804-1-git-send-email-paulo.r.zanoni@intel.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH igt 3/3] kms_frontbuffer_tracking: properly handle mixing GTT and WC mmaps 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=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 The new Kernel behavior is that whenever a buffer has ever been WC mmapped, the GTT mmaps will be treated as CPU operations. Because of this, if we don't issue the dirty_fb IOCTL after doing frontbuffer rendering with the GTT mmaps, FBC will remain disabled. Luckily, the only subtest that does this sort of mix is the multidraw subtest. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index f37de6d..89e6ea8 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -2079,6 +2079,7 @@ static void multidraw_subtest(const struct test_mode *t) struct modeset_params *params = pick_params(t); struct fb_region *target; enum igt_draw_method m1, m2, used_method; + bool wc_used = false; switch (t->plane) { case PLANE_PRI: @@ -2108,6 +2109,17 @@ static void multidraw_subtest(const struct test_mode *t) igt_draw_get_method_name(used_method)); draw_rect(pattern, target, used_method, r); + + if (used_method == IGT_DRAW_MMAP_WC) + wc_used = true; + + if (used_method == IGT_DRAW_MMAP_GTT && + wc_used) { + struct rect rect = + pattern->get_rect(target, r); + fb_dirty_ioctl(target, &rect); + } + update_wanted_crc(t, &pattern->crcs[t->format][r]);