From patchwork Fri Aug 30 22:30:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matt Roper X-Patchwork-Id: 11124659 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D84D413B1 for ; Fri, 30 Aug 2019 22:30:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C082523431 for ; Fri, 30 Aug 2019 22:30:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C082523431 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9767F6E0FF; Fri, 30 Aug 2019 22:30:42 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 346A06E0F4; Fri, 30 Aug 2019 22:30:41 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Aug 2019 15:30:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,447,1559545200"; d="scan'208";a="381263505" Received: from mdroper-desk.fm.intel.com ([10.105.128.12]) by fmsmga005.fm.intel.com with ESMTP; 30 Aug 2019 15:30:40 -0700 From: Matt Roper To: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Date: Fri, 30 Aug 2019 15:30:23 -0700 Message-Id: <20190830223023.16396-1-matthew.d.roper@intel.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH i-g-t] tests/kms_panel_fitting: Fix plane scaling avoidance on gen7/gen8 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Most gen7 and gen8 platforms can't do plane scaling, so we need to ensure the test doesn't try to do plane scaling on those platforms. The legacy non-atomic subtest bakes these platform characteristics into the test itself since legacy modesetting interfaces don't provide a way to probe platform capabilities like atomic does. Maarten previously tried to address this with commit 24c5e0778 ("tests/kms_panel_fitting: Do not use scaling on gen7 and gen8, v2."), but he augmented an existing test for gen9+pipeC which comes too late since we've already turned on the plane at that point. We can fix this by moving the test up higher; not only before we enable panel fitting, but also before we turn on the sprite. Note that this still isn't a great subtest since it's very Intel-specific, despite being part of a generic KMS test that's intended for all vendors. A future enhancement might be to try to probe the platform capabilities with a TEST_ONLY atomic operation before using the legacy interfaces to actually program them. While touching the code, I also added some slight restructuring, added additional comments, and broke up >80 char lines to add clarity to what's going on. Cc: Maarten Lankhorst Signed-off-by: Matt Roper Reviewed-by: Ville Syrjälä --- tests/kms_panel_fitting.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index 491e429f..a942294b 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -131,11 +131,10 @@ static void test_panel_fitting(data_t *d) igt_fb_set_position(&d->fb2, d->plane2, 100, 100); igt_fb_set_size(&d->fb2, d->plane2, d->fb2.width-200, d->fb2.height-200); igt_plane_set_position(d->plane2, 100, 100); - igt_plane_set_size(d->plane2, mode->hdisplay-200, mode->vdisplay-200); - igt_display_commit2(display, COMMIT_UNIVERSAL); /* - * most of gen7 and all of gen8 doesn't support scaling at all. + * Most of gen7 and all of gen8 doesn't support plane scaling + * at all. * * gen9 pipe C has only 1 scaler shared with the crtc, which * means pipe scaling can't work simultaneously with panel @@ -144,9 +143,24 @@ static void test_panel_fitting(data_t *d) * Since this is the legacy path, userspace has to know about * the HW limitations, whereas atomic can ask. */ - if (IS_GEN8(devid) || (IS_GEN7(devid) && !IS_IVYBRIDGE(devid)) || + if (IS_GEN8(devid) || + (IS_GEN7(devid) && !IS_IVYBRIDGE(devid)) || (IS_GEN9(devid) && pipe == PIPE_C)) - igt_plane_set_size(d->plane2, d->fb2.width-200, d->fb2.height-200); + /* same as visible area of fb => no scaling */ + igt_plane_set_size(d->plane2, + d->fb2.width-200, + d->fb2.height-200); + else + /* + * different than visible area of fb => plane scaling + * active + */ + igt_plane_set_size(d->plane2, + mode->hdisplay-200, + mode->vdisplay-200); + + /* Plane scaling active (if possible), pfit off */ + igt_display_commit2(display, COMMIT_UNIVERSAL); /* enable panel fitting along with sprite scaling */ mode->hdisplay = 1024;