From patchwork Mon Jan 17 23:22:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Micha=C5=82_Winiarski?= X-Patchwork-Id: 12715726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B983C433EF for ; Mon, 17 Jan 2022 23:24:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 128AD112537; Mon, 17 Jan 2022 23:24:03 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id DAC54112537 for ; Mon, 17 Jan 2022 23:24:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642461841; x=1673997841; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=+LuqyvzIVWbDrsQgB4b1R5PvMixjLTJt5tRX3TTFcH0=; b=frBcWFQLm52jje9oxYjq8J697MYfo0MYT/TlYZS/jT+o9uuFVdiOZbS1 uQgj9mGvJZx6ye8S9muB9JWL82bcjeC1cc3yKxNPgHT4LyHRYcmj74a6V K8/R+0fqDi6c5Fbg1UARtXDIumXLe2n+H0FT42aOLmfjfrKkHNl+QXpIn xxhqsurQHbvZMPvv3AWKbE6eUkawFgnxvSIhTPj7lA/kMIqRMj2mrsqol UGkiZyAIyeWRVYE++VRIZ2cKJCpZXzB/oVOFo1tQ6RbJAiiZsuM8W0Kil rz0NGy5kgth08WYPV56KKBQWmPTASrvEhmotBSFRkTFQQwwV2tRBZfUCd Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10230"; a="269082552" X-IronPort-AV: E=Sophos;i="5.88,296,1635231600"; d="scan'208";a="269082552" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jan 2022 15:24:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,296,1635231600"; d="scan'208";a="474580596" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga003.jf.intel.com with ESMTP; 17 Jan 2022 15:24:00 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Mon, 17 Jan 2022 15:24:00 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Mon, 17 Jan 2022 15:24:00 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.171) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Mon, 17 Jan 2022 15:23:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oPAO+birnV8arpjMF9/LrAwJwp8Bwq9t+H73wfrRSJrWVTk26h1Q91YkQ7Xv8qJwvUfbfRS+avjG6BAmp/z0EL56W7Zn1gz4tbmcXRBrJ//Ybpq8/USBWtQGrlp+Pc38YOmCwLsAeAhyjmca4ym9oEEQJqWxR+QTV5BnVZoVDRwNUHYHDZrv1ggZtcGGppDv5peWWnlA1NlFErYlQnn7QOYOZwAgUkOOaupL90gECRTh06yt+SZcf6fM/AEhhrFm6YbXE9GnZXmNIURXg9MKw4UJD0dVuVMp7XB3Lpe76y3hnonVjbUyKNsw0Mo1IZWuO20XqYDm5ysobiIFzBBa+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wHOexDPOdH8SjgVToC8z7hwLPHJKkf2LtkbbNxWMql0=; b=eYulv1mAITGMUKd8KcAHO+amTeWKlaS2q1xXw6+4HGJPDA1TYkij41FKoldm1dKr3V4c2Cm3Wz2anx9QQ0fF9y8F36zZ1MPM0DGXueZo9a5lvqLsJUWX1Nm63Z3de9ld576bkbXqiEw8US8lD+G8/HpxzOoUbw3H4Ham+NzKPFSRCLttDlZ8iqwQaTbQ1QuhJdQNnkDNxvOxy/xbBM6qBbW8Pnur0l4t5StFISCAtZBLryWu+pY8BuHjjVQ6z+jMdK70t1LfKeKzFTmcFW5i6w61apUX0s7ThjMTbxKPwt2gBl+eWJ9hrJkoOpGZexB2/AmMA7UTOI9zsLBEp4TXWg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) by DM6PR11MB4140.namprd11.prod.outlook.com (2603:10b6:5:19f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.11; Mon, 17 Jan 2022 23:23:54 +0000 Received: from DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::fc15:bd26:128a:f5f5]) by DM4PR11MB5373.namprd11.prod.outlook.com ([fe80::fc15:bd26:128a:f5f5%8]) with mapi id 15.20.4888.014; Mon, 17 Jan 2022 23:23:54 +0000 From: =?utf-8?q?Micha=C5=82_Winiarski?= To: , Subject: [RFC 00/10] drm: selftests: Convert to KUnit Date: Tue, 18 Jan 2022 00:22:49 +0100 Message-ID: <20220117232259.180459-1-michal.winiarski@intel.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: LO4P123CA0432.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18b::23) To DM4PR11MB5373.namprd11.prod.outlook.com (2603:10b6:5:394::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4e178c91-da1e-4596-58d2-08d9da106dc3 X-MS-TrafficTypeDiagnostic: DM6PR11MB4140:EE_ X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 46EULeB1aEjhxxZVyHCB7/TfIc2MfeOPJwwxdpYipLCyUsCsGUDUULIdYoxSTwlFtvwhVCkc8ZX/ujkDLxtzvgtvNjHHGgImPT5dXZGpakpXFik8T4iGh2Fjcq7+GSihOhXEhaUgNT9rFh/3PxkWRLm2aJS3P6OajxlZcKII8p0D9w7+jkMCgZEHqZB8HQvraJnOKjZOi/QQTlYNV/RNLmLbnjDSNA9BW7a2kM36iHMowoikSBHd90HpgcZhtp9WrkvTdrGVu7z7rlo/Y48W9pjt6FP01w7IbilEkED0pZkFimZ5bbATqVDKuWR8QUVuU8QCJoIBFuN/WcBcguM51JhEccHmqt6Lw2x55QF7dTjoxjcZM5E/c8TK3f2RseyN2kH/ArtQku+iCAivKa028Bv+30vynoougJ83eXqj1+/GHRaQLgFmIVY3teu9Vcd8erloD5TB5yqaDpyQKt7s6P6gCLHf+s/I6549VZKU7v+sT5S/ZwNy8QDuHiaUqEuysYyVpt8FrToDCHVb0Kp+hXNtLl3nT/pEdK1bor8xD2fL7NiJOkOaFjufpnLVmM38KioexQDCYnn3rAOxAvCH89TU533ZS8JQI58QMpgYk93rCrojAWI0UQWETQ6GguPvQxvLbCyCzqW3iEKyN8R8mA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5373.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(508600001)(7416002)(186003)(6506007)(966005)(82960400001)(86362001)(8676002)(6512007)(6666004)(83380400001)(38100700002)(8936002)(66556008)(54906003)(5660300002)(2906002)(6486002)(316002)(36756003)(2616005)(66946007)(26005)(1076003)(4326008)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?hjwH0wWunkFFhL9ohw6YkiuPx70P?= =?utf-8?q?2SXNmDBr38W/rI+p/MNi0sOFr3irA8kwJve0uTRMQ/hJafS4Qxv3v3dvFkC5a1Jrm?= =?utf-8?q?Acmq+VMc1M37Wk4Okr0qAj+iSv5CbMZ965DFYDlGKyJ/kAUrjKtwWB1+wQy5jAxTv?= =?utf-8?q?a2e6HhPBmIeVpPm7mIw4AoQf7PB0bKlBEY0qvPYto6LpiEdW9OlWT11TVhaI/joXE?= =?utf-8?q?7Auj3HIvoSX2z2aOKX6oAtjokU3nQvQ/gpvXrSol4B77AAHIb4Kg0mwTk9M9hl3/h?= =?utf-8?q?TV9V9OUTzpvymat+0aVbvwFIstLzhS4aa3Q51ULSvsnj7rDDZ1iHjMhxVuBYNpUFp?= =?utf-8?q?Tc3HA4A9ZannNgJucp2Tn0/CQZWLEG+8euWo/f0qXkkcFOKZVRHDFT+tP/30/aT/C?= =?utf-8?q?R1BeStjvqeF0fwBMlCVgT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ZREIW6if3vHExW8SzW5fFJxt0wnbA+IiNCO0SvnHcUvMOiL8?= =?utf-8?q?WeK2yudnOEUOlRVdomTWXENM1OG1aKJoiiSJGXwJbwHEi22Epl04axhg9nKq+dOWD?= =?utf-8?q?XfWNZKYX7jta6fxDjpFtRVmXIQMl702yQOBTlkk7iF6KJwphy/KF3w0SjP/iHufhF?= =?utf-8?q?8VrKEtSqAifqZbdsEshRPwsKDny/5+2fuoAxHe/prS63xEfEtSixFMrr/VfyLcVJe?= =?utf-8?q?D00jP3mA3zfnY4WdV3Kldp+76qvn9SusewLyaRe0VZuYSMv/gh4ae0sQGToRqTxKF?= =?utf-8?q?7cAT3kxF8sHzanWQuC2CLHAYeklQY/d/w=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 4e178c91-da1e-4596-58d2-08d9da106dc3 X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB5373.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2022 23:23:54.7048 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: A0ylaHLBBxQmk8j33N8IOgrP39XPFyouaU4zn4aq9n3eEOr/qrUXi31PW/CImoRyT5a7/W63dWiyMkhkohcrcSMustAF8Zn20e3vrKsWfC8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4140 X-OriginatorOrg: intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Micha=C5=82_Winiarski?= , Thomas Zimmermann , David Airlie , Brendan Higgins , Daniel Latypov , Arkadiusz Hiler , Petri Latvala Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" KUnit unifies the test structure and provides helper tools that simplify the development. Basic use case allows running tests as regular processes, leveraging User Mode Linux. For example, to execute all DRM unit tests: ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/gpu/drm (the tool also allows using QEMU instead of UML by adding e.g. --arch=x86_64) For developers - it means that it's easier to run unit tests on the development machine, tightening the feedback loop. When using UML, it also simplifies using gdb for debug (since the kernel is just a regular process). For CI systems - DRM tests can be moved from being executed on device under test (that's also running IGTs and so on) to being executed on buildsystem during build (just like checkpatch.pl). All tests were renamed - IGT prefix is no longer used. Compared to selftests executed by CI using IGT, there's one functional regression - KUnit test runner is not catching WARNs. To solve this, we could either go in the similar direction that UBSAN went in: 1195505 ("kunit: ubsan integration") Or we could expand the test runner to catch WARN signature in dmesg. Pastebin to preview the output and execution times: https://gitlab.freedesktop.org/-/snippets/4139 -Michał Michał Winiarski (10): drm: test-drm_cmdline_parser: Convert to KUnit drm: test-drm_plane_helper: Convert to KUnit drm: test-drm_format: Convert to KUnit drm: test-drm_framebuffer: Convert to KUnit drm: test-drm_damage_helper: Convert to KUnit drm: test-drm_dp_mst_helper: Convert to KUnit drm: test-drm_rect: Convert to KUnit drm: test-drm_mm: Convert to KUnit drm: selftests: Convert to KUnit drm: test: Simplify testing on UML with kunit.py drivers/gpu/drm/.kunitconfig | 3 + drivers/gpu/drm/Kconfig | 22 +- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/i915/Kconfig.debug | 1 - drivers/gpu/drm/selftests/Makefile | 7 - .../gpu/drm/selftests/drm_cmdline_selftests.h | 68 - drivers/gpu/drm/selftests/drm_mm_selftests.h | 28 - .../gpu/drm/selftests/drm_modeset_selftests.h | 40 - drivers/gpu/drm/selftests/drm_selftest.c | 109 - drivers/gpu/drm/selftests/drm_selftest.h | 41 - .../drm/selftests/test-drm_cmdline_parser.c | 1141 -------- .../drm/selftests/test-drm_damage_helper.c | 667 ----- .../drm/selftests/test-drm_dp_mst_helper.c | 273 -- drivers/gpu/drm/selftests/test-drm_format.c | 280 -- drivers/gpu/drm/selftests/test-drm_mm.c | 2487 ----------------- .../drm/selftests/test-drm_modeset_common.c | 32 - .../drm/selftests/test-drm_modeset_common.h | 52 - .../gpu/drm/selftests/test-drm_plane_helper.c | 223 -- drivers/gpu/drm/selftests/test-drm_rect.c | 223 -- drivers/gpu/drm/test/Makefile | 7 + .../gpu/drm/test/test-drm_cmdline_parser.c | 1027 +++++++ drivers/gpu/drm/test/test-drm_damage_helper.c | 667 +++++ drivers/gpu/drm/test/test-drm_dp_mst_helper.c | 429 +++ drivers/gpu/drm/test/test-drm_format.c | 356 +++ .../test-drm_framebuffer.c | 109 +- drivers/gpu/drm/test/test-drm_mm.c | 2426 ++++++++++++++++ drivers/gpu/drm/test/test-drm_plane_helper.c | 312 +++ drivers/gpu/drm/test/test-drm_rect.c | 249 ++ drivers/video/Kconfig | 4 + 29 files changed, 5558 insertions(+), 5727 deletions(-) create mode 100644 drivers/gpu/drm/.kunitconfig delete mode 100644 drivers/gpu/drm/selftests/Makefile delete mode 100644 drivers/gpu/drm/selftests/drm_cmdline_selftests.h delete mode 100644 drivers/gpu/drm/selftests/drm_mm_selftests.h delete mode 100644 drivers/gpu/drm/selftests/drm_modeset_selftests.h delete mode 100644 drivers/gpu/drm/selftests/drm_selftest.c delete mode 100644 drivers/gpu/drm/selftests/drm_selftest.h delete mode 100644 drivers/gpu/drm/selftests/test-drm_cmdline_parser.c delete mode 100644 drivers/gpu/drm/selftests/test-drm_damage_helper.c delete mode 100644 drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c delete mode 100644 drivers/gpu/drm/selftests/test-drm_format.c delete mode 100644 drivers/gpu/drm/selftests/test-drm_mm.c delete mode 100644 drivers/gpu/drm/selftests/test-drm_modeset_common.c delete mode 100644 drivers/gpu/drm/selftests/test-drm_modeset_common.h delete mode 100644 drivers/gpu/drm/selftests/test-drm_plane_helper.c delete mode 100644 drivers/gpu/drm/selftests/test-drm_rect.c create mode 100644 drivers/gpu/drm/test/Makefile create mode 100644 drivers/gpu/drm/test/test-drm_cmdline_parser.c create mode 100644 drivers/gpu/drm/test/test-drm_damage_helper.c create mode 100644 drivers/gpu/drm/test/test-drm_dp_mst_helper.c create mode 100644 drivers/gpu/drm/test/test-drm_format.c rename drivers/gpu/drm/{selftests => test}/test-drm_framebuffer.c (91%) create mode 100644 drivers/gpu/drm/test/test-drm_mm.c create mode 100644 drivers/gpu/drm/test/test-drm_plane_helper.c create mode 100644 drivers/gpu/drm/test/test-drm_rect.c