From patchwork Tue Mar 8 14:51:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8535041 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 EE06CC0553 for ; Tue, 8 Mar 2016 14:53:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 17183200D4 for ; Tue, 8 Mar 2016 14:53:32 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 458B6200D0 for ; Tue, 8 Mar 2016 14:53:31 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1EDCC6E702; Tue, 8 Mar 2016 14:53:30 +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 EAB436E702 for ; Tue, 8 Mar 2016 14:53:15 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id p65so4558236wmp.1 for ; Tue, 08 Mar 2016 06:53:15 -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=VYhGSEBtuivfCg8DkUtTNjtCMX8zcT95kB99T9DwIjg=; b=bO4GznHLXnTjRlOz6pu3AylyW1iQjYzgwa4bhPGZ3bxsPLXOyZjR+WPZu+MXFBkPnk Cfzq64cR9P5L8xywARWE3yICLpGzCOWbLwhtdo7rjkb3hB+21KEsgFJdiH9AHTW68OfH zSBhs9zKKaazHjRWnopvvsMQK2HJibTIohkEXLOYUNJE1m0dE/bFmcccGU9dd8PBlMjk +ZKLk4rjX98rz8DqPgbR2aamZIL99UBe1eVZCbN9q08ynW7oqTY9mar+Q9juCut66VHq A8O4n1QrdGFRNwl7wtItg2hGmUe9JL0QHuQgBHKz4uegyU3b3IyhBy07qNIzQ3YDBmzw eC7w== 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=VYhGSEBtuivfCg8DkUtTNjtCMX8zcT95kB99T9DwIjg=; b=HbB7U08TFyj17VHwvxSlWabsIVNN+6izcGzaKHFwUWmFP88S/CdbNW1Qdl93DLn/ZV 8EhYwmBPA2lCjDvL/zEqcL/OKT8VNCDt6K3hFZZTjtbhMJrRdLRoeJRvDVAGXMELnpot 6iVy5IK13jjmHQJLiDjrgOSl/2VX9zX9EFQ721vqTI4zTOevvxC3OJZAHimooclIp0ZZ AaXITmd046ncj1b2HyssZj8OLgHnBB4pTi7MajwSHyER6SNdfSh8kxIAM9v9mBTGNYqu UqmW3++1QzDr6zD7iE2CorwA35rJrN3R5edDUBAJg3XnYIzayR/vhv0+wrsd6MMSChNz 7K4A== X-Gm-Message-State: AD7BkJKsvi0ZC3QbRCOw0zbrGZcrZ7Uq5CFULQywMfGAvh7ppU+Exmy8AU2MeGlLZR6Y8Q== X-Received: by 10.194.82.66 with SMTP id g2mr23933183wjy.161.1457448794154; Tue, 08 Mar 2016 06:53:14 -0800 (PST) Received: from cizrna.lan ([109.72.12.208]) by smtp.gmail.com with ESMTPSA id 3sm3781979wmp.14.2016.03.08.06.53.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Mar 2016 06:53:13 -0800 (PST) From: Tomeu Vizoso To: Intel GFX discussion Date: Tue, 8 Mar 2016 15:51:35 +0100 Message-Id: <1457448699-9778-14-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 13/17] kms_addfb_basic: call igt_create_bo_with_dimensions 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 Many tests can do their work on drivers other than i915 and even with just dumb buffers, so call igt_create_bo_with_dimensions instead of gem_create which will paper out the differences and call the proper ioctls or cause the subtest to be skipped if that's not possible. Signed-off-by: Tomeu Vizoso --- Changes in v2: None tests/kms_addfb_basic.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/tests/kms_addfb_basic.c b/tests/kms_addfb_basic.c index d36cc6aab231..473b5e9d7236 100644 --- a/tests/kms_addfb_basic.c +++ b/tests/kms_addfb_basic.c @@ -51,9 +51,11 @@ static void invalid_tests(int fd) f.pitches[0] = 512*4; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); - gem_bo_small = gem_create(fd, 1024*1024*4 - 4096); + gem_bo_small = igt_create_bo_with_dimensions(fd, 1024, 1023, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo_small); f.handles[0] = gem_bo; @@ -129,7 +131,8 @@ static void pitch_tests(int fd) f.pitches[0] = 1024*4; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); } @@ -211,9 +214,11 @@ static void size_tests(int fd) f_8.pitches[0] = 1024*2; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); - gem_bo_small = gem_create(fd, 1024*1024*4 - 4096); + gem_bo_small = igt_create_bo_with_dimensions(fd, 1024, 1023, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo_small); } @@ -293,7 +298,8 @@ static void addfb25_tests(int fd) struct local_drm_mode_fb_cmd2 f = {}; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); memset(&f, 0, sizeof(f)); @@ -364,9 +370,11 @@ static void addfb25_ytile(int fd, int gen) int shouldret; igt_fixture { - gem_bo = gem_create(fd, 1024*1024*4); + gem_bo = igt_create_bo_with_dimensions(fd, 1024, 1024, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo); - gem_bo_small = gem_create(fd, 1024*1023*4); + gem_bo_small = igt_create_bo_with_dimensions(fd, 1024, 1023, + DRM_FORMAT_XRGB8888, 0, 0, NULL, NULL, NULL); igt_assert(gem_bo_small); shouldret = gen >= 9 ? 0 : -1;