From patchwork Thu Nov 3 14:51:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 14928 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp581882wru; Thu, 3 Nov 2022 07:56:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5mEng7cpREbeF8b0ga8+QxOKYUZa4a9VMv6tCHMmqYVDC59tdG/KIbh4+MydqA/MV8GUDJ X-Received: by 2002:a17:907:9809:b0:7ad:d945:554f with SMTP id ji9-20020a170907980900b007add945554fmr19758715ejc.552.1667487381263; Thu, 03 Nov 2022 07:56:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667487381; cv=none; d=google.com; s=arc-20160816; b=lAmci0BL4yD86Dc/AiAz59oz3QKfJdg32wx7h59RCHNGAAIjciADAFy52YdPDn29l4 iN8pze/fOjhkfwyiGx0avVUNrliuy8A3pk8KvF1/Y1a3lhrAAjS2/TnP20VHXyQmw206 OPmXhvk8A7SeQoOuk82L7zOLLJqRJLIxRU/SKO2zJaLPhyKTykYBTXBAdS955EBkLsOw 7pQEfUQc2BJ5wHUluPhcQt5fAukOK99tkPTIoJQe5ULIrWtjAmcpYNm3BH2I6G1d02O0 bvn3mzZnFFMxr1K2/mUb/flACuGHc4LIIGGvqd8W5IP2m+lohcpyGxZoXX8YXp8oP40N +F0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=zVb55AHapyQSPJi8YW5q6n0/w1QUJL4yhoE7KivXgow=; b=mIFhSX0TgNtEoDCfemz/3FuegsI7Wzzu7/Ao/lg7gkpm5F1fyIJEhkQ9H7CYwHPE6X 4mVOrEHxHsu5kpW/sVqtqYz1+iH8urZBi9W5q3K5bKjxtu1O/IieeuhH632ZMWQnb27m 9M8qVvstaRei87sf/o9BeR1+2MixZjaakSq1mlwjhugOHXgbB/UqgR66or5PnRTq5o+X txldXoT/OabFpUBhW6j77qFoN15oPKz1SAONmhIlYXZV2hXN2wXRog4cZ/nsOBv30dso JA0/XNGp/KHuZF6/ph771/bTxEcEN9PnWgvZtOnbKp0F4WIUto2UV3WLDZH/L8SyBhSm PNIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=PP8D6vwo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a056402278f00b00461ac01753fsi1818838ede.369.2022.11.03.07.55.57; Thu, 03 Nov 2022 07:56:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=PP8D6vwo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231635AbiKCOwU (ORCPT + 99 others); Thu, 3 Nov 2022 10:52:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231732AbiKCOvr (ORCPT ); Thu, 3 Nov 2022 10:51:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF0AD19280; Thu, 3 Nov 2022 07:51:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7E4C0B828A3; Thu, 3 Nov 2022 14:51:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B011C433D6; Thu, 3 Nov 2022 14:51:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667487103; bh=aBiqaKM+JH7n4Gr1RSbFfPLj/Tspjy42oxH/2AtYZuI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PP8D6vwogDrReAZBrJYHfHbN3jPMgkwi0GC7tzE4b9IRuXDaDUuqHYaeCcN530tOe PyvNLDEV0NFmWvGqPxyGAMECDo5Lt7AvoSA3W+c6+XTl1n7H4+OhnbbJvthYt/4PFy 6pnuhVSRNApVh7R/N1J7FvSd4loBmbFkXDMSsaSvuYoBMg877oxTWEHsvW2I2qQDtX 4OD8Ii7cKGxmJuuZFi1OjZXSl3Qvx9/Rn3aYjn3s3jvpHQpmqCI9KyWn9qdQaQ0duO m+OhBzFHhUpZGsyLN80DWjoS5V1yP3QBNGuwhwcIaCsQcVyoELKsCRB4uFUJ4XCHdO wvw6tu6AwLDSQ== Received: from mchehab by mail.kernel.org with local (Exim 4.96) (envelope-from ) id 1oqbZE-0076b7-0O; Thu, 03 Nov 2022 14:51:40 +0000 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , "Daniel Latypov" , "Isabella Basso" , Daniel Vetter , David Airlie , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , dri-devel@lists.freedesktop.org, igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, skhan@linuxfoundation.org Subject: [PATCH RFC v2 6/8] drm/i915: add perf selftests to KUnit Date: Thu, 3 Nov 2022 14:51:36 +0000 Message-Id: <048d54e7e5718ba6c7606be61482cedd7cb92dfd.1667486144.git.mchehab@kernel.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-8.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748487248103009163?= X-GMAIL-MSGID: =?utf-8?q?1748487248103009163?= Now that i915 KUnit has PCI support, add perf tests as well. Signed-off-by: Mauro Carvalho Chehab --- To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. See [PATCH RFC v2 0/8] at: https://lore.kernel.org/all/cover.1667486144.git.mchehab@kernel.org/ drivers/gpu/drm/i915/selftests/i915_kunit.c | 34 ++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_kunit.c b/drivers/gpu/drm/i915/selftests/i915_kunit.c index f5281c866d75..6de5d3fa8920 100644 --- a/drivers/gpu/drm/i915/selftests/i915_kunit.c +++ b/drivers/gpu/drm/i915/selftests/i915_kunit.c @@ -202,6 +202,30 @@ static struct kunit_case i915_live_tests[] = { }; #undef selftest +/* + * Suite 3: live selftests + */ + +#define selftest(x, __y) int __y(struct drm_i915_private *i915); +#include "i915_perf_selftests.h" +#undef selftest + +/* Create selftest functions */ +#define selftest(__x, __y) \ + static void perf_##__x(struct kunit *test) { \ + run_pci_test(test, __y); \ + } +#include "i915_perf_selftests.h" +#undef selftest + +/* Fill tests array */ +#define selftest(__x, __y) KUNIT_CASE(perf_##__x), +static struct kunit_case i915_perf_tests[] = { +#include "i915_perf_selftests.h" + {} +}; +#undef selftest + /* * Declare test suites */ @@ -219,10 +243,18 @@ static struct kunit_suite i915_test_suites[] = { .suite_init = i915_pci_init_suite, .suite_exit = i915_pci_exit_suite, }, + { + .name = "i915 perf selftests", + .test_cases = i915_perf_tests, + .init = initialize_i915_selftests, + .suite_init = i915_pci_init_suite, + .suite_exit = i915_pci_exit_suite, + }, }; kunit_test_suites(&i915_test_suites[0], - &i915_test_suites[1]); + &i915_test_suites[1], + &i915_test_suites[2]); MODULE_LICENSE("GPL v2"); MODULE_IMPORT_NS(I915_SELFTEST);