Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1279747rbb; Mon, 26 Feb 2024 04:48:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVHvj3ZoaTX1ya3pW9ciGh51ot0kxA239tnr4cc+K4bT/bVJXw4tT4DEBxMqEq8eMVmVCnqonRXw5WX3IL9dmy2pN1p7RH6GtGsgBJEQA== X-Google-Smtp-Source: AGHT+IHI7LonK3yzNTsfPMDVkVV7HriLlGfh9gG0xJVFXhg87BCGWbRnxzNlKSXmkBAmhNNylgn2 X-Received: by 2002:aca:f19:0:b0:3c1:8498:239b with SMTP id 25-20020aca0f19000000b003c18498239bmr6981819oip.59.1708951683595; Mon, 26 Feb 2024 04:48:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708951683; cv=pass; d=google.com; s=arc-20160816; b=BHNXWIAFNlEtfJjl64KkW3oJfYR4jTQ108K9sZ9vRJgCWvF8PXyQR/LIZbVY+D0Aej hzwUn+C+W/HT0znEKYAM3rb8zzTiwbWOxQokCs1yMVIJIANvYXbrqPPcZn2RQ2/EVmVx sn5Uhw1WVcJ5Yg94wK4hvJ+UAItbjSp3nVQKg5AiqBAn6EGAqO3F5aOquRMrhqDoONCN JFnmQIEnUXhCQi2VIOZsv2Dtsz/Gfjl1/c+gKVmCnMnMgNyx5v6SzcPyxTHfqfhAf3cq 6F+PHU6d2GT6VutK8w5slyMcIaKUA/Wk8PQv/6+tJJJp3cWXgUodq54fdFYeb5VBUaUM s2kA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=iD3v2Ou7opydLf7BV2zQNv5Q6avksFmwr21fP3d+Tu8=; fh=f8i86EdiQTzDTREZDCLliK+apaxdqTjVfw1axe/nDog=; b=t3c5NVQWNBAnVXZ8HYPNfEsnYAPjncj+7bPhhwahAbEARc02Fzfd+SsI1DHLJmhXRc 02XDhUiBDoDJh2tjZfY84m3vRTGdHdJCSOg4bMxRL0G05Vp+yKNChVbKvUWoJLOid5a4 ss6/O6JQwC7b9jaqSx4e3SK8roojJGCJ285WlJE2dZnJHE/yBILVcbCwZmeloqmh4lTK M+xd956vFOLCbp1pkWYcCDpmMtcql5QEnfkMgwt6LzbXnXjIOmPdPNZLUaxoBbCtA5s9 NQ5nWCtUmp24x5qUvKgE6whisskzXkwaGt8WmAaYwqQy8n8yVqjAGS5pt6vvXSAJqnMs M7/w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FYqHb7pj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81405-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g23-20020ae9e117000000b00787c1828cc5si4927335qkm.490.2024.02.26.04.48.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 04:48:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81405-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FYqHb7pj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81405-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81405-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 570821C220D7 for ; Mon, 26 Feb 2024 12:48:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0D8F77F7DF; Mon, 26 Feb 2024 12:47:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FYqHb7pj" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C468604D4 for ; Mon, 26 Feb 2024 12:47:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951664; cv=none; b=mI+EZq0Iko+mkndVDSoZQVJP5ioUeKyrTav+rnXAHZ+XC+i/xdSXwgn7nE9ka7gAgbu9h76QZQG6nCYOyUQny3LqO/jOLRboUwTWEPuVWeisJsQi0hK/uBSjHMuAtkv4ZOknbxNyQSllRMz5Lm6SyhX1JIaamqScgbwnPyMhV5A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708951664; c=relaxed/simple; bh=vPnudlAxEBtSwaSh16NplVrq2SvEXPSzaOEsHkk1YQc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=mWotCCamXp9X8CXrHWneJfGbSQAjMLcAKs0RFBSQUApGyLvugdZDmuJyeA4DSHTeDMtDbrl322ygSwXRdN6CWsyqhTJpr4oqQ9YUFfyOXblT/6i/QX0mTbtRykefO77PooZt7eSa5B1XiKOZlGUFh6jDS/SzJb8cAKnhEqJJ2AE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FYqHb7pj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7236EC433C7; Mon, 26 Feb 2024 12:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708951663; bh=vPnudlAxEBtSwaSh16NplVrq2SvEXPSzaOEsHkk1YQc=; h=From:To:Cc:Subject:Date:From; b=FYqHb7pjQYLZRQcpUsUksBUteFXpvb15TA3fQeT3qftscQBkT/quRXHxaBoDeIZK/ OHn7d7D0euJdnIYvpn8QsSgcGMOgThM0dfJKN1CsdkG9G0bzYJkpNraiDWziCSkgaW zGh4Kx1eVSqy2ZXI0YrpKu3sXdtn2lfpfixfieFK/MZWgDYZT+dMfAdA9m1yi1UOiW fXbq3nlo9J+G7J81H5P8n2Yy/+Kxbym8cwD//m2h3qFI7C3hcgky8XB6ZN02yY7b4i Wd9aKoGJYKdN729IMDTUYV65OV2Mdp0SYGBNZ9ggOKbyptFCiY7OViVw4HJe7M+aO8 Lo7b2hwIQuOMw== From: Arnd Bergmann To: Lucas De Marchi , Oded Gabbay , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= Cc: Arnd Bergmann , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rodrigo Vivi , Matthew Brost , Jani Nikula , Matt Roper , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] [v2] drm/xe/kunit: fix link failure with built-in xe Date: Mon, 26 Feb 2024 13:46:36 +0100 Message-Id: <20240226124736.1272949-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann When the driver is built-in but the tests are in loadable modules, the helpers don't actually get put into the driver: ERROR: modpost: "xe_kunit_helper_alloc_xe_device" [drivers/gpu/drm/xe/tests/xe_test.ko] undefined! Change the Makefile to ensure they are always part of the driver even when the rest of the kunit tests are in loadable modules. Fixes: 5095d13d758b ("drm/xe/kunit: Define helper functions to allocate fake xe device") Signed-off-by: Arnd Bergmann --- v2: don't remove KUNIT dependency --- drivers/gpu/drm/xe/Kconfig | 1 + drivers/gpu/drm/xe/Kconfig.debug | 1 - drivers/gpu/drm/xe/Makefile | 6 ++++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/Kconfig b/drivers/gpu/drm/xe/Kconfig index 6d4428b19a4c..c3a3b204ae5b 100644 --- a/drivers/gpu/drm/xe/Kconfig +++ b/drivers/gpu/drm/xe/Kconfig @@ -11,6 +11,7 @@ config DRM_XE select DRM_BUDDY select DRM_EXEC select DRM_KMS_HELPER + select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n select DRM_PANEL select DRM_SUBALLOC_HELPER select DRM_DISPLAY_DP_HELPER diff --git a/drivers/gpu/drm/xe/Kconfig.debug b/drivers/gpu/drm/xe/Kconfig.debug index 549065f57a78..df02e5d17d26 100644 --- a/drivers/gpu/drm/xe/Kconfig.debug +++ b/drivers/gpu/drm/xe/Kconfig.debug @@ -76,7 +76,6 @@ config DRM_XE_KUNIT_TEST depends on DRM_XE && KUNIT && DEBUG_FS default KUNIT_ALL_TESTS select DRM_EXPORT_FOR_TESTS if m - select DRM_KUNIT_TEST_HELPERS help Choose this option to allow the driver to perform selftests under the kunit framework diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile index 4c6ffe4b2172..b596e4482a9b 100644 --- a/drivers/gpu/drm/xe/Makefile +++ b/drivers/gpu/drm/xe/Makefile @@ -158,8 +158,10 @@ xe-$(CONFIG_PCI_IOV) += \ xe_lmtt_2l.o \ xe_lmtt_ml.o -xe-$(CONFIG_DRM_XE_KUNIT_TEST) += \ - tests/xe_kunit_helpers.o +# include helpers for tests even when XE is built-in +ifdef CONFIG_DRM_XE_KUNIT_TEST +xe-y += tests/xe_kunit_helpers.o +endif # i915 Display compat #defines and #includes subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \ -- 2.39.2