From patchwork Fri Apr 15 12:58:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8850841 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 220E0C0553 for ; Fri, 15 Apr 2016 12:59:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 14FFC202E9 for ; Fri, 15 Apr 2016 12:59:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E63D5200C1 for ; Fri, 15 Apr 2016 12:59:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FBA06EC3E; Fri, 15 Apr 2016 12:59:25 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id ED1CE6EC39 for ; Fri, 15 Apr 2016 12:59:22 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id a140so6036945wma.2 for ; Fri, 15 Apr 2016 05:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=4q+kQnMf7XpgnodWdmQbY4wdKXRkx5FMA9ZMspMQ9QY=; b=RDSfJiSh1dqvl14ljleZNLVrfsfKPxKM9c+HiUwizuTrl4zN0UELf11/nrAz/ijfxh hTDK+vZ/LwBE5Z2iek/aN0utuPj4jshFDFDQW48ffugIt+LxvFAK0dwDy7/78XRmOjlm 2dsRG+/0a/b9nmy2Tw2jEvKHPw0a+paHJWnhDy/qiijmnMu8PWus9XyF5EF2WiEjeJel FUuqHnYcq8VObo839n9J6yJFuVm7YLklhNU4ClF1VeTL3PV/hdZkyNQhVc/tsDEKbeDj DKTh/32g2jKhnCjVWjkTRwzJMwg3AMvTaOzyc1Xw3x0nH6Ixf94jUfUENm5pENFIpKFX lhoQ== 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; bh=4q+kQnMf7XpgnodWdmQbY4wdKXRkx5FMA9ZMspMQ9QY=; b=T/9Rk+VbEPsQPXSosXoK8CvBx+nY4JCR9y61gT3OW5xkXJ0Uqxl6/ipP7lsJZ20Xjp yZBxdk1ofjLd2BnSc4K2aptoqrnEHmg6VZJpz86zNIEZJ6z9FHMhoh/xorvPtHVBvrUx DFkg6lxM3JWGQQCE6VB9hk49aNNXkTyhl0KlwaHaJrFo1/pQrwbgroRLXPMbXOl0657O RPHIHTc+OXroJ6wGNXj3kj5SkrfVODn4i7xeA/MPVL2b1jEbA4d7nv53LCOPV1IGr7jY aspqZaeyhHCeZBUsUg6uQhqwtINzzPAM55tpczQ1gu5FoSOsonjH/WEY3K3892uxwEho A/oA== X-Gm-Message-State: AOPr4FVYhi8xIZubz8hZnhKps5BOfK1426lem6x5oOBkV3n0NkO8Y4QE0OJLFNqGa25PNA== X-Received: by 10.28.184.77 with SMTP id i74mr4423704wmf.82.1460725161310; Fri, 15 Apr 2016 05:59:21 -0700 (PDT) Received: from cizrna.lan ([109.72.12.224]) by smtp.gmail.com with ESMTPSA id 188sm11568308wmk.6.2016.04.15.05.59.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Apr 2016 05:59:20 -0700 (PDT) From: Tomeu Vizoso To: Intel GFX discussion Date: Fri, 15 Apr 2016 14:58:26 +0200 Message-Id: <1460725106-21862-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.5 Cc: Tomeu Vizoso Subject: [Intel-gfx] [PATCH] tests/kms_addfb_basic: Move tiling tests into their own groups 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.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 So those subtests that require tiling don't cause unrelated subtests to be skipped. Signed-off-by: Tomeu Vizoso --- tests/kms_addfb_basic.c | 148 ++++++++++++++++++++++++------------------------ 1 file changed, 73 insertions(+), 75 deletions(-) diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c index 64047303dea7..cdfcd179854e 100644 --- a/tests/kms_addfb_basic.c +++ b/tests/kms_addfb_basic.c @@ -160,73 +160,74 @@ static void pitch_tests(int fd) 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; + uint32_t tiled_x_bo = 0; + uint32_t tiled_y_bo = 0; 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); + igt_subtest_group { + 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); + } - 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") { + f.handles[0] = tiled_x_bo; - f.pitches[0] = 1024*4; - igt_subtest("basic-X-tiled") { - 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_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; - 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); - igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4) == -EBUSY); - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); - f.fb_id = 0; - } + 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); + igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4) == -EBUSY); + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); + f.fb_id = 0; + } - f.pitches[0] = 512*4; - igt_subtest("tile-pitch-mismatch") { - f.handles[0] = tiled_x_bo; + f.pitches[0] = 512*4; + igt_subtest("tile-pitch-mismatch") { + f.handles[0] = tiled_x_bo; - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && - errno == EINVAL); - } + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && + errno == EINVAL); + } - f.pitches[0] = 1024*4; - igt_subtest("basic-Y-tiled") { - f.handles[0] = tiled_y_bo; + f.pitches[0] = 1024*4; + igt_subtest("basic-Y-tiled") { + f.handles[0] = tiled_y_bo; - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && - errno == EINVAL); - } + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_ADDFB2, &f) == -1 && + errno == EINVAL); + } - igt_fixture { - gem_close(fd, tiled_x_bo); - gem_close(fd, tiled_y_bo); + igt_fixture { + gem_close(fd, tiled_x_bo); + gem_close(fd, tiled_y_bo); + } } } @@ -366,36 +367,33 @@ static void addfb25_tests(int fd) igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) < 0 && errno == EINVAL); } - igt_subtest("addfb25-X-tiled-mismatch") { - gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); - igt_require_fb_modifiers(fd); - - f.modifier[0] = LOCAL_DRM_FORMAT_MOD_NONE; - igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) < 0 && errno == EINVAL); - } - - igt_subtest("addfb25-X-tiled") { - gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); - igt_require_fb_modifiers(fd); + igt_subtest_group { + igt_fixture { + gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); + igt_require_fb_modifiers(fd); + } - f.modifier[0] = LOCAL_I915_FORMAT_MOD_X_TILED; - igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0); - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); - f.fb_id = 0; - } + igt_subtest("addfb25-X-tiled-mismatch") { + f.modifier[0] = LOCAL_DRM_FORMAT_MOD_NONE; + igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) < 0 && errno == EINVAL); + } - igt_subtest("addfb25-framebuffer-vs-set-tiling") { - gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4); - igt_require_fb_modifiers(fd); + igt_subtest("addfb25-X-tiled") { + f.modifier[0] = LOCAL_I915_FORMAT_MOD_X_TILED; + igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0); + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); + f.fb_id = 0; + } - f.modifier[0] = LOCAL_I915_FORMAT_MOD_X_TILED; - igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0); - igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 512*4) == -EBUSY); - igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4) == -EBUSY); - igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); - f.fb_id = 0; + igt_subtest("addfb25-framebuffer-vs-set-tiling") { + f.modifier[0] = LOCAL_I915_FORMAT_MOD_X_TILED; + igt_assert(drmIoctl(fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0); + igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 512*4) == -EBUSY); + igt_assert(__gem_set_tiling(fd, gem_bo, I915_TILING_X, 1024*4) == -EBUSY); + igt_assert(drmIoctl(fd, DRM_IOCTL_MODE_RMFB, &f.fb_id) == 0); + f.fb_id = 0; + } } - igt_fixture gem_close(fd, gem_bo); }