From patchwork Tue Mar 8 14:51:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8535061 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 97D7F9F2B4 for ; Tue, 8 Mar 2016 14:53:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B4410201C8 for ; Tue, 8 Mar 2016 14:53:52 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D668E200D4 for ; Tue, 8 Mar 2016 14:53:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA0D26E707; Tue, 8 Mar 2016 14:53:50 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6A52D6E706 for ; Tue, 8 Mar 2016 14:53:48 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id p65so4561091wmp.1 for ; Tue, 08 Mar 2016 06:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=p4Ax9+EZcTshuawsUOmMru1p8ple5QLPX3qNDeGPhdY=; b=S3u+bZrHN3V9dxNXLjfKba9fUDJ6fQhoOi0xsEieFJn6P5gfFD7Bdzy4JFddJyQX0x JBf/y3MErPV/vCURa4spqaX2UKwcteWg70VJXYecoPTmZG8tk8x/zWvm3IifixBWzM4z lx80O3LejPA8eRbpg76djwZblAPovCAjT1UjVICI0t6561ekS+ig8KAJTIEhplUdEOCE VqTJCPels3x4cvN2vkMnlBhsQDXGmM2cXAs7pT2Eu97A5UB7Y0JoGrGeKzXF34k7r7Ym yt6NREBf5lEJ/LOxkvLjXbENAMuhy0G2CU5EZL8gYbsWE6VWiF72OeCt6XzhrRX+qoR5 dCdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=p4Ax9+EZcTshuawsUOmMru1p8ple5QLPX3qNDeGPhdY=; b=BZr9A0gwTCYwR27SS5m3LVkRQo1GI9ViZJnb9hB6jSggxNe4lscAm4PFuTqu7wMaRK gMoGoWQsnJ8FhxPaol+EHL9MTEUNHc6lwPyBhP4WxjDRzrMdoaRcbM5jrpcbp5cAgffx 39Y9OPluSQnJR4AsMm31zy+miWNw6oelNSXRjGx/Z95nuJ6Bt5WkowsDeaHP56BqJQHy jax9IHfcrIxtFypwtjOm/IowCFLZEEQJdsv1H/gn3Tx3QRaCgC1F22ijBCcXObH4YlZJ oukuFjENUH7zdCy5NAVyt9VZQhAA95wvsCzOp6+eJbGlbGWltnqlv1iAvDEwSbqIUJQj Oflg== X-Gm-Message-State: AD7BkJJrKTIniPxQgWJ57y397DolRvhHbfRcAP9yMewVdjCE0QHSAEywlxz5K9tly4wk5Q== X-Received: by 10.194.71.70 with SMTP id s6mr29517126wju.1.1457448825975; Tue, 08 Mar 2016 06:53:45 -0800 (PST) Received: from cizrna.lan ([109.72.12.208]) by smtp.gmail.com with ESMTPSA id 3sm3781979wmp.14.2016.03.08.06.53.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Mar 2016 06:53:45 -0800 (PST) From: Tomeu Vizoso To: Intel GFX discussion Date: Tue, 8 Mar 2016 15:51:37 +0100 Message-Id: <1457448699-9778-16-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1457448699-9778-1-git-send-email-tomeu.vizoso@collabora.com> References: <1457448699-9778-1-git-send-email-tomeu.vizoso@collabora.com> Cc: Daniel Stone , Tomeu Vizoso , Micah Fedke , Gustavo Padovan , Emil Velikov Subject: [Intel-gfx] [i-g-t PATCH v2 15/17] kms_addfb_basic: Split tiling_tests off 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 Move tests requiring tiled BOs to the end so they don't cause unrelated subtests to be skipped when testing drivers with only dumb buffer support. Signed-off-by: Tomeu Vizoso --- Changes in v2: None tests/kms_addfb_basic.c | 50 ++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c index e61d2502d78b..6dfaecfc38a7 100644 --- a/tests/kms_addfb_basic.c +++ b/tests/kms_addfb_basic.c @@ -156,16 +156,50 @@ static void pitch_tests(int fd) } } + igt_fixture + gem_close(fd, gem_bo); +} + + +static void tiling_tests(int fd) +{ + struct drm_mode_fb_cmd2 f = {}; + uint32_t tiled_x_bo; + uint32_t tiled_y_bo; + + f.width = 512; + f.height = 512; + f.pixel_format = DRM_FORMAT_XRGB8888; f.pitches[0] = 1024*4; + igt_fixture { + tiled_x_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, LOCAL_I915_FORMAT_MOD_X_TILED, + 1024*4, NULL, NULL, NULL); + igt_assert(tiled_x_bo); + + tiled_y_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, LOCAL_I915_FORMAT_MOD_Y_TILED, + 1024*4, NULL, NULL, NULL); + igt_assert(tiled_y_bo); + + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); + igt_assert(gem_bo); + } + + f.pitches[0] = 1024*4; igt_subtest("basic-X-tiled") { - gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); + f.handles[0] = tiled_x_bo; + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0); igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); f.fb_id = 0; } igt_subtest("framebuffer-vs-set-tiling") { + f.handles[0] = gem_bo; + gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == 0); igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 512*4) == -EBUSY); @@ -176,20 +210,24 @@ static void pitch_tests(int fd) f.pitches[0] = 512*4; igt_subtest("tile-pitch-mismatch") { - gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); + f.handles[0] = tiled_x_bo; + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && errno == EINVAL); } f.pitches[0] = 1024*4; igt_subtest("basic-Y-tiled") { - gem_set_tiling(fd, gem_bo, I915_TILING_Y, 1024*4); + f.handles[0] = tiled_y_bo; + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && errno == EINVAL); } - igt_fixture - gem_close(fd, gem_bo); + igt_fixture { + gem_close(fd, tiled_x_bo); + gem_close(fd, tiled_y_bo); + } } static void size_tests(int fd) @@ -448,6 +486,8 @@ igt_main addfb25_ytile(fd, gen); + tiling_tests(fd); + igt_fixture close(fd); }