From patchwork Thu Nov 3 14:51:35 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: 14926 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp581770wru; Thu, 3 Nov 2022 07:56:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68K0fB8oiHzzMsB7raKTpL/mbGP5URJD2Tz4PA3wVuKshtsKfaq2Ss6jON/FIvRnc8tizy X-Received: by 2002:a05:6402:34c6:b0:462:a46a:a3b6 with SMTP id w6-20020a05640234c600b00462a46aa3b6mr30467817edc.164.1667487367358; Thu, 03 Nov 2022 07:56:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667487367; cv=none; d=google.com; s=arc-20160816; b=SqdwvcIhaFix6DcuAPjUvKKgU+OjYdz6++HdbHkZ6bNDF0Vi0GYJbFD1BD5yskBg5E ZtcfXMur/PTX7I1sBB6Z6mX/4to3s/W2oeiSkz7vY16ONAuaWPXxd6RZyMNkkQ37Ngme w8q/WoQXb8pqFO90+/PesvjXL9NdoRH32rJTPMeF9IPkdXBW+25Nbvt6/J51uRPb4pG8 uiewSsk64f3dhmfm47ZkRkshwXKBbtQ3amI2wjiIG6r49AN+x8YOxNC53ZHQKxkMB7js z/N0ZvPMwK291RmYDP/AX+cPA4Z7NrFvkwRSlFxchmznrsFTTSOf3Ca2HCr5ycgjFwbL HWrw== 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=Oog+jXXhTAYG8XDnmSaneAlqXwnmuTeuAnZ1BKVqngM=; b=hmrjw/AnI2mOx6KdyNNtE96Xnz5PM8lXr/toMHCMsfRZ345ypp6a58FObbeScVDaie y4pzfu4sbhqWT8OWysCXedM+3K3+Ej6O6QCUlxsEvXvyUfZvXLsxMf3qdFw1nAA/i3PZ cWg1TvMcOm0usMMUtxydxLuiMgcsBhMS0Yvvn+24wGexq5Eu2ZxOHmuaqknBoVEix7RP C6NFXR+42Uqfmbu4GvhuNNBUOHgTY2pmF7k9f6gZKvtaswPYUo3pRXMTpexWhEcst6WA TiNzev0gfcHPqchGue/CGHheNw6/Gdt+qRyEmK7FLMDQs5NVKxIAoYJjxKDupW7z3v+k TOxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=WKBxf0BF; 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 b93-20020a509f66000000b00458b42ff246si1324988edf.236.2022.11.03.07.55.42; Thu, 03 Nov 2022 07:56:07 -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=WKBxf0BF; 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 S231845AbiKCOwM (ORCPT + 99 others); Thu, 3 Nov 2022 10:52:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231773AbiKCOvr (ORCPT ); Thu, 3 Nov 2022 10:51:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF27C1928E; 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 84E2FB828B3; Thu, 3 Nov 2022 14:51:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2EFF6C4347C; 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=U21HowsYMW+tMOo5sJIGkQiIMjJyWPnB67qQL0JHuPc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WKBxf0BFTFEyae+QvYY5zlJAByXXlmYcFQACMxS53FF1ajk4//2cD5lPOE8jocRur d/eLwgryKzT0OQPNr6VovlctGClTmfXRA1NofuwqXCzEuqROy0luaECNaTAwz2uNwX 1GUfvK+cOUVLnKdLhEh8x7O5ITqkiWHLhoezAlayhuCnk1k7sN8e9ACv0Sw7zA6BSr C8DXC2Ux6RRE8Q21szPE2MqcOSHLCWgzCBWTPXGiPOXvhttMQ/yYy7DNs5vx3oRuOW dlgRhiazFeoiug3BAHtZPUxYU9t8eIMSHilSvs20Dy37Dt6Gfc29DxLFhuq9lqEPsf klTlNuSD62H5A== Received: from mchehab by mail.kernel.org with local (Exim 4.96) (envelope-from ) id 1oqbZE-0076b4-0K; 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 5/8] drm/i915: add live selftests to KUnit Date: Thu, 3 Nov 2022 14:51:35 +0000 Message-Id: <7a0221045bcec317cf8353c72f0c26cc62935273.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?1748487233994959466?= X-GMAIL-MSGID: =?utf-8?q?1748487233994959466?= Now that i915 KUnit has PCI support, add live tests as well. NOTE: currently, some tests are failing when excecuting via KUnit. I'll do a further investigation to check why, and if this patch can be safely merged or not. 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 | 35 ++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_kunit.c b/drivers/gpu/drm/i915/selftests/i915_kunit.c index 430610864f6e..f5281c866d75 100644 --- a/drivers/gpu/drm/i915/selftests/i915_kunit.c +++ b/drivers/gpu/drm/i915/selftests/i915_kunit.c @@ -177,6 +177,31 @@ static struct kunit_case i915_mock_tests[] = { }; #undef selftest +/* + * Suite 2: live selftests + */ + +/* Declare selftest functions */ +#define selftest(x, __y) int __y(struct drm_i915_private *i915); +#include "i915_live_selftests.h" +#undef selftest + +/* Create selftest functions */ +#define selftest(__x, __y) \ + static void live_##__x(struct kunit *test) { \ + run_pci_test(test, __y); \ + } +#include "i915_live_selftests.h" +#undef selftest + +/* Fill tests array */ +#define selftest(__x, __y) KUNIT_CASE(live_##__x), +static struct kunit_case i915_live_tests[] = { +#include "i915_live_selftests.h" + {} +}; +#undef selftest + /* * Declare test suites */ @@ -187,9 +212,17 @@ static struct kunit_suite i915_test_suites[] = { .test_cases = i915_mock_tests, .init = initialize_i915_selftests, }, + { + .name = "i915 live selftests", + .test_cases = i915_live_tests, + .init = initialize_i915_selftests, + .suite_init = i915_pci_init_suite, + .suite_exit = i915_pci_exit_suite, + }, }; -kunit_test_suites(i915_test_suites); +kunit_test_suites(&i915_test_suites[0], + &i915_test_suites[1]); MODULE_LICENSE("GPL v2"); MODULE_IMPORT_NS(I915_SELFTEST);