From patchwork Wed Mar 2 14:00:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8480811 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 560909F372 for ; Wed, 2 Mar 2016 14:01:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 732F720386 for ; Wed, 2 Mar 2016 14:01:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7D02E2038F for ; Wed, 2 Mar 2016 14:01:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A091E6E87B; Wed, 2 Mar 2016 14:01:25 +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 483B76E880 for ; Wed, 2 Mar 2016 14:01:21 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id n186so9824024wmn.0 for ; Wed, 02 Mar 2016 06:01:21 -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=WzTkkj8iJe8+z9Z4iFXP8blHM7KaFkq6SXfMBeqjnN0=; b=Qc0SIZMEJ6Aqd0m5EiM1J84y+KMirf3kceQE4lY5711cWeS+USLdEtR3o67rxt1t+w JnW/WaVO6lPzZtIZwFR0T0T0ztWY1HHXbRJrwHBv681GrOKwGA61QfPsyFvAvuYPaKI8 FveEFZC5ABW1OpSke9jQS0Q8NbwEI/UmNZRH0h3Q8QwCwtJwiawLlpizESAS73TsyQQy U2S2UsSkOONKHVBx0+tYeMJyiBwlcAXi+AcCFv5VCI/pYHZUkunsKC/Bg++CmEAlc5PZ z77DSLhvLDBwaRUztxqTn8BIjSRSeGRz5AyYJKCSaTzDuR9LM+bL2a0oC94h1R+aQBFC Jx8Q== 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=WzTkkj8iJe8+z9Z4iFXP8blHM7KaFkq6SXfMBeqjnN0=; b=VZHx8zrFayNQu3wF1xROyZ4OzQvvVOhP1C8Yhv95UQcLcvpNieLvNENIUa5h1FgE7r UWA5ZWN5OPbF8eWV4dt9M+2JDqy4t2qzDFyuzdzcDPyDM/0NI/+gpUuSYoltJiAVVc3s yLK5SJUAxwba0j5jd4VemF75N5pOHNEnihXhQwBuT4dI1hYDm5zxEkzbzNLvSnLvtzcn 1ibs9Deo+D7GphYdTA+wY3F4IventUDfCIOcCGTpioIu1bEIF3hIK6ldIVabG3ocS9js UNXWiLGGPoOnHhZU/LwknwF/URTxQdBhkR1LRjddOl1U+90JToiPwvmZWgQeanV2RdgL Wy2A== X-Gm-Message-State: AD7BkJLVlVQ7bk4MIIEtW5sjtgHB0Az7OxS0YmoE60dt+oSiZW1MbWXeyhwIt5IXXYf9KQ== X-Received: by 10.28.172.132 with SMTP id v126mr80806wme.28.1456927279779; Wed, 02 Mar 2016 06:01:19 -0800 (PST) Received: from cizrna.lan ([109.72.12.223]) by smtp.gmail.com with ESMTPSA id e19sm4359876wmd.1.2016.03.02.06.01.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Mar 2016 06:01:18 -0800 (PST) From: Tomeu Vizoso To: Intel GFX discussion Date: Wed, 2 Mar 2016 15:00:19 +0100 Message-Id: <1456927221-32421-13-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456927221-32421-1-git-send-email-tomeu.vizoso@collabora.com> References: <1456927221-32421-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 v1 12/14] 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 --- 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); }