From patchwork Thu Nov 3 14:51:31 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: 14927 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp581789wru; Thu, 3 Nov 2022 07:56:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7s5La+WO5Q4QpeEg8w2d3vMmk8N2ENQFaUHsItJJhmGVYcdk4pjHfv6GupgJjvq0KlJrKk X-Received: by 2002:a17:907:7e81:b0:7ad:e144:19e5 with SMTP id qb1-20020a1709077e8100b007ade14419e5mr18431001ejc.51.1667487370973; Thu, 03 Nov 2022 07:56:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667487370; cv=none; d=google.com; s=arc-20160816; b=xDR5gaYxwxRrAQceM5U5FzkJDMYLXrd/zMLFERP+PnH5kGtR1RutIp2ppeyN7pyeNZ YksMBTWyP5/CdqP2CN2cSm8ELuHWzFO1/EnJIXFrIjdvSVA3ArQG8exCsE+snw8B3ZmY nago8FGnlx0naQwxDBP6ZUH8MTaRAIaRgv9MyEaGDmfhDnvgPjYUPX6YDP+xhS8e+1L5 zNrG6U1+n3L1t1IO/OYkIAsPv9yAY9/d2P0Ey06/7j/KwSmjOd3navemvkZgNYrNq83V GSCAPk+WYeo0wmnvOfgPcEuhSEl2z+pv869968hlpw9e46dTOIlEVaU+pDNiud66EcjO G6rA== 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=sIX1ORlan1AbU2JKFRpufdFQEItSmAMXW4uNWX9zzxc=; b=FIyE2GcxiDFo5wnqaRvPL1Xx+yh47nA6gtV67oeBrbIibZGtGqRqKDIg3pjuMOO872 xNpd6NKzGRPXt11QhAF3A1nKG3g72lPpw8LhD4ao167VPbcyk1hBhTZtwRbPBt69DckE ylEw7/JRVauTz4Lmj9hj/ZMQ7aHgD0+w3+Pr1Bt3/4N2VtU9xJ2MRDAw8OJNN/O81Orl dJHtBJMY7EIYkX9ITY4rCU/M/Hu1KwWQwipV0ewL+eyypxOFF+VBhk/rbkK8AiIb2JPt G59AQ5s7NOUxX3byoIYkwscxBHHYC0Mm7iRP68BeByt/qaJxGIdLPHSSlpGjcUkCkMxs 1cmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=dPTHQb9s; 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 ne41-20020a1709077ba900b0077082e784easi1516857ejc.957.2022.11.03.07.55.47; Thu, 03 Nov 2022 07:56:10 -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=dPTHQb9s; 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 S231853AbiKCOwP (ORCPT + 99 others); Thu, 3 Nov 2022 10:52:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231757AbiKCOvr (ORCPT ); Thu, 3 Nov 2022 10:51:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06214178B6; 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 dfw.source.kernel.org (Postfix) with ESMTPS id 88BE261F12; Thu, 3 Nov 2022 14:51:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35592C43470; 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=ohLWpaSXOlu4dCc/Wp9Ps5KyM6JoEy8FjBz8BTfpYGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dPTHQb9srVytDkTbnedtZRNKSm0YebAtROcE/TX4sFfoxRdDxqMABdEE6dvsGdsje AaMh5dSjBojxj8DfH681VDEQ8t8H0LQg56d92U3eYQ5RcowrmduRMdoo4gZ53bYxAM Gp99U87DQK2wiVKhRDcl95DqevYmuRThHUx47bhRyj5Me7nXWAEqchTVp5I++9vByE K/U38y5mYL9dlHUC9zR5egAlmOtlOla2vXgyzVNfjpv2gPLsadCQNgiT0PI0LZoOs0 QyV7Q1MAQ/sbgvP45soNepOfCJYPPzbnjqf9/cr8gQea172Wtw1LVOpVTo+Nr0JTju IoOVj0foE6W3Q== Received: from mchehab by mail.kernel.org with local (Exim 4.96) (envelope-from ) id 1oqbZE-0076as-04; Thu, 03 Nov 2022 14:51:40 +0000 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= , "Daniel Latypov" , "Darrick J. Wong" , "Isabella Basso" , "Jason A. Donenfeld" , =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?T?= =?utf-8?q?homas_Hellstr=C3=B6m?= , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Akeem G Abodunrin , Alan Previn , Andi Shyti , Andrzej Hajda , Anshuman Gupta , Arunpravin , Ashutosh Dixit , Bommu Krishnaiah , Bruce Chang , Chris Wilson , Dan Carpenter , Daniel Vetter , Daniele Ceraolo Spurio , David Airlie , Dmitry Osipenko , Harish Chegondi , Jani Nikula , Jason Wang , John Harrison , Joonas Lahtinen , Kees Cook , Lucas De Marchi , Maarten Lankhorst , Matt Atwood , Matt Roper , Matthew Auld , Matthew Brost , Niranjana Vishwanathapura , Nirmoy Das , Rahul Kumar Singh , Ramalingam C , Riana Tauro , Robert Beckett , Rodrigo Vivi , Sujaritha Sundaresan , Thomas Zimmermann , Tvrtko Ursulin , Vinay Belgaumkar , 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 1/8] drm/i915: export all selftest functions Date: Thu, 3 Nov 2022 14:51:31 +0000 Message-Id: <0b91456b1d3b1ef86d63222a4421e0d431b6605a.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?1748487237710073341?= X-GMAIL-MSGID: =?utf-8?q?1748487237710073341?= In order to prepare for a new KUnit module that will run selftests, export all selftest functions to I915_SELFTEST namespace. No functional changes. 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/gem/selftests/huge_pages.c | 2 ++ drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c | 1 + drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c | 1 + drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c | 1 + drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c | 2 ++ drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c | 1 + drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c | 1 + drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c | 2 ++ drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c | 1 + drivers/gpu/drm/i915/gt/selftest_context.c | 1 + drivers/gpu/drm/i915/gt/selftest_engine.c | 1 + drivers/gpu/drm/i915/gt/selftest_engine_cs.c | 2 ++ drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c | 1 + drivers/gpu/drm/i915/gt/selftest_execlists.c | 1 + drivers/gpu/drm/i915/gt/selftest_gt_pm.c | 2 ++ drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 1 + drivers/gpu/drm/i915/gt/selftest_lrc.c | 1 + drivers/gpu/drm/i915/gt/selftest_migrate.c | 2 ++ drivers/gpu/drm/i915/gt/selftest_mocs.c | 1 + drivers/gpu/drm/i915/gt/selftest_reset.c | 1 + drivers/gpu/drm/i915/gt/selftest_ring.c | 1 + drivers/gpu/drm/i915/gt/selftest_ring_submission.c | 1 + drivers/gpu/drm/i915/gt/selftest_slpc.c | 1 + drivers/gpu/drm/i915/gt/selftest_timeline.c | 2 ++ drivers/gpu/drm/i915/gt/selftest_workarounds.c | 1 + drivers/gpu/drm/i915/gt/st_shmem_utils.c | 1 + drivers/gpu/drm/i915/gt/uc/selftest_guc.c | 1 + drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c | 1 + drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c | 1 + drivers/gpu/drm/i915/selftests/i915_active.c | 1 + drivers/gpu/drm/i915/selftests/i915_gem.c | 1 + drivers/gpu/drm/i915/selftests/i915_gem_evict.c | 2 ++ drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 2 ++ drivers/gpu/drm/i915/selftests/i915_perf.c | 1 + drivers/gpu/drm/i915/selftests/i915_request.c | 3 +++ drivers/gpu/drm/i915/selftests/i915_selftest.c | 2 ++ drivers/gpu/drm/i915/selftests/i915_sw_fence.c | 1 + drivers/gpu/drm/i915/selftests/i915_syncmap.c | 1 + drivers/gpu/drm/i915/selftests/i915_vma.c | 2 ++ drivers/gpu/drm/i915/selftests/intel_memory_region.c | 3 +++ drivers/gpu/drm/i915/selftests/intel_uncore.c | 2 ++ drivers/gpu/drm/i915/selftests/scatterlist.c | 1 + 42 files changed, 58 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c index 0cb99e75b0bc..7cbd01dbff4c 100644 --- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c +++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c @@ -1948,6 +1948,7 @@ int i915_gem_huge_page_mock_selftests(void) mock_destroy_device(dev_priv); return err; } +EXPORT_SYMBOL_NS_GPL(i915_gem_huge_page_mock_selftests, I915_SELFTEST); int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915) { @@ -1970,3 +1971,4 @@ int i915_gem_huge_page_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_gem_huge_page_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c index 9a6a6b5b722b..9f1ff1e783f6 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_client_blt.c @@ -763,3 +763,4 @@ int i915_gem_client_blt_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_gem_client_blt_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c index a666d7e610f5..1fcbc68c9c0f 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c @@ -436,3 +436,4 @@ int i915_gem_coherency_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_gem_coherency_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c index d8864444432b..ea41eff234d4 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_context.c @@ -1912,3 +1912,4 @@ int i915_gem_context_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_gem_context_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c index f2f3cfad807b..d786e1ea99ec 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_dmabuf.c @@ -466,6 +466,7 @@ int i915_gem_dmabuf_mock_selftests(void) mock_destroy_device(i915); return err; } +EXPORT_SYMBOL_NS_GPL(i915_gem_dmabuf_mock_selftests, I915_SELFTEST); int i915_gem_dmabuf_live_selftests(struct drm_i915_private *i915) { @@ -478,3 +479,4 @@ int i915_gem_dmabuf_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_gem_dmabuf_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c index fe6c37fd7859..eaab89f46f34 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_migrate.c @@ -526,3 +526,4 @@ int i915_gem_migrate_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(i915_gem_migrate_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c index 1cae24349a96..add5ae56cd89 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c @@ -1847,3 +1847,4 @@ int i915_gem_mman_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_gem_mman_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c index bdf5bb40ccf1..3e1442119fdb 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_object.c @@ -88,6 +88,7 @@ int i915_gem_object_mock_selftests(void) mock_destroy_device(i915); return err; } +EXPORT_SYMBOL_NS_GPL(i915_gem_object_mock_selftests, I915_SELFTEST); int i915_gem_object_live_selftests(struct drm_i915_private *i915) { @@ -97,3 +98,4 @@ int i915_gem_object_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_gem_object_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c index d43d8dae0f69..03cd27066153 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_phys.c @@ -85,3 +85,4 @@ int i915_gem_phys_mock_selftests(void) mock_destroy_device(i915); return err; } +EXPORT_SYMBOL_NS_GPL(i915_gem_phys_mock_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_context.c b/drivers/gpu/drm/i915/gt/selftest_context.c index 76fbae358072..e9ef4c5d43f3 100644 --- a/drivers/gpu/drm/i915/gt/selftest_context.c +++ b/drivers/gpu/drm/i915/gt/selftest_context.c @@ -449,3 +449,4 @@ int intel_context_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, gt); } +EXPORT_SYMBOL_NS_GPL(intel_context_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_engine.c b/drivers/gpu/drm/i915/gt/selftest_engine.c index 57fea9ea1705..77358026c97c 100644 --- a/drivers/gpu/drm/i915/gt/selftest_engine.c +++ b/drivers/gpu/drm/i915/gt/selftest_engine.c @@ -25,3 +25,4 @@ int intel_engine_live_selftests(struct drm_i915_private *i915) return 0; } +EXPORT_SYMBOL_NS_GPL(intel_engine_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_engine_cs.c b/drivers/gpu/drm/i915/gt/selftest_engine_cs.c index 1b75f478d1b8..f9e5e5ce8d24 100644 --- a/drivers/gpu/drm/i915/gt/selftest_engine_cs.c +++ b/drivers/gpu/drm/i915/gt/selftest_engine_cs.c @@ -366,6 +366,7 @@ int intel_engine_cs_perf_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(intel_engine_cs_perf_selftests, I915_SELFTEST); static int intel_mmio_bases_check(void *arg) { @@ -421,3 +422,4 @@ int intel_engine_cs_mock_selftests(void) return i915_subtests(tests, NULL); } +EXPORT_SYMBOL_NS_GPL(intel_engine_cs_mock_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c index 273d440a53e3..eaa66d8d4181 100644 --- a/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c +++ b/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c @@ -389,6 +389,7 @@ int intel_heartbeat_live_selftests(struct drm_i915_private *i915) i915->params.enable_hangcheck = saved_hangcheck; return err; } +EXPORT_SYMBOL_NS_GPL(intel_heartbeat_live_selftests, I915_SELFTEST); void st_engine_heartbeat_disable(struct intel_engine_cs *engine) { diff --git a/drivers/gpu/drm/i915/gt/selftest_execlists.c b/drivers/gpu/drm/i915/gt/selftest_execlists.c index 2c7c053a8808..a16724cc226f 100644 --- a/drivers/gpu/drm/i915/gt/selftest_execlists.c +++ b/drivers/gpu/drm/i915/gt/selftest_execlists.c @@ -4513,3 +4513,4 @@ int intel_execlists_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(intel_execlists_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c index be94f863bdef..fffcda1ac631 100644 --- a/drivers/gpu/drm/i915/gt/selftest_gt_pm.c +++ b/drivers/gpu/drm/i915/gt/selftest_gt_pm.c @@ -199,6 +199,7 @@ int intel_gt_pm_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(intel_gt_pm_live_selftests, I915_SELFTEST); int intel_gt_pm_late_selftests(struct drm_i915_private *i915) { @@ -216,3 +217,4 @@ int intel_gt_pm_late_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(intel_gt_pm_late_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c index 71263058a7b0..4c42052dc1fe 100644 --- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c +++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c @@ -2058,3 +2058,4 @@ int intel_hangcheck_live_selftests(struct drm_i915_private *i915) return err; } +EXPORT_SYMBOL_NS_GPL(intel_hangcheck_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c index 82d3f8058995..a1efc184c428 100644 --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c @@ -1975,3 +1975,4 @@ int intel_lrc_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(intel_lrc_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_migrate.c b/drivers/gpu/drm/i915/gt/selftest_migrate.c index 0dc5309c90a4..84551e0499b6 100644 --- a/drivers/gpu/drm/i915/gt/selftest_migrate.c +++ b/drivers/gpu/drm/i915/gt/selftest_migrate.c @@ -649,6 +649,7 @@ int intel_migrate_live_selftests(struct drm_i915_private *i915) return i915_subtests(tests, >->migrate); } +EXPORT_SYMBOL_NS_GPL(intel_migrate_live_selftests, I915_SELFTEST); static struct drm_i915_gem_object * create_init_lmem_internal(struct intel_gt *gt, size_t sz, bool try_lmem) @@ -870,3 +871,4 @@ int intel_migrate_perf_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, gt); } +EXPORT_SYMBOL_NS_GPL(intel_migrate_perf_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_mocs.c b/drivers/gpu/drm/i915/gt/selftest_mocs.c index c1d861333c44..9917c39eaab2 100644 --- a/drivers/gpu/drm/i915/gt/selftest_mocs.c +++ b/drivers/gpu/drm/i915/gt/selftest_mocs.c @@ -453,3 +453,4 @@ int intel_mocs_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(intel_mocs_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_reset.c b/drivers/gpu/drm/i915/gt/selftest_reset.c index 37c38bdd5f47..a7e8c182e77d 100644 --- a/drivers/gpu/drm/i915/gt/selftest_reset.c +++ b/drivers/gpu/drm/i915/gt/selftest_reset.c @@ -386,3 +386,4 @@ int intel_reset_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, gt); } +EXPORT_SYMBOL_NS_GPL(intel_reset_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_ring.c b/drivers/gpu/drm/i915/gt/selftest_ring.c index 2a8c534dc125..6590c9c504b9 100644 --- a/drivers/gpu/drm/i915/gt/selftest_ring.c +++ b/drivers/gpu/drm/i915/gt/selftest_ring.c @@ -108,3 +108,4 @@ int intel_ring_mock_selftests(void) return i915_subtests(tests, NULL); } +EXPORT_SYMBOL_NS_GPL(intel_ring_mock_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_ring_submission.c b/drivers/gpu/drm/i915/gt/selftest_ring_submission.c index 70f9ac1ec2c7..5343fb71ecfe 100644 --- a/drivers/gpu/drm/i915/gt/selftest_ring_submission.c +++ b/drivers/gpu/drm/i915/gt/selftest_ring_submission.c @@ -296,3 +296,4 @@ int intel_ring_submission_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(intel_ring_submission_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_slpc.c b/drivers/gpu/drm/i915/gt/selftest_slpc.c index 4c6e9257e593..011c8a8548e0 100644 --- a/drivers/gpu/drm/i915/gt/selftest_slpc.c +++ b/drivers/gpu/drm/i915/gt/selftest_slpc.c @@ -443,3 +443,4 @@ int intel_slpc_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(intel_slpc_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_timeline.c b/drivers/gpu/drm/i915/gt/selftest_timeline.c index 522d0190509c..bb2ff7172b32 100644 --- a/drivers/gpu/drm/i915/gt/selftest_timeline.c +++ b/drivers/gpu/drm/i915/gt/selftest_timeline.c @@ -450,6 +450,7 @@ int intel_timeline_mock_selftests(void) return i915_subtests(tests, NULL); } +EXPORT_SYMBOL_NS_GPL(intel_timeline_mock_selftests, I915_SELFTEST); static int emit_ggtt_store_dw(struct i915_request *rq, u32 addr, u32 value) { @@ -1423,3 +1424,4 @@ int intel_timeline_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(intel_timeline_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/selftest_workarounds.c b/drivers/gpu/drm/i915/gt/selftest_workarounds.c index 21b1edc052f8..948716ca9ae0 100644 --- a/drivers/gpu/drm/i915/gt/selftest_workarounds.c +++ b/drivers/gpu/drm/i915/gt/selftest_workarounds.c @@ -1393,3 +1393,4 @@ int intel_workarounds_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(intel_workarounds_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/st_shmem_utils.c b/drivers/gpu/drm/i915/gt/st_shmem_utils.c index b279fe88b70e..46c9d4fca1f8 100644 --- a/drivers/gpu/drm/i915/gt/st_shmem_utils.c +++ b/drivers/gpu/drm/i915/gt/st_shmem_utils.c @@ -61,3 +61,4 @@ int shmem_utils_mock_selftests(void) return i915_subtests(tests, NULL); } +EXPORT_SYMBOL_NS_GPL(shmem_utils_mock_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/uc/selftest_guc.c b/drivers/gpu/drm/i915/gt/uc/selftest_guc.c index e28518fe8b90..06a098cdf84c 100644 --- a/drivers/gpu/drm/i915/gt/uc/selftest_guc.c +++ b/drivers/gpu/drm/i915/gt/uc/selftest_guc.c @@ -300,3 +300,4 @@ int intel_guc_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, gt); } +EXPORT_SYMBOL_NS_GPL(intel_guc_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c b/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c index 01f8cd3c3134..7be9107465e5 100644 --- a/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c +++ b/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c @@ -157,3 +157,4 @@ int intel_guc_hang_check(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, gt); } +EXPORT_SYMBOL_NS_GPL(intel_guc_hang_check, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c b/drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c index d17982c36d25..88611140c204 100644 --- a/drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c +++ b/drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c @@ -181,3 +181,4 @@ int intel_guc_multi_lrc_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, gt); } +EXPORT_SYMBOL_NS_GPL(intel_guc_multi_lrc_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/i915_active.c b/drivers/gpu/drm/i915/selftests/i915_active.c index b61fe850e924..718af653c49b 100644 --- a/drivers/gpu/drm/i915/selftests/i915_active.c +++ b/drivers/gpu/drm/i915/selftests/i915_active.c @@ -260,6 +260,7 @@ int i915_active_live_selftests(struct drm_i915_private *i915) return i915_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_active_live_selftests, I915_SELFTEST); static struct intel_engine_cs *node_to_barrier(struct active_node *it) { diff --git a/drivers/gpu/drm/i915/selftests/i915_gem.c b/drivers/gpu/drm/i915/selftests/i915_gem.c index e5dd82e7e480..e465f8162d1a 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem.c @@ -254,3 +254,4 @@ int i915_gem_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_gem_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c index 8c6517d29b8e..2e2fb6f78ee8 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_evict.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_evict.c @@ -555,6 +555,7 @@ int i915_gem_evict_mock_selftests(void) mock_destroy_device(i915); return err; } +EXPORT_SYMBOL_NS_GPL(i915_gem_evict_mock_selftests, I915_SELFTEST); int i915_gem_evict_live_selftests(struct drm_i915_private *i915) { @@ -567,3 +568,4 @@ int i915_gem_evict_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(i915_gem_evict_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c index 27c733b00976..c81f03e8183b 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c @@ -1938,6 +1938,7 @@ int i915_gem_gtt_mock_selftests(void) mock_destroy_device(i915); return err; } +EXPORT_SYMBOL_NS_GPL(i915_gem_gtt_mock_selftests, I915_SELFTEST); static int context_sync(struct intel_context *ce) { @@ -2320,3 +2321,4 @@ int i915_gem_gtt_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_gem_gtt_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c index 429c6d73b159..4499ccafbce7 100644 --- a/drivers/gpu/drm/i915/selftests/i915_perf.c +++ b/drivers/gpu/drm/i915/selftests/i915_perf.c @@ -437,3 +437,4 @@ int i915_perf_live_selftests(struct drm_i915_private *i915) return err; } +EXPORT_SYMBOL_NS_GPL(i915_perf_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c index a46350c37e9d..81b1faba55a9 100644 --- a/drivers/gpu/drm/i915/selftests/i915_request.c +++ b/drivers/gpu/drm/i915/selftests/i915_request.c @@ -563,6 +563,7 @@ int i915_request_mock_selftests(void) return err; } +EXPORT_SYMBOL_NS_GPL(i915_request_mock_selftests, I915_SELFTEST); static int live_nop_request(void *arg) { @@ -1869,6 +1870,7 @@ int i915_request_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_request_live_selftests, I915_SELFTEST); static int switch_to_kernel_sync(struct intel_context *ce, int err) { @@ -3286,3 +3288,4 @@ int i915_request_perf_selftests(struct drm_i915_private *i915) return i915_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_request_perf_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/i915_selftest.c b/drivers/gpu/drm/i915/selftests/i915_selftest.c index 39da0fb0d6d2..571c9021bd2c 100644 --- a/drivers/gpu/drm/i915/selftests/i915_selftest.c +++ b/drivers/gpu/drm/i915/selftests/i915_selftest.c @@ -39,12 +39,14 @@ int i915_mock_sanitycheck(void) pr_info(DRIVER_NAME ": %s() - ok!\n", __func__); return 0; } +EXPORT_SYMBOL_NS_GPL(i915_mock_sanitycheck, I915_SELFTEST); int i915_live_sanitycheck(struct drm_i915_private *i915) { pr_info("%s: %s() - ok!\n", i915->drm.driver->name, __func__); return 0; } +EXPORT_SYMBOL_NS_GPL(i915_live_sanitycheck, I915_SELFTEST); enum { #define selftest(name, func) mock_##name, diff --git a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c index daa985e5a19b..deccd30fed12 100644 --- a/drivers/gpu/drm/i915/selftests/i915_sw_fence.c +++ b/drivers/gpu/drm/i915/selftests/i915_sw_fence.c @@ -755,3 +755,4 @@ int i915_sw_fence_mock_selftests(void) return i915_subtests(tests, NULL); } +EXPORT_SYMBOL_NS_GPL(i915_sw_fence_mock_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/i915_syncmap.c b/drivers/gpu/drm/i915/selftests/i915_syncmap.c index 47f4ae18a1ef..09b04f280e73 100644 --- a/drivers/gpu/drm/i915/selftests/i915_syncmap.c +++ b/drivers/gpu/drm/i915/selftests/i915_syncmap.c @@ -614,3 +614,4 @@ int i915_syncmap_mock_selftests(void) return i915_subtests(tests, NULL); } +EXPORT_SYMBOL_NS_GPL(i915_syncmap_mock_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c index 71b52d5efef4..78903e5b034d 100644 --- a/drivers/gpu/drm/i915/selftests/i915_vma.c +++ b/drivers/gpu/drm/i915/selftests/i915_vma.c @@ -949,6 +949,7 @@ int i915_vma_mock_selftests(void) mock_destroy_device(i915); return err; } +EXPORT_SYMBOL_NS_GPL(i915_vma_mock_selftests, I915_SELFTEST); static int igt_vma_remapped_gtt(void *arg) { @@ -1105,3 +1106,4 @@ int i915_vma_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(i915_vma_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/intel_memory_region.c b/drivers/gpu/drm/i915/selftests/intel_memory_region.c index 3b18e5905c86..9114f26da77c 100644 --- a/drivers/gpu/drm/i915/selftests/intel_memory_region.c +++ b/drivers/gpu/drm/i915/selftests/intel_memory_region.c @@ -1376,6 +1376,7 @@ int intel_memory_region_mock_selftests(void) mock_destroy_device(i915); return err; } +EXPORT_SYMBOL_NS_GPL(intel_memory_region_mock_selftests, I915_SELFTEST); int intel_memory_region_live_selftests(struct drm_i915_private *i915) { @@ -1397,6 +1398,7 @@ int intel_memory_region_live_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(intel_memory_region_live_selftests, I915_SELFTEST); int intel_memory_region_perf_selftests(struct drm_i915_private *i915) { @@ -1409,3 +1411,4 @@ int intel_memory_region_perf_selftests(struct drm_i915_private *i915) return i915_live_subtests(tests, i915); } +EXPORT_SYMBOL_NS_GPL(intel_memory_region_perf_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/intel_uncore.c b/drivers/gpu/drm/i915/selftests/intel_uncore.c index e4281508d580..7abc037d79de 100644 --- a/drivers/gpu/drm/i915/selftests/intel_uncore.c +++ b/drivers/gpu/drm/i915/selftests/intel_uncore.c @@ -138,6 +138,7 @@ int intel_uncore_mock_selftests(void) return 0; } +EXPORT_SYMBOL_NS_GPL(intel_uncore_mock_selftests, I915_SELFTEST); static int live_forcewake_ops(void *arg) { @@ -352,3 +353,4 @@ int intel_uncore_live_selftests(struct drm_i915_private *i915) return intel_gt_live_subtests(tests, to_gt(i915)); } +EXPORT_SYMBOL_NS_GPL(intel_uncore_live_selftests, I915_SELFTEST); diff --git a/drivers/gpu/drm/i915/selftests/scatterlist.c b/drivers/gpu/drm/i915/selftests/scatterlist.c index d599186d5b71..d29aa7303b16 100644 --- a/drivers/gpu/drm/i915/selftests/scatterlist.c +++ b/drivers/gpu/drm/i915/selftests/scatterlist.c @@ -378,3 +378,4 @@ int scatterlist_mock_selftests(void) return i915_subtests(tests, NULL); } +EXPORT_SYMBOL_NS_GPL(scatterlist_mock_selftests, I915_SELFTEST); From patchwork Thu Nov 3 14:51:32 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: 14929 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp581892wru; Thu, 3 Nov 2022 07:56:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4yIyxvYcKTFBpl1bK+xLlQZ1qNbPvLFt4cZNn4CUZpDkhZADLQ2YmZ0dXM81YWe3HBJVvb X-Received: by 2002:a05:6402:370c:b0:453:9fab:1b53 with SMTP id ek12-20020a056402370c00b004539fab1b53mr31346222edb.28.1667487382615; Thu, 03 Nov 2022 07:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667487382; cv=none; d=google.com; s=arc-20160816; b=ILC/uwqWqhI+pZAPcvI8WdUsYVEysJY3/bJbKmIfTmD30ZQHpLgCaFc7A3f7Vbfxq6 Oug+J9KA9+m3DIqJyOk52EU1yB/2jTrpB/dYzDzoj5TXVRDYwM1XQUkcIG5wTfh5I0gZ Myqoq+VaNF47H8pu/MDBKksgeCWhZn2Ovt5jN81jqS8Nm41XCaLHB65FvU5EU7+iV5Nt hEdxH8WHwFwkFSIxowwVS44uN65CB2jDg5WrboxUUwCuBVZwMKYmym+q03A7g8W2pF7V 9nBs/draU/BgxtcEPQo1Gk1pB16fq6TUDMJxsp8BCbnmG0k0Dspd/IfDA67/1vywtBQb nSzA== 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=gBrtCYoR6ToVsz23so84QtVQ+ETob0X9yT8MH3oAx7s=; b=CKoCPnQ8o7G834feJIx1kOoDS4tu2YKA8q3KJNnP720M+85s8TCsDVxjh3G4sO0Rdh njU9jysbj4D/d0w4rFhwTa1MBqaU1+5CzSS9V/DvyESAnMa+25U+M+LoliABI6FxZZLW 7SaaCVjdUxmcNb23lZ3jEpJmB3VnsOXIjnN7GBp5OZK7vZqtnEPi//tv3CpzCYo9hTAN q6ysI/Chhu8s78SAkYVn/mtCCloeStZ9cJOqBtLK3q5TQ4ZTLzSgxluzPXtjSqdkglB3 X+xFdZSAT96pqb5ELAx1r8ju7kX9vzx2eGXrLkv/2UgIVWRQeIrT0+BngzWR4RtKxX13 JUSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=b5RTy+Hj; 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 go39-20020a1709070da700b007add0e1a187si1701605ejc.594.2022.11.03.07.55.58; Thu, 03 Nov 2022 07:56:22 -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=b5RTy+Hj; 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 S231825AbiKCOwY (ORCPT + 99 others); Thu, 3 Nov 2022 10:52:24 -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 S231789AbiKCOvt (ORCPT ); Thu, 3 Nov 2022 10:51:49 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A2F19291; Thu, 3 Nov 2022 07:51:47 -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 sin.source.kernel.org (Postfix) with ESMTPS id 3F4CDCE2784; Thu, 3 Nov 2022 14:51:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 31C1CC43141; 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=uKx5CM4Wo7SGIbjuqLDYwkAKVGcbP3XPEVY3Uc4z03g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b5RTy+HjAvar0v3LCPg/cTbvaP4h/XLMEVtpU8WzJDpdiaLMGFjXTs8OfKoX4Up+P iZkvpGfG/E7KYN9NdcloKydjq5kl9zLTOZoH74+e4AFoGN50cTUffTsg2OGfhqzBqH k6rUTxAZVPgeConXquQyjjobB71LqZSZiLQY7TiP0fmjZbywAWcLO7UNgrbW4Ezd/c odWRxPW5EZedodPgE9m9jr3gWuFBCfl1qFKGL67PK+X1Lpio50bnTp4ZdTikY5B401 V4hmAL8XGkcR96YNO7tzu87SOf5MCoMohosXFCIwwxWxdN4FlUNBgFzI7oSNHFpfW9 wNkzH4bFG8Y9Q== Received: from mchehab by mail.kernel.org with local (Exim 4.96) (envelope-from ) id 1oqbZE-0076av-08; Thu, 03 Nov 2022 14:51:40 +0000 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , "Daniel Latypov" , "Isabella Basso" , "Jason A. Donenfeld" , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= , Andi Shyti , Daniel Vetter , David Airlie , Heiko Carstens , Jani Nikula , Joonas Lahtinen , Matt Roper , Mika Westerberg , 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 2/8] drm/i915: place selftest preparation on a separate function Date: Thu, 3 Nov 2022 14:51:32 +0000 Message-Id: <71391c51dc48300e4dac3b762abed9201d508302.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?1748487250075127074?= X-GMAIL-MSGID: =?utf-8?q?1748487250075127074?= The selftest preparation logic should also be used by KUnit. So, place it on a separate function and export it. 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/i915_selftest.h | 2 ++ .../gpu/drm/i915/selftests/i915_selftest.c | 22 ++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_selftest.h b/drivers/gpu/drm/i915/i915_selftest.h index f54de0499be7..7fab96a42a62 100644 --- a/drivers/gpu/drm/i915/i915_selftest.h +++ b/drivers/gpu/drm/i915/i915_selftest.h @@ -44,6 +44,7 @@ struct i915_selftest { extern struct i915_selftest i915_selftest; +void i915_prepare_selftests(const char *name); int i915_mock_selftests(void); int i915_live_selftests(struct pci_dev *pdev); int i915_perf_selftests(struct pci_dev *pdev); @@ -111,6 +112,7 @@ int __i915_subtests(const char *caller, #else /* !IS_ENABLED(CONFIG_DRM_I915_SELFTEST) */ +static inline void i915_prepare_selftests(const char *) {}; static inline int i915_mock_selftests(void) { return 0; } static inline int i915_live_selftests(struct pci_dev *pdev) { return 0; } static inline int i915_perf_selftests(struct pci_dev *pdev) { return 0; } diff --git a/drivers/gpu/drm/i915/selftests/i915_selftest.c b/drivers/gpu/drm/i915/selftests/i915_selftest.c index 571c9021bd2c..011f7b1f7ff5 100644 --- a/drivers/gpu/drm/i915/selftests/i915_selftest.c +++ b/drivers/gpu/drm/i915/selftests/i915_selftest.c @@ -129,13 +129,8 @@ static void set_default_test_all(struct selftest *st, unsigned int count) st[i].enabled = true; } -static int __run_selftests(const char *name, - struct selftest *st, - unsigned int count, - void *data) +void i915_prepare_selftests(const char *name) { - int err = 0; - while (!i915_selftest.random_seed) i915_selftest.random_seed = get_random_u32(); @@ -144,10 +139,21 @@ static int __run_selftests(const char *name, msecs_to_jiffies_timeout(i915_selftest.timeout_ms) : MAX_SCHEDULE_TIMEOUT; - set_default_test_all(st, count); - pr_info(DRIVER_NAME ": Performing %s selftests with st_random_seed=0x%x st_timeout=%u\n", name, i915_selftest.random_seed, i915_selftest.timeout_ms); +} +EXPORT_SYMBOL_NS_GPL(i915_prepare_selftests, I915_SELFTEST); + +static int __run_selftests(const char *name, + struct selftest *st, + unsigned int count, + void *data) +{ + int err = 0; + + i915_prepare_selftests(name); + + set_default_test_all(st, count); /* Tests are listed in order in i915_*_selftests.h */ for (; count--; st++) { From patchwork Thu Nov 3 14:51:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 14932 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp582777wru; Thu, 3 Nov 2022 07:58:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6KXjRgyq8XaF1gF5Ohxse31mR1INC6ci36VJCgWz2L8hYvfQXhFQZ8Ce1fgUM49dlTOmBy X-Received: by 2002:aa7:c302:0:b0:461:85d7:b82 with SMTP id l2-20020aa7c302000000b0046185d70b82mr30622180edq.354.1667487488961; Thu, 03 Nov 2022 07:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667487488; cv=none; d=google.com; s=arc-20160816; b=rEho3dGLz6QyvIBYyiLGkJUoB1i2vcbTalWUhpqLX7EO38X+8umzJX6BpCN+8ZLhaK LJRp1fB0yROmxgBAaJnHRTIAlvi5ZqgE074+zO6XBg6gYm7hD1gjSTkHv06YwFPtCoAD 5r7ZBrWpPvg/WYnkSA7JnbWu6xnE4m/Yb+Ov3xk98QcJlhWRadrjCJuJaoL/KO8Idq+Y TdrCyfLi2ziC0z9UUMNP+lsoTgcoB0uDZp0VhCZaajoTAKgHHWxZHn01t4qztrgWYFqj /h2XzgN5ofqMiwzD/cFwDyBl+Yt9ClfCmI8X+VFkfDmXQXEGHy8dHi7Ug5ry6ykgs3KD YLpw== 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=K+6HWK4f8+sCWneiFwN4pONBIKok9M8ADJHXj0JIXMM=; b=f14X1CXp23o7ocY2TYz+cPO1TXaoFfnUVVJF3AYW+8dK7oyYOFFS8p9jazGTcwFkSa eIy1len583dk5I51e+y3k2uMXmjrFrxbl9M7z2cTrz5RWmOTfaHaGcAwhnsh+GPbatLU q/h6TGfkxMUL2Ksmoe2SOtjaPSmZVU2EXoixSR+OBii5O0Q8lPRHbUDiG0houYeWJLGR jS4F/Z/O9XrzaUbiMWy6phEdfU1YfhSVYA42habRj1n9saBtTWZOT/xYtAfUFtLwmFmb gsn4M/c+f8BxqvA8lMB3gQpZoVXdBaAU+btTuqY+GXy4mIDi7prtRUUI8xhtGUw2orA/ xuyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=ldnI+t7D; 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 m17-20020a056402511100b0046190898e26si1602228edd.533.2022.11.03.07.57.44; Thu, 03 Nov 2022 07:58:08 -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=ldnI+t7D; 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 S231827AbiKCOwE (ORCPT + 99 others); Thu, 3 Nov 2022 10:52:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231719AbiKCOvr (ORCPT ); Thu, 3 Nov 2022 10:51:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFEF119018; Thu, 3 Nov 2022 07:51:44 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 6D31C61F03; Thu, 3 Nov 2022 14:51:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26A16C433B5; 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=4qQEErgHjHjqFdSK/HO+Yq9UuTgZIfyVySmKj6peH80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ldnI+t7DIS/hjScQxdagBw1yTVgPrb+hp0AxH6i7sA0msbuOV1d/Ryf6GNLI7crM6 8QVuM3eBDFyTkFh19Zp6hbYsqoAIrtyRWmbdFo4X5KIUJcYqC3MOyO9hS1fwgads4w arMJ4SjcfesaNlAxezazhH35UbuMCI8G294NbzaKOyiY/5BrXgdiDU7LVlPz2oM+M4 lO2BydO2FOwg0s5ynUcd8Qv7usi3oYq4JKY8vbnoMlhonoRyTNA2O23rXroD8f+Kud M3KFBDcIrMoICkM2LP3pTMM74xSZmKMgXpvTdwJzg5YiWzmZ6gV+MZST6r+EEXpsnU dn3Lo2tfltRXQ== Received: from mchehab by mail.kernel.org with local (Exim 4.96) (envelope-from ) id 1oqbZE-0076ay-0C; 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 3/8] drm/i915: allow running mock selftests via Kunit Date: Thu, 3 Nov 2022 14:51:33 +0000 Message-Id: <98ff65296837e0771e67c539a4826b9045a50be0.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?1748487360978954597?= X-GMAIL-MSGID: =?utf-8?q?1748487360978954597?= The mock selftests don't require any hardware to run. They can easily run via kunit with qemu or bare metal. Add support for it. With this change, mock selftest can now run in qemu with: $ ./tools/testing/kunit/kunit.py run --arch=x86_64 \ --kunitconfig=drivers/gpu/drm/i915/selftests [16:50:24] Configuring KUnit Kernel ... [16:50:24] Building KUnit Kernel ... Populating config with: $ make ARCH=x86_64 O=.kunit olddefconfig Building with: $ make ARCH=x86_64 O=.kunit --jobs=8 [16:50:32] Starting KUnit Kernel (1/1)... [16:50:32] ============================================================ Running tests with: $ qemu-system-x86_64 -nodefaults -m 1024 -kernel .kunit/arch/x86/boot/bzImage -append 'kunit.enable=1 console=ttyS0 kunit_shutdown=reboot' -no-reboot -nographic -serial stdio [16:50:33] ============ i915 mock selftests (18 subtests) ============= [16:50:33] [PASSED] mock_sanitycheck [16:50:33] [PASSED] mock_shmem [16:50:37] [PASSED] mock_fence [16:50:38] [PASSED] mock_scatterlist [16:50:39] [PASSED] mock_syncmap [16:50:39] [PASSED] mock_uncore [16:50:39] [PASSED] mock_ring [16:50:39] [PASSED] mock_engine [16:50:43] [PASSED] mock_timelines [16:50:45] [PASSED] mock_requests [16:50:45] [PASSED] mock_objects [16:50:45] [PASSED] mock_phys [16:50:45] [PASSED] mock_dmabuf [16:50:50] [PASSED] mock_vma [16:50:51] [PASSED] mock_evict [16:50:53] [PASSED] mock_gtt [16:50:54] [PASSED] mock_hugepages [16:50:55] [PASSED] mock_memory_region [16:50:55] =============== [PASSED] i915 mock selftests =============== [16:50:55] ============================================================ [16:50:55] Testing complete. Ran 18 tests: passed: 18 [16:50:55] Elapsed time: 31.530s total, 0.003s configuring, 8.512s building, 22.974s running It is also possible to run the tests on a bare metal machine, and even collect code coverage data with: $ sudo lcov -z && sudo modprobe test-i915 && sudo rmmod test-i915 && sudo IGT_KERNEL_TREE=~/linux ~/freedesktop-igt/scripts/code_cov_capture mock_selftest Auto-detecting gcov kernel support. Found upstream gcov kernel support at /sys/kernel/debug/gcov Resetting kernel execution counters Done. [627.14] Code coverage wrote to mock_selftest.info The KTAP and Kernel logs will be similar to: [ 596.382685] # Subtest: i915 mock selftests [ 596.382688] 1..18 [ 596.387744] i915: i915_mock_sanitycheck() - ok! [ 596.395423] ok 1 - mock_sanitycheck [ 596.395495] i915: Running shmem_utils_mock_selftests/igt_shmem_basic [ 596.406650] ok 2 - mock_shmem [ 596.406737] i915: Running i915_sw_fence_mock_selftests/test_self [ 596.416868] i915: Running i915_sw_fence_mock_selftests/test_dag [ 596.423220] i915: Running i915_sw_fence_mock_selftests/test_AB [ 596.429585] i915: Running i915_sw_fence_mock_selftests/test_ABC [ 596.435921] i915: Running i915_sw_fence_mock_selftests/test_AB_C [ 596.442293] i915: Running i915_sw_fence_mock_selftests/test_C_AB [ 596.448671] i915: Running i915_sw_fence_mock_selftests/test_chain [ 596.485336] i915: Running i915_sw_fence_mock_selftests/test_ipc [ 596.492984] i915: Running i915_sw_fence_mock_selftests/test_timer [ 602.484395] i915: Running i915_sw_fence_mock_selftests/test_dma_fence [ 603.876315] Asynchronous wait on fence mock:mock:0 timed out (hint:fence_notify [i915]) [ 603.886148] ok 3 - mock_fence [ 603.886377] i915: Running scatterlist_mock_selftests/igt_sg_alloc [ 604.398052] sg_alloc_table timed out [ 604.401979] i915: Running scatterlist_mock_selftests/igt_sg_trim [ 604.909003] i915_sg_trim timed out [ 604.912850] ok 4 - mock_scatterlist [ 604.912987] i915: Running i915_syncmap_mock_selftests/igt_syncmap_init [ 604.924092] i915: Running i915_syncmap_mock_selftests/igt_syncmap_one [ 605.430961] i915: Running i915_syncmap_mock_selftests/igt_syncmap_join_above [ 605.438458] i915: Running i915_syncmap_mock_selftests/igt_syncmap_join_below [ 605.446670] i915: Running i915_syncmap_mock_selftests/igt_syncmap_neighbours [ 606.736462] i915: Running i915_syncmap_mock_selftests/igt_syncmap_compact [ 606.744342] i915: Running i915_syncmap_mock_selftests/igt_syncmap_random [ 607.266569] ok 5 - mock_syncmap [ 607.266771] ok 6 - mock_uncore [ 607.271144] i915: Running intel_ring_mock_selftests/igt_ring_direction [ 607.281872] ok 7 - mock_ring [ 607.282142] i915: Running intel_engine_cs_mock_selftests/intel_mmio_bases_check [ 607.293531] ok 8 - mock_engine [ 607.293654] i915: Running intel_timeline_mock_selftests/mock_hwsp_freelist [ 607.305034] mock: [drm] Using Transparent Hugepages [ 607.310389] mock: [drm] Incompatible option enable_guc=3 - GuC is not supported! [ 607.318223] mock: [drm] Incompatible option enable_guc=3 - HuC is not supported! [ 607.326040] mock: [drm] Incompatible option enable_guc=3 - GuC submission is N/A [ 608.689291] i915: Running intel_timeline_mock_selftests/igt_sync [ 608.698029] i915: Running intel_timeline_mock_selftests/bench_sync [ 608.906628] bench_sync: 53196 random insertions, 1895ns/insert [ 608.915839] bench_sync: 53196 random lookups, 53ns/lookup [ 609.155603] bench_sync: 1048321 in-order insertions, 96ns/insert [ 609.164592] bench_sync: 1048321 in-order lookups, 2ns/lookup [ 609.387580] bench_sync: 7925741 repeated insert/lookups, 9ns/op [ 609.494570] bench_sync: 22777779 cyclic/1 insert/lookups, 4ns/op [ 609.601560] bench_sync: 22764130 cyclic/2 insert/lookups, 4ns/op [ 609.708550] bench_sync: 20866721 cyclic/3 insert/lookups, 4ns/op [ 609.815540] bench_sync: 18824730 cyclic/5 insert/lookups, 5ns/op [ 609.922530] bench_sync: 18970181 cyclic/8 insert/lookups, 5ns/op [ 610.029521] bench_sync: 6831382 cyclic/13 insert/lookups, 14ns/op [ 610.151510] bench_sync: 64217 cyclic/21 insert/lookups, 1563ns/op [ 610.282616] ok 9 - mock_timelines [ 610.283053] mock: [drm] Using Transparent Hugepages [ 610.292383] mock: [drm] Incompatible option enable_guc=3 - GuC is not supported! [ 610.300224] mock: [drm] Incompatible option enable_guc=3 - HuC is not supported! [ 610.308041] mock: [drm] Incompatible option enable_guc=3 - GuC submission is N/A [ 610.316016] i915: Running i915_request_mock_selftests/igt_add_request [ 610.322822] i915: Running i915_request_mock_selftests/igt_wait_request [ 610.844362] i915: Running i915_request_mock_selftests/igt_fence_wait [ 611.363857] i915: Running i915_request_mock_selftests/igt_request_rewind [ 611.371805] i915: Running i915_request_mock_selftests/mock_breadcrumbs_smoketest [ 612.250735] Completed 165 waits for 104816 fence across 16 cpus [ 612.462006] ok 10 - mock_requests [ 612.462987] mock: [drm] Using Transparent Hugepages [ 612.472754] mock: [drm] Incompatible option enable_guc=3 - GuC is not supported! [ 612.480545] mock: [drm] Incompatible option enable_guc=3 - HuC is not supported! [ 612.488383] mock: [drm] Incompatible option enable_guc=3 - GuC submission is N/A [ 612.496394] i915: Running i915_gem_object_mock_selftests/igt_gem_object [ 612.539886] ok 11 - mock_objects [ 612.540722] mock: [drm] Using Transparent Hugepages [ 612.550497] mock: [drm] Incompatible option enable_guc=3 - GuC is not supported! [ 612.558586] mock: [drm] Incompatible option enable_guc=3 - HuC is not supported! [ 612.566459] mock: [drm] Incompatible option enable_guc=3 - GuC submission is N/A [ 612.574445] i915: Running i915_gem_phys_mock_selftests/mock_phys_object [ 612.619821] ok 12 - mock_phys [ 612.620708] mock: [drm] Using Transparent Hugepages [ 612.630193] mock: [drm] Incompatible option enable_guc=3 - GuC is not supported! [ 612.638335] mock: [drm] Incompatible option enable_guc=3 - HuC is not supported! [ 612.646137] mock: [drm] Incompatible option enable_guc=3 - GuC submission is N/A [ 612.654080] i915: Running i915_gem_dmabuf_mock_selftests/igt_dmabuf_export [ 612.661326] i915: Running i915_gem_dmabuf_mock_selftests/igt_dmabuf_import_self [ 612.669021] i915: Running i915_gem_dmabuf_mock_selftests/igt_dmabuf_import [ 612.676285] i915: Running i915_gem_dmabuf_mock_selftests/igt_dmabuf_import_ownership [ 612.688485] i915: Running i915_gem_dmabuf_mock_selftests/igt_dmabuf_export_vmap [ 612.696350] ok 13 - mock_dmabuf [ 612.696939] mock: [drm] Using Transparent Hugepages [ 612.706117] mock: [drm] Incompatible option enable_guc=3 - GuC is not supported! [ 612.714044] mock: [drm] Incompatible option enable_guc=3 - HuC is not supported! [ 612.721922] mock: [drm] Incompatible option enable_guc=3 - GuC submission is N/A [ 612.729895] i915: Running i915_vma_mock_selftests/igt_vma_create [ 613.237460] igt_vma_create timed out: after 41 objects in 43 contexts [ 613.245661] i915: Running i915_vma_mock_selftests/igt_vma_pin1 [ 613.252146] i915: Running i915_vma_mock_selftests/igt_vma_rotate_remap [ 615.995098] i915: Running i915_vma_mock_selftests/igt_vma_partial [ 618.518421] ok 14 - mock_vma [ 618.519367] mock: [drm] Using Transparent Hugepages [ 618.528625] mock: [drm] Incompatible option enable_guc=3 - GuC is not supported! [ 618.536467] mock: [drm] Incompatible option enable_guc=3 - HuC is not supported! [ 618.544330] mock: [drm] Incompatible option enable_guc=3 - GuC submission is N/A [ 618.552318] i915: Running i915_gem_evict_mock_selftests/igt_evict_something [ 618.697340] i915: Running i915_gem_evict_mock_selftests/igt_evict_for_vma [ 618.836366] i915: Running i915_gem_evict_mock_selftests/igt_evict_for_cache_color [ 618.849926] i915: Running i915_gem_evict_mock_selftests/igt_evict_vm [ 618.992647] i915: Running i915_gem_evict_mock_selftests/igt_overcommit [ 619.170384] ok 15 - mock_evict [ 619.171566] mock: [drm] Using Transparent Hugepages [ 619.181351] mock: [drm] Incompatible option enable_guc=3 - GuC is not supported! [ 619.189520] mock: [drm] Incompatible option enable_guc=3 - HuC is not supported! [ 619.197366] mock: [drm] Incompatible option enable_guc=3 - GuC submission is N/A [ 619.205322] i915: Running i915_gem_gtt_mock_selftests/igt_mock_drunk [ 619.712643] drunk_hole timed out after 41097/524288 [ 619.717987] i915: Running i915_gem_gtt_mock_selftests/igt_mock_walk [ 620.225588] walk_hole timed out at a692000 [ 620.230687] i915: Running i915_gem_gtt_mock_selftests/igt_mock_pot [ 620.976730] pot_hole timed out after 19/33 [ 620.981596] i915: Running i915_gem_gtt_mock_selftests/igt_mock_fill [ 621.491729] fill_hole timed out (npages=1, prime=257) [ 621.497424] i915: Running i915_gem_gtt_mock_selftests/igt_gtt_reserve [ 621.620470] i915: Running i915_gem_gtt_mock_selftests/igt_gtt_insert [ 621.891015] ok 16 - mock_gtt [ 621.892018] mock: [drm] Using Transparent Hugepages [ 621.901620] mock: [drm] Incompatible option enable_guc=3 - GuC is not supported! [ 621.909449] mock: [drm] Incompatible option enable_guc=3 - HuC is not supported! [ 621.917347] mock: [drm] Incompatible option enable_guc=3 - GuC submission is N/A [ 621.925497] i915: Running i915_gem_huge_page_mock_selftests/igt_mock_exhaust_device_supported_pages [ 621.937541] i915: Running i915_gem_huge_page_mock_selftests/igt_mock_memory_region_huge_pages [ 621.947479] i915: Running i915_gem_huge_page_mock_selftests/igt_mock_ppgtt_misaligned_dma [ 622.032179] i915: Running i915_gem_huge_page_mock_selftests/igt_mock_ppgtt_huge_fill [ 622.540726] igt_mock_ppgtt_huge_fill timed out at size 61313024 [ 622.547707] i915: Running i915_gem_huge_page_mock_selftests/igt_mock_ppgtt_64K [ 622.944941] ok 17 - mock_hugepages [ 622.945866] mock: [drm] Using Transparent Hugepages [ 622.956054] mock: [drm] Incompatible option enable_guc=3 - GuC is not supported! [ 622.963891] mock: [drm] Incompatible option enable_guc=3 - HuC is not supported! [ 622.971705] mock: [drm] Incompatible option enable_guc=3 - GuC submission is N/A [ 622.979664] i915: Running intel_memory_region_mock_selftests/igt_mock_reserve [ 623.006381] i915: Running intel_memory_region_mock_selftests/igt_mock_fill [ 623.057022] i915: Running intel_memory_region_mock_selftests/igt_mock_contiguous [ 624.040905] i915: Running intel_memory_region_mock_selftests/igt_mock_splintered_region [ 624.075553] i915: Running intel_memory_region_mock_selftests/igt_mock_max_segment [ 624.108598] i915: Running intel_memory_region_mock_selftests/igt_mock_io_size [ 624.116097] igt_mock_io_size with ps=1000, io_size=a7823000, total=1b5fee000 [ 624.133227] igt_mock_io_size mappable theft=(632MiB/2680MiB), total=7007MiB [ 624.204955] ok 18 - mock_memory_region [ 624.204964] # i915 mock selftests: pass:18 fail:0 skip:0 total:18 [ 624.209921] # Totals: pass:18 fail:0 skip:0 total:18 [ 624.216762] ok 1 - i915 mock selftests. They could be parsed with kunit.py with: echo "[ 0.000000] TAP version 14" >logs dmesg >>logs ./tools/testing/kunit/kunit.py parse logs Note: kunit.py is currently broken with modules, not producing any results if "TAP version xx" is not found. It also shows the results duplicated. 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/Kconfig | 15 ++++ drivers/gpu/drm/i915/Makefile | 5 ++ drivers/gpu/drm/i915/selftests/.kunitconfig | 12 +++ drivers/gpu/drm/i915/selftests/i915_kunit.c | 95 +++++++++++++++++++++ 4 files changed, 127 insertions(+) create mode 100644 drivers/gpu/drm/i915/selftests/.kunitconfig create mode 100644 drivers/gpu/drm/i915/selftests/i915_kunit.c diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig index 3efce05d7b57..323c63af72d8 100644 --- a/drivers/gpu/drm/i915/Kconfig +++ b/drivers/gpu/drm/i915/Kconfig @@ -53,6 +53,21 @@ config DRM_I915 If "M" is selected, the module will be called i915. +config DRM_I915_KUNIT_TESTS + tristate "KUnit tests for Intel 8xx/9xx/G3x/G4x/HD Graphics" if !KUNIT_ALL_TESTS + depends on DRM_I915 && KUNIT + default KUNIT_ALL_TESTS + help + Builds unit tests for i915 driver. This option is not useful for + distributions or general kernels, but only for kernel + developers working on i915 DRM driver. + + For more information on KUnit and unit tests in general, + please refer to the KUnit documentation in + Documentation/dev-tools/kunit/. + + If in doubt, say "N". + config DRM_I915_FORCE_PROBE string "Force probe driver for selected new Intel hardware" depends on DRM_I915 diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 2535593ab379..4ce1e8113db6 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -341,6 +341,11 @@ i915-$(CONFIG_DRM_I915_SELFTEST) += \ selftests/igt_spinner.o \ selftests/librapl.o +test-i915-y += selftests/i915_kunit.o +ifneq ($(CONFIG_DRM_I915_SELFTEST),) + obj-$(CONFIG_DRM_I915_KUNIT_TESTS) += test-i915.o +endif + # virtual gpu code i915-y += i915_vgpu.o diff --git a/drivers/gpu/drm/i915/selftests/.kunitconfig b/drivers/gpu/drm/i915/selftests/.kunitconfig new file mode 100644 index 000000000000..98600bbde6b3 --- /dev/null +++ b/drivers/gpu/drm/i915/selftests/.kunitconfig @@ -0,0 +1,12 @@ +# i915 dependencies +CONFIG_KUNIT=y +CONFIG_PCI=y +CONFIG_DRM=y +CONFIG_DRM_I915=y + +# Needed by selftest +CONFIG_EXPERT=y +# PREEMPT_RT is not set + +CONFIG_DRM_I915_SELFTEST=y +CONFIG_DRM_I915_KUNIT_TESTS=y diff --git a/drivers/gpu/drm/i915/selftests/i915_kunit.c b/drivers/gpu/drm/i915/selftests/i915_kunit.c new file mode 100644 index 000000000000..731b84a1fdc3 --- /dev/null +++ b/drivers/gpu/drm/i915/selftests/i915_kunit.c @@ -0,0 +1,95 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Unit tests for i915 + * + * Copyright © 2022 Intel Corporation + * Author: Mauro Carvalho Chehab + */ + +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + +#include +#include "i915_selftest.h" + +/* + * Test run logic, similar to what i915 selftest does + */ + +static void run_mock_test(struct kunit *test, + int (*f)(void)) +{ + int ret; + + cond_resched(); + if (signal_pending(current)) + return; + + pr_info("Running %s\n", test->name); + ret = f(); + + if (ret == -EINTR && !signal_pending(current)) + ret = 0; + + if (WARN(ret > 0 || ret == -ENOTTY, + "%s returned %d, conflicting with selftest's magic values!\n", + test->name, ret)) + ret = -EINVAL; + + KUNIT_EXPECT_EQ(test, ret, 0); +} + +/* + * Test initialization + */ +static int initialize_i915_selftests(struct kunit *test) +{ + i915_prepare_selftests(test->name); + + pr_notice("Setting dangerous option KUnit %s - tainting kernel\n", + test->name); + add_taint(TAINT_USER, LOCKDEP_STILL_OK); + + return 0; +} + +/* + * Test suite 1: mock selftests + */ + +/* Declare selftest functions */ +#define selftest(x, __y) int __y(void); +#include "i915_mock_selftests.h" +#undef selftest + +/* Create selftest functions */ +#define selftest(__x, __y) \ + static void mock_##__x(struct kunit *test) { \ + run_mock_test(test, __y); \ + } +#include "i915_mock_selftests.h" +#undef selftest + +/* Fill tests array */ +#define selftest(__x, __y) KUNIT_CASE(mock_##__x), +static struct kunit_case i915_mock_tests[] = { +#include "i915_mock_selftests.h" + {} +}; +#undef selftest + +/* + * Declare test suites + */ + +static struct kunit_suite i915_test_suites[] = { + { + .name = "i915 mock selftests", + .test_cases = i915_mock_tests, + .init = initialize_i915_selftests, + }, +}; + +kunit_test_suites(i915_test_suites); + +MODULE_LICENSE("GPL v2"); +MODULE_IMPORT_NS(I915_SELFTEST); From patchwork Thu Nov 3 14:51:34 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: 14924 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp581718wru; Thu, 3 Nov 2022 07:56:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Kc7kD5N45JIiaZCrqF/WIEfTIGya54aSnIsjz+JvlZc9qHUHrfVt1NS0t3CpLv8YjnY38 X-Received: by 2002:a05:6402:50cf:b0:462:352e:f4a7 with SMTP id h15-20020a05640250cf00b00462352ef4a7mr29898219edb.317.1667487360165; Thu, 03 Nov 2022 07:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667487360; cv=none; d=google.com; s=arc-20160816; b=Zs+mjyw58vM41ZsUVb9dstilgF7Itv0viZRddhHmdfNc7vrCzEIEBavD6qRa2yBtZy NwTYxXtlr67hqzUE84xskIbXZ/Kr/+fr3MyU9ZLyHwh1TvS4tTif/NrBQYjswqUsLzus YpDWBqqPdSy+vUIeisDD2kk63bIhfFXyTVfoJNp/oQpuKoAZthIPKMkRSLsNZ6Qu67Am zLRMzSrwshAbGTWpVXg6d8QHt82QQibPT16eeU7GJHSy+t6dcQ2r0mUGJpbW0jeWBJJq t3dgXxqAH88bVWnQPm9gs0z5hvirALEyk9NMS4mENNgPNm0bcKT4lnRTNFoK2uyVjxGS dO1A== 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=YLq1r8Y3JmGWJczoNzStyo64Szy9oBBzt3zCKTG8fyE=; b=Kk1Si/N/PF28kpKmYt8F1Qw82jSn00UAGGqatcV8UYFyNUGEheUF+HjDkuBwpeE14u P7vlF3L1YL+MBrvO+kMP1f3GB/AmnOFL9MKlueQY2Yu9MKIeJXaxMqaE4VmYarEtRyQb Ox8QYa5JKmPEX7Eg1ebeO84QIfZQxsDHkWuHqISoZT+RE3ZH4UAAobL20AwAs3WET+L/ I/RRSHzZc/UO0OiT7qeUX22V0t2X8qvrUsBML+TiSwlX2BTJpO+iD6aThq0MT9qt9r4j SaXMjOCHYzOZ1CwsDi8ireCA5/izYSz9hRacsiMXONtAqAz/wAt9BgqtRDaS/OvPzjip ub+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=dPxuEoxl; 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 a16-20020aa7cf10000000b0045d079c8f20si1256677edy.43.2022.11.03.07.55.35; Thu, 03 Nov 2022 07:56:00 -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=dPxuEoxl; 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 S231807AbiKCOwA (ORCPT + 99 others); Thu, 3 Nov 2022 10:52:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbiKCOvr (ORCPT ); Thu, 3 Nov 2022 10:51:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4521E186FE; Thu, 3 Nov 2022 07:51:44 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D2FA361F0D; Thu, 3 Nov 2022 14:51:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37B47C43144; 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=EgUfYi6omv+JphmdlMh1yMRQPC+NdgzKbGKf8IoKtB4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dPxuEoxlI5Qt+ee5xfr6mCmkZr3CA39FxBhKj0s86ZClDnS48ngdeW3WwzCaBJ/jt cDP4p9meb+b4Lo7nOaPtPYv05r8aIEi170TYkCKeu7ZLSFg7zcIFzJSOTKTNMiQEIa oO65nxc3qHmRXJHkoU8HpiO2w3vcOWG3RSnVelWtzAd5VZwdVTX4TMEt/w5ex2LmT7 NLl9y49LnA1X0ZbWMHc3rPz5YiympCgVnPlMb1/G03M8gB/F9NhUgy/VQizmZ1xoRA BXhoyEEHnjNgRfvXeYHA6B/2PEUPKdn5Yu7HxfM7L7jJuQsugA2wCQDIFCzCPSKkNv vRPUGttR0RxeA== Received: from mchehab by mail.kernel.org with local (Exim 4.96) (envelope-from ) id 1oqbZE-0076b1-0G; 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 4/8] drm/i915: add support to run KUnit tests on bare metal Date: Thu, 3 Nov 2022 14:51:34 +0000 Message-Id: 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?1748487226067156183?= X-GMAIL-MSGID: =?utf-8?q?1748487226067156183?= Add a logic to seek for PCI devices and to run tests on them, if the tests are willing to run on physical hardware, instead of using Qemu. Later patches will add the KUnit tests. So, for now, mark such functions with __maybe_unused, to avoid build issues with WERROR. 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 | 100 ++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/drivers/gpu/drm/i915/selftests/i915_kunit.c b/drivers/gpu/drm/i915/selftests/i915_kunit.c index 731b84a1fdc3..430610864f6e 100644 --- a/drivers/gpu/drm/i915/selftests/i915_kunit.c +++ b/drivers/gpu/drm/i915/selftests/i915_kunit.c @@ -8,9 +8,109 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#include #include +#include "i915_drv.h" #include "i915_selftest.h" +#define MAX_PCI_BOARDS 8 + +/* + * PCI selftest support + * + * It is possible to run tests that demands hardware in bare metal. + * + * Add a logic to detect and get PCI devices using i915 driver, up to + * MAX_PCI_BOARDS devices. + */ + +static int n_boards; +static struct pci_dev *dev_i915[MAX_PCI_BOARDS]; +static int __maybe_unused i915_pci_init_suite(struct kunit_suite *suite) +{ + struct pci_dev *pdev = NULL; + int i; + + /* Check for PCI devices with i915 driver */ + do { + /* + * Let's search all devices at the PCI ID. We could, instead, + * use include/drm/i915_pciids.h, but that would mean a much + * more complex code, and won't still warrant that the device + * was bound to i915 driver. So, let's check the driver's + * name instead. + */ + pdev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_ANY_ID, pdev); + if (pdev) { + if (pdev->driver && !strcmp(pdev->driver->name, "i915")) { + pr_info("%s: it is a i915 device.\n", + pci_name(pdev)); + + for (i = 0; i < n_boards; i++) { + if (pdev == dev_i915[i]) { + pci_dev_put(pdev); + continue; + } + } + dev_i915[n_boards++] = pdev; + if (n_boards >= MAX_PCI_BOARDS) + break; + } else { + pci_dev_put(pdev); + } + } + } while (pdev); + + return 0; +} + +static void __maybe_unused i915_pci_exit_suite(struct kunit_suite *suite) +{ + int i; + + for (i = 0; i < n_boards; i++) + pci_dev_put(dev_i915[i]); + + n_boards = 0; +} + +static void __maybe_unused run_pci_test(struct kunit *test, + int (*f)(struct drm_i915_private *i915)) +{ + struct drm_i915_private *i915; + int i, ret, disable_display; + + if (!n_boards) + kunit_skip(test, "runs only on i915 hardware\n"); + + for (i = 0; i < n_boards; i++) { + i915 = pdev_to_i915(dev_i915[i]); + + cond_resched(); + if (signal_pending(current)) + return; + + pr_info("Running %s on %s\n", + test->name, pci_name(dev_i915[i])); + + /* FIXME: is it ok to disable_display here? */ + disable_display = i915->params.disable_display; + i915->params.disable_display = 1; + ret = f(i915); + i915->params.disable_display = disable_display; + + if (ret == -EINTR && !signal_pending(current)) + ret = 0; + + if (WARN(ret > 0 || ret == -ENOTTY, + "%s returned %d, conflicting with selftest's magic values!\n", + test->name, ret)) + ret = -EINVAL; + + KUNIT_EXPECT_EQ(test, ret, 0); + } +} + /* * Test run logic, similar to what i915 selftest does */ 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); 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); From patchwork Thu Nov 3 14:51:37 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: 14923 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp581545wru; Thu, 3 Nov 2022 07:55:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5o1glcMs3O0mBaCddl9zRuAf1SjgL+TsCldj2Rb+qH+60Lj6QaLzuPbUgoBs8S6TOXaVfG X-Received: by 2002:a17:906:9f1b:b0:7ad:c66e:ad7d with SMTP id fy27-20020a1709069f1b00b007adc66ead7dmr23276352ejc.432.1667487340519; Thu, 03 Nov 2022 07:55:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667487340; cv=none; d=google.com; s=arc-20160816; b=i1fGAzpa/MZ70XIe66CgQFVNPJwBF67bV3zWiZFdslQ54eDmvITKusO+zSzfdMQ1S8 9+ri+UgQTyG8IFPWjk5/jCNHYTROkintKPfoKol4JbpNmqsC1nVqu85lvow3OeH8EJK5 qRtXYF8T0MCnyDtj4z8xPKj0PmOJTyjrFyweIOQbhQ/6p01w4AFtORat0gIeaA4mabmz bRcRQ6DDQrf1CQOWNP5TVUWTFLLCGGcbtgv28N+QAro8YB6ZorygnLprqwN+iBk2Ymoa gDjGNeXE3ik34bXbxSc6nmXUVKA2ZnaqTWr9wr/E+GmzhTdYPH/sK7bdUCosPKW1OIRO WaNQ== 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=bIwFlk4VKJe0h4RbC8q/wjOywu/WUYgfBHMnTLIcGQs=; b=tKHjHZMF01YXzLp6JL0bxkdxHpNcJ1AlkYBZkeJ3hLO//tcqjc3h+J6Qy5hY9C97sC KtxCurag3PcWeveAlc7wrbHjM27sAhm3OTSsgTfJ0GB8/VYTY+aMGj/BPb3CQ9hx7AYJ 7x4Fla2aYXsIMyIX2goi4+GUQQs5dDIRuEKujtfKOLw0cgB2X5meEWO7pXCc5kCJU4Ys QkLMafCE4fzUeJ3RCTqR5je/60p3oW0OKeiorJOhUZUSeX7e4eYQPz1CDC4AfZCE7nTn sN3bNxRYhhRFfcEJ3iQETWbgbM5+qHhw3wbw3tvG74C83vuoLiwdn1dj0xqCMCCnBUq9 ignA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=PpKxgCyL; 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 cr15-20020a170906d54f00b0078356aaeb61si1615177ejc.286.2022.11.03.07.55.16; Thu, 03 Nov 2022 07:55:40 -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=PpKxgCyL; 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 S231703AbiKCOvr (ORCPT + 99 others); Thu, 3 Nov 2022 10:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229634AbiKCOvp (ORCPT ); Thu, 3 Nov 2022 10:51:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 205A117AAA; Thu, 3 Nov 2022 07:51:44 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B464361EE5; Thu, 3 Nov 2022 14:51:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 236F7C433D7; 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=SZs0xzRAu/lUh7Ou+KjchMQxPSRyfWrY0vjw5o+g4yI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PpKxgCyL33L3sNUJHVl20aN3tHAcB4PT7LFh9WPwQ825+Mh1wn6j7Z/itVmsLysmd yGk1LCuWoqegvFew/7rHWwljdrQ0ArgGkTlgATCkbrQ4PdxvelR6onNZ959t6epyvG mvcZRlEiF7bMEGRUN7gitM7r6JD126nL/cy1miwXjGD4Ur1MlZmMCYDX8s7eSftYVO lR6rMO0/x4xhg67XtY1mvmNcRDk+boLrsOHBhLraEj6p57B6hYGRVBZ60yNF87zEsS wg+GhRyb0aI6GM2ZrGlJNNGFfBZXEM2PfOtm3lZcw/QAgh+nKkyQG2Cmuabvr2QnTb 9MufaJxB8Kkcw== Received: from mchehab by mail.kernel.org with local (Exim 4.96) (envelope-from ) id 1oqbZE-0076bA-0R; 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 7/8] drm/i915: now that all functions are used, remove __maybe_unused Date: Thu, 3 Nov 2022 14:51:37 +0000 Message-Id: <499491f3b7307648fcf6c31c45713d26331d76d7.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?1748487205572934887?= X-GMAIL-MSGID: =?utf-8?q?1748487205572934887?= The PCI-specific KUnit tests that run in bare metal got added, so we can remove the __maybe_unused from such functions. 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/selftests/i915_kunit.c b/drivers/gpu/drm/i915/selftests/i915_kunit.c index 6de5d3fa8920..e6dbffe919e6 100644 --- a/drivers/gpu/drm/i915/selftests/i915_kunit.c +++ b/drivers/gpu/drm/i915/selftests/i915_kunit.c @@ -26,7 +26,7 @@ static int n_boards; static struct pci_dev *dev_i915[MAX_PCI_BOARDS]; -static int __maybe_unused i915_pci_init_suite(struct kunit_suite *suite) +static int i915_pci_init_suite(struct kunit_suite *suite) { struct pci_dev *pdev = NULL; int i; @@ -64,7 +64,7 @@ static int __maybe_unused i915_pci_init_suite(struct kunit_suite *suite) return 0; } -static void __maybe_unused i915_pci_exit_suite(struct kunit_suite *suite) +static void i915_pci_exit_suite(struct kunit_suite *suite) { int i; @@ -74,8 +74,8 @@ static void __maybe_unused i915_pci_exit_suite(struct kunit_suite *suite) n_boards = 0; } -static void __maybe_unused run_pci_test(struct kunit *test, - int (*f)(struct drm_i915_private *i915)) +static void run_pci_test(struct kunit *test, + int (*f)(struct drm_i915_private *i915)) { struct drm_i915_private *i915; int i, ret, disable_display; From patchwork Thu Nov 3 14:51:38 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: 14925 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp581758wru; Thu, 3 Nov 2022 07:56:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6HT9tpLO4Go/h0G/o5DOOoYfgy8dsFlgen2GT01OHh9FT8P+QncMrg4clpS94yenwA6yrn X-Received: by 2002:a17:906:3b48:b0:7ad:fa67:1daa with SMTP id h8-20020a1709063b4800b007adfa671daamr10826394ejf.653.1667487365449; Thu, 03 Nov 2022 07:56:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667487365; cv=none; d=google.com; s=arc-20160816; b=N8K8yedSrOlKSqdrc8Q/kGKTbxNM6AFXz3JIPVhmJGzia4KrBokPBKgzfG8zHVZ0d2 XhFKxG48+hIYy2gCu5QX0BL1E2T7n/jkMO1A2XOraZQxM34Ks32GKPzr4rOHZnTv2YNH yIlvP9it4VbwO+HLHBsANkLz5lEK31NZFDitK0jBqkmFkQmL7KYA+IF4LAZDNxqxtd5f f2pKCcU9CqwSzpA88dEd7kQ5Qun8a1HowcmdHD5TTn9JqXvkpk/6yED0unjHKrIvFEPc ZelcTaNqjx11bNwLSQKOrnCW+ke9DUWVVw3aNyK/Lda50ebvV/Yy2ihPDmGfKyTKDsWt KYjg== 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=7l0akenZY8eJcAbXnz3OOqm4unmQOrWF3mk/oUeZ5j4=; b=Qhst4v6A+brjS7MCAC8r0NwrvRR6gL5k6Ok9E3jGLkjdoo7pjj5ge8nrr+dGiLAMYV vj4vMCe856fRSw/Ruijec/QCXNz7dXkT/sbxfkf8VTazc/1DxdQa9skwu2yumCYyRLdT 7TvFgDVJ2GMlCVdBNUF/nWoek1e9lFel6AK08ZlLDkSien1GQz2GQ/s9tuizb567RcLh mtsAdYf9Hnsa9C21Wntcp0ONzhKqhdJH3Pc16gHnd3BoN+1bbsNdXk/5Tm9JV7QdTySi xkx0QaMASm31xhBlM5LTfHc2rFdcqId1MxdXqbU2nUC5ZvwCy8GCGyizkWLoir+18pU6 TyGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=JyRr6wkp; 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 qw16-20020a1709066a1000b00780a3097d20si1612010ejc.180.2022.11.03.07.55.41; Thu, 03 Nov 2022 07:56:05 -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=JyRr6wkp; 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 S231834AbiKCOwH (ORCPT + 99 others); Thu, 3 Nov 2022 10:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231776AbiKCOvr (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 5F3C918B30; Thu, 3 Nov 2022 07:51:46 -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 10DE5B828B4; Thu, 3 Nov 2022 14:51:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AC02C43143; 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=1ynZM90FVuDLUm6Ak2G09DB3URFnKUrvlsBGn1ucYXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JyRr6wkpdyrB+4wxOYn8KaoaZBO7VBziswzVB1HZ1YrOkxCzbS5gSVYEDEKL0/NM/ tv+O6T4EKN1qyE+TuPm/P3bSTS75P5h5qczWaX//RCbAZqGfFXwhpl2ci3+fVYscM9 MjUcHB8WrhDFP6HvOvgMvUy4LMlX8TDzd+duVGS2fWp0jrY2wlF01O9Bye7eerkqFp WKff862tjqqjsnsVuZlb+8G27tDnTM3V5XjA8V5a+oYeFsYnHvz4wgXN4O4N7sMryA GeQgiIPWXkz4q29z8ZFVGRZxAvIPooFutsGc4Kww5k+VrVbAuMJvIhXTUBVeTPSO1d DEnKH2009KERQ== Received: from mchehab by mail.kernel.org with local (Exim 4.96) (envelope-from ) id 1oqbZE-0076bD-0V; Thu, 03 Nov 2022 14:51:40 +0000 From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , =?utf-8?q?Christian_K=C3=B6n?= =?utf-8?q?ig?= , "Daniel Latypov" , "Isabella Basso" , =?utf-8?q?Micha=C5=82_Winiarski?= , =?utf-8?q?T?= =?utf-8?q?homas_Hellstr=C3=B6m?= , Daniel Vetter , David Airlie , Jani Nikula , Joonas Lahtinen , Matt Roper , Matthew Auld , 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 8/8] drm/i915: check if current->mm is not NULL Date: Thu, 3 Nov 2022 14:51:38 +0000 Message-Id: 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?1748487231792368699?= X-GMAIL-MSGID: =?utf-8?q?1748487231792368699?= The mmap tests require mm in order to work. Failing to do that will cause a crash: [ 316.820722] BUG: kernel NULL pointer dereference, address: 00000000000000e8 [ 316.822517] #PF: supervisor write access in kernel mode [ 316.823430] #PF: error_code(0x0002) - not-present page [ 316.824390] PGD 0 P4D 0 [ 316.825357] Oops: 0002 [#1] PREEMPT SMP NOPTI [ 316.826350] CPU: 0 PID: 1517 Comm: kunit_try_catch Tainted: G U N 6.1.0-rc2-drm-266703e6f163+ #14 [ 316.827503] Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake Y LPDDR4x T4 Crb, BIOS TGLSFWI1.R00.3243.A01.2006102133 06/10/2020 [ 316.828633] RIP: 0010:down_write_killable+0x50/0x110 [ 316.829756] Code: 24 10 45 31 c9 31 c9 41 b8 01 00 00 00 31 d2 31 f6 48 89 ef e8 e1 74 4a ff bf 01 00 00 00 e8 87 d6 46 ff 31 c0 ba 01 00 00 00 48 0f b1 13 0f 94 c0 5a 84 c0 74 62 8b 05 49 12 e4 00 85 c0 74 [ 316.830896] RSP: 0018:ffffc90001eabc58 EFLAGS: 00010246 [ 316.832008] RAX: 0000000000000000 RBX: 00000000000000e8 RCX: 0000000000000000 [ 316.833141] RDX: 0000000000000001 RSI: ffffffff81c94fc9 RDI: ffffffff81c94fc9 [ 316.834195] RBP: 0000000000000158 R08: 0000000000000001 R09: 0000000000000000 [ 316.835231] R10: 0000000000000000 R11: ffff8883a13350b8 R12: 0000000000000002 [ 316.836259] R13: 0000000000000001 R14: 0000000000100000 R15: 00000000000000e8 [ 316.837237] FS: 0000000000000000(0000) GS:ffff8883a3800000(0000) knlGS:0000000000000000 [ 316.838214] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 316.839190] CR2: 00000000000000e8 CR3: 0000000002812003 CR4: 0000000000770ef0 [ 316.840147] PKRU: 55555554 [ 316.841099] Call Trace: [ 316.842047] [ 316.842990] ? vm_mmap_pgoff+0x78/0x150 [ 316.843936] vm_mmap_pgoff+0x78/0x150 [ 316.844884] igt_mmap_offset+0x178/0x1b9 [i915] [ 316.846119] __igt_mmap+0xfe/0x680 [i915] Unfortunately, when KUnit module runs, it doesn't create an user context, causing mmap tests to fail. 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/gem/selftests/i915_gem_mman.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c index add5ae56cd89..2c5f93e946b5 100644 --- a/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c @@ -1845,6 +1845,11 @@ int i915_gem_mman_live_selftests(struct drm_i915_private *i915) SUBTEST(igt_mmap_gpu), }; + if (!current->mm) { + pr_err("Test called without an user context!\n"); + return -EINVAL; + } + return i915_live_subtests(tests, i915); } EXPORT_SYMBOL_NS_GPL(i915_gem_mman_live_selftests, I915_SELFTEST);