From patchwork Fri Oct 19 10:57:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru-Cosmin Gheorghe X-Patchwork-Id: 10649009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 34735112B for ; Fri, 19 Oct 2018 10:58:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2366428A68 for ; Fri, 19 Oct 2018 10:58:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1771F28A7F; Fri, 19 Oct 2018 10:58:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AB75228A68 for ; Fri, 19 Oct 2018 10:58:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 420546E358; Fri, 19 Oct 2018 10:58:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on0626.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::626]) by gabe.freedesktop.org (Postfix) with ESMTPS id 30FD36E358 for ; Fri, 19 Oct 2018 10:58:40 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.106.51) by AM5PR0802MB2546.eurprd08.prod.outlook.com (2603:10a6:203:a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 19 Oct 2018 10:58:37 +0000 From: Alexandru Gheorghe To: seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, liviu.dudau@arm.com, brian.starkey@arm.com, malidp@foss.arm.com, maxime.ripard@bootlin.com, maarten.lankhorst@linux.intel.com, ayan.halder@arm.com, daniel.vetter@ffwll.ch, raymond.smith@arm.com, david.garbett@arm.com, lisa.wu@arm.com, matt.szczesiak@arm.com, charles.xu@arm.com, james.qian.wang@arm.com Subject: [PATCH v5 8/9] drm/selftest: Refactor test-drm_plane_helper Date: Fri, 19 Oct 2018 11:57:51 +0100 Message-Id: <20181019105752.17741-9-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181019105752.17741-1-alexandru-cosmin.gheorghe@arm.com> References: <20181019105752.17741-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.106.51] X-ClientProxiedBy: LO2P265CA0387.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:f::15) To AM5PR0802MB2546.eurprd08.prod.outlook.com (2603:10a6:203:a0::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 677a1020-22d1-41b7-a2b8-08d635b1d23d X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2546; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2546; 3:5BnoiI+1lBTtWwTZj0z1QvfIKKBSGG558cmvzQ+0p7lr0T3E+qgVmdlN8KNalvfdd0vl6QxWzfD7piVhq8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oBT+xM+bW5N1tp5GnD+fTYE+FcbE+3pNSMm9dAqh6MrI3FKsp0t9IKjK4tivhQqsL56+02T4WUaukHK7O4T2mevbwaW1hycQi4c5SzB6HE4hsb/zt10JaEpTOWRdZbBWVpPCQqBtM+N/QxjwKnIRRrgjb9HB44hYPIsu4AENhayRBdeEL0FCbN0cjmxzPkwTuoThf2nG3Km+k7E5xB2coWs=; 4:DaU0wDTK+CDkAngxhIiwjawL1DNSk2k4OES6LAXzYo+HzJMmBYyyEIpnoggHjZXE0GjzAos37IrvzHc9qYWhCOimV4TYBS+oMF79PLh+BxrxyB1LVE1AazgvQ4J7NxG+J+6h2l2AgE5V8B5UZB7Qg0j7SNi1BpBGF/NAYkn1RD/QAwygzB/Bsz52AAdBIzetxKm4XvFGLwuTOHj8FmHgVxdNxZ0MLK05ZVqWxwrqH9amQDHQMpksLtUnhqZVJUHpAYsfqVpq4ZbiOhVnqL65heCa1Gww7GM2A3uqEV7y0brGp1epuAly0DSwVRoSFohT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM5PR0802MB2546; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2546; X-Forefront-PRVS: 0830866D19 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(39860400002)(136003)(346002)(396003)(199004)(189003)(6636002)(11346002)(105586002)(81156014)(81166006)(50226002)(106356001)(4326008)(97736004)(3846002)(476003)(25786009)(6116002)(16586007)(8676002)(53936002)(50466002)(486006)(1076002)(8936002)(316002)(2616005)(956004)(16526019)(48376002)(36756003)(26005)(478600001)(6486002)(386003)(7696005)(186003)(52116002)(51416003)(68736007)(446003)(5660300001)(305945005)(72206003)(76176011)(7736002)(2906002)(86362001)(66066001)(47776003)(6666004)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2546; H:e114479-lin.cambridge.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2546; 23:mBDWivVEEutLngRqLvEsJcBZTkwpxARF2V8h1oM?= MPmiG5Jhpo0owKKyGYqrIyvu9NzEkkwKv0xLowQ8hI7LrT5RWUCvaUU6zNp9sd9ES+QPgvAO50QKz3/4B9/ZOuacgWFu8YyoxTP9KX6E+vCLohILwSNuOXrNWUg2DvVxjn9z4D/0jbR1trkR7TeaB4G1bjAUkE34WYWB0jdU2oEAaem4kJoOwKW65lsRzQOVRzY+XxOPvtGvAj3Li0GiAF2bHprfeuB1T9ri8lruk67IBhxOrf+2qNjhlhEgccn1EyYDqMJjuU/h1HSbrNu9eJc1GQU3QeBcEIL1da5bfRPM3v9SOP07WyrG/mKL6G9Y6n9Ln84OeaRxDC6uf4ugXit2Rz0O0aw9Z7iVPsL77SKzNVFQbvpRDclS8V508N8qb7yPD4p1KBJ13CnLEvLGH5/+2EfvVxGRCEitiRl9HYaB+gS7R+xXis7qlafJdCF8ypZZYaI7cuJd6vFkAxcoWlAN+syspDtlAwHXl3pPXPgUEKivpVlRdmvJ1E8mVqjlTGrLAcZBAXyQhmw5y7HRxHQs7I0IyuUmy4WxeedYITW3BzLCeJAr6JJkuOaHw6Ot/cYIiEDCmQ472c/ncH1ZS0i1M2MU/L4RXO2zhNvLUaddBZfzaGNDpxbSA2av1h/jBShRmbwJ05jZOdKT3YpcpYc+1FPnVOCVpuvb9e/62b7aWOwW/gPu/8fbSXXeGcz7y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EyeoCee+8Q2WP0WmImvyqIzR+6/xdshAmtFkoPjvPZVNK0oF9vr1OZbpbMT2px/9Y/Pk/wQ3XAbA2OohRG7Nn2C9WElReXU91ENY+X3Eg49OmTZ8Is1ST3P/qHOhIauM1tbfydsNIyWpFmVXRYpYrG+NgniW4AZjcRQnW/Xw5MFLG2zAqMN1Ph/vIPwifWKkwwiCHsRyDqbbq8bE2/oDhGh0oN56EtAcrx4ymIOP58dvpQEyBIcocunlQuCpjSrFgLHLOKZ7Wpi/5HplPa5bz3/3vpgEWQdwSOhZ0PRDorFo62A==; 5:unvI1fTjKv3b+snhWGPyuQmqBzqqFDKOPvs0sbZCgYBcbGx9dTRJaQvwBIdptYe9Z/e42IAcA4Ud/s0xXeHW/50qg6JO2F0Gljq5eQW2yc0sMwrgk0GWjiNDv/c2EJem1V9ZLC5u/047eu9FRlrolveEFIuVe88mF007bU3MbyM=; 7:7dAbHUiVWBcts9RdVXhDpEjTYshSXryMqO96oXTrXKXWuxeoM0wDr+6QMBLKSm9iMeWIobBUZX9SOZbcEHqIf1f0tNKKhqxMhesUZ1jpO4SaWYVmTxcffvIG+bmcgI8nywOyOR/ezLOVKDk7VhI8smfQvZyMWaTQFf4/7M1bim/nGTXbkwJ5eK0AoQycWHCorEc7veHbVR1V5m90NBhnoRMWe1+gl1HvgPjF3Hl0zUqi6fc8O8pn6RUettGyB7II SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2018 10:58:37.0054 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 677a1020-22d1-41b7-a2b8-08d635b1d23d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2546 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd@arm.com, Alexandru Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The idea is to split test implementations in different compilation units, but have one single place where we define the list of tests, in this case(drm_modeset_selftests.h). Signed-off-by: Alexandru Gheorghe Reviewed-by: Daniel Vetter --- ...er_selftests.h => drm_modeset_selftests.h} | 0 .../drm/selftests/test-drm_modeset_common.c | 11 ++++++++++- .../drm/selftests/test-drm_modeset_common.h | 2 +- .../gpu/drm/selftests/test-drm_plane_helper.c | 19 +------------------ 4 files changed, 12 insertions(+), 20 deletions(-) rename drivers/gpu/drm/selftests/{drm_plane_helper_selftests.h => drm_modeset_selftests.h} (100%) diff --git a/drivers/gpu/drm/selftests/drm_plane_helper_selftests.h b/drivers/gpu/drm/selftests/drm_modeset_selftests.h similarity index 100% rename from drivers/gpu/drm/selftests/drm_plane_helper_selftests.h rename to drivers/gpu/drm/selftests/drm_modeset_selftests.h diff --git a/drivers/gpu/drm/selftests/test-drm_modeset_common.c b/drivers/gpu/drm/selftests/test-drm_modeset_common.c index fad5209043f1..2a7f93774006 100644 --- a/drivers/gpu/drm/selftests/test-drm_modeset_common.c +++ b/drivers/gpu/drm/selftests/test-drm_modeset_common.c @@ -7,9 +7,18 @@ #include "test-drm_modeset_common.h" +#define TESTS "drm_modeset_selftests.h" +#include "drm_selftest.h" + +#include "drm_selftest.c" + static int __init test_drm_modeset_init(void) { - return test_drm_plane_helper(); + int err; + + err = run_selftests(selftests, ARRAY_SIZE(selftests), NULL); + + return err > 0 ? 0 : err; } static void __exit test_drm_modeset_exit(void) diff --git a/drivers/gpu/drm/selftests/test-drm_modeset_common.h b/drivers/gpu/drm/selftests/test-drm_modeset_common.h index bdeba264661f..b0065a2eb067 100644 --- a/drivers/gpu/drm/selftests/test-drm_modeset_common.h +++ b/drivers/gpu/drm/selftests/test-drm_modeset_common.h @@ -13,6 +13,6 @@ #define FAIL_ON(x) FAIL((x), "%s", "FAIL_ON(" __stringify(x) ")\n") -int test_drm_plane_helper(void); +int igt_check_plane_state(void *ignored); #endif diff --git a/drivers/gpu/drm/selftests/test-drm_plane_helper.c b/drivers/gpu/drm/selftests/test-drm_plane_helper.c index 0dad2f812a27..0a9553f51796 100644 --- a/drivers/gpu/drm/selftests/test-drm_plane_helper.c +++ b/drivers/gpu/drm/selftests/test-drm_plane_helper.c @@ -11,9 +11,6 @@ #include "test-drm_modeset_common.h" -#define TESTS "drm_plane_helper_selftests.h" -#include "drm_selftest.h" - static void set_src(struct drm_plane_state *plane_state, unsigned src_x, unsigned src_y, unsigned src_w, unsigned src_h) @@ -76,7 +73,7 @@ static bool check_crtc_eq(struct drm_plane_state *plane_state, return true; } -static int igt_check_plane_state(void *ignored) +int igt_check_plane_state(void *ignored) { int ret; @@ -220,17 +217,3 @@ static int igt_check_plane_state(void *ignored) return 0; } - -#include "drm_selftest.c" - -/** - * test_drm_plane_helper - Run drm plane helper selftests. - */ -int test_drm_plane_helper(void) -{ - int err; - - err = run_selftests(selftests, ARRAY_SIZE(selftests), NULL); - - return err > 0 ? 0 : err; -}