From patchwork Mon Apr 4 21:18:19 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: 8744521 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4C1A0C0553 for ; Mon, 4 Apr 2016 21:18:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7180D2024F for ; Mon, 4 Apr 2016 21:18:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8DE9620263 for ; Mon, 4 Apr 2016 21:18:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2562C6E688; Mon, 4 Apr 2016 21:18:53 +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 60E656E686 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:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,442,1455004800"; d="scan'208";a="947919717" 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:31 -0700 From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Mon, 4 Apr 2016 18:18:19 -0300 Message-Id: <1459804700-3804-2-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 2/3] kms_frontbuffer_tracking: recreate the FBs at every subtest 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 This patch was originally written because of a workaround we were planning to merge. Later we improved the workaround so it wouldn't need this patch anymore. Then later we gave up on the workaround, but decided to go with a plan that would cause GTT mmap writes to invalidate FBC in case the frontbuffer ever had a WC mmap. So now we need the patch again because we don't want a subtest that involves an WC mmap to change the behavior of other unrelated subtests that use GTT mmaps. Even if we don't go with the current planned Kernel patch, merging this should be worth in order to avoid future related problems. v2: New commit message. Signed-off-by: Paulo Zanoni --- tests/kms_frontbuffer_tracking.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index c6d6bc0..f37de6d 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -711,12 +711,31 @@ static void create_shared_fb(enum pixel_format format) PLANE_PRI, &s->big); } +static void destroy_fbs(enum pixel_format format) +{ + struct screen_fbs *s = &fbs[format]; + + if (!s->initialized) + return; + + if (scnd_mode_params.connector_id) { + igt_remove_fb(drm.fd, &s->scnd_pri); + igt_remove_fb(drm.fd, &s->scnd_cur); + igt_remove_fb(drm.fd, &s->scnd_spr); + } + igt_remove_fb(drm.fd, &s->prim_pri); + igt_remove_fb(drm.fd, &s->prim_cur); + igt_remove_fb(drm.fd, &s->prim_spr); + igt_remove_fb(drm.fd, &s->offscreen); + igt_remove_fb(drm.fd, &s->big); +} + static void create_fbs(enum pixel_format format) { struct screen_fbs *s = &fbs[format]; if (s->initialized) - return; + destroy_fbs(format); s->initialized = true; @@ -747,25 +766,6 @@ static void create_fbs(enum pixel_format format) LOCAL_I915_FORMAT_MOD_X_TILED, PLANE_SPR, &s->scnd_spr); } -static void destroy_fbs(enum pixel_format format) -{ - struct screen_fbs *s = &fbs[format]; - - if (!s->initialized) - return; - - if (scnd_mode_params.connector_id) { - igt_remove_fb(drm.fd, &s->scnd_pri); - igt_remove_fb(drm.fd, &s->scnd_cur); - igt_remove_fb(drm.fd, &s->scnd_spr); - } - igt_remove_fb(drm.fd, &s->prim_pri); - igt_remove_fb(drm.fd, &s->prim_cur); - igt_remove_fb(drm.fd, &s->prim_spr); - igt_remove_fb(drm.fd, &s->offscreen); - igt_remove_fb(drm.fd, &s->big); -} - static bool set_mode_for_params(struct modeset_params *params) { int rc;