Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp565868lqi; Thu, 7 Mar 2024 05:48:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWn0w8VZ3Hsx+rk9PlRRpQzoxYFo3rnbgby/eUNC3RCyl9LV/h5weqE0R+yh9y4Pxe848+UMFCPZeBwjVik3HpieN8wef8DqSpolAjLuw== X-Google-Smtp-Source: AGHT+IHBljmqDKdATCtcEqIa1e05QtiPAJmquLvho8KtM5lL+jOY1cxAungafI8fRvquAN9NVlNT X-Received: by 2002:a17:906:11d9:b0:a45:ada9:4bf1 with SMTP id o25-20020a17090611d900b00a45ada94bf1mr1363117eja.12.1709819292600; Thu, 07 Mar 2024 05:48:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709819292; cv=pass; d=google.com; s=arc-20160816; b=jpOm+/7WoSgmXy0Ih9R804VyK+mdpFOS3j9lJWq/VfTCjE90bSD8hZ8aeKuxOREJpO LzMFS/3ePvnw6q8oNreqBwXArYeuFjTdW24WhyGafyU/8bC9Pe17YqF+B/n6AhLkL2nN WrpBy8TDBHdzXLoHuG2Q4KdC6CBPx8SJo68vV0IPMl40ArV22ruV9vofdAKraN/RYhMH ivASyAsyAzqc4veEnnPlu2NRNCAscbb+eEVy1UzeoG42AEevtRsJbWPR4rf0/iJliOUc DcShs8PKff3bVjOIkzM5FTkQFC9NtB1amT3uRU+2sFTsmSuudTL9LeJu9zHPAaJnTimZ ZcCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=ck/ir9fWa/91UVkpVr8xx9gNiyY9hTs9nRXAsg0ytec=; fh=iba4iMK4A01E5lANNVtvxLKnMNbV0ktetP2NDCs9MH8=; b=YsfVoM+yORNcLnBaWNC+CJKEdEgUiHWlBdxT+GqKanifgUGVJAk8SCrwOMUh12vMm2 aiTZXZPFHYW/Gt7LQdfaqt157Jn2OJ5mhamOYg3zuRfPxA7bdQpWugwdIx6iJy64wFYx HdGC/X1qZfOb9TQiptf++UaQ+DJ1upsFt/1Q//xBlAiYSzD0bq2yC8Wc0xVXidZDCgbd cXqTfuMwGPlT/V8B3pa9SxZUdGEFtaVUMBnSogWHUfKYvX7uQhS5/nzbRD7PrDIl7/1s rVyfihRbXYRIB8kNzE/3XTYLAclB6h8CUAbWgnuFRPcC8xglhLETps2cCFwUwxD73o5Z Dndw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hbzw0YT0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-95649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kt23-20020a170906aad700b00a446b5a5228si6066222ejb.623.2024.03.07.05.48.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 05:48:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Hbzw0YT0; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-95649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95649-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4F2FA1F23D6B for ; Thu, 7 Mar 2024 13:48:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D20313B2AC; Thu, 7 Mar 2024 13:40:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Hbzw0YT0" 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 8615313B28A; Thu, 7 Mar 2024 13:40:06 +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=1709818806; cv=none; b=m87PrhxycplIj1WJEqS6MJUQXbf95f/nXY1wUOBzIH62rNt1w1pdlZGEbS3eR6+V/X/J/Fokf5MVFcAUa/ndNeQRFgUMUa8IgGLno3ORNgNBnAVfP8KzbLPfLWOY3gHNeNQzK+EhDxabvRXvFHRaG/R+8PvFZLu8JydAanCe/3o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709818806; c=relaxed/simple; bh=EewgHdae7h/0M9r/RvBrwLIDoK5b4L1MDAyj2KDv0e0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Qy4YCHsz7Y4YtHxr44LVylBT/6fLs4EMhKWDj+leLT0L091uX0co4ylFg+DffzoYpRp4gj9EgX3dSF3xNb99diP1qCxFT7NWZhglXxTe4zaOFxM2JSbx9XSNtndVM3mqICpjLwa9ExWCFRb3bHn5yySqxt7oNGTpXYwoJ9ez0JE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Hbzw0YT0; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16083C433C7; Thu, 7 Mar 2024 13:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709818806; bh=EewgHdae7h/0M9r/RvBrwLIDoK5b4L1MDAyj2KDv0e0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Hbzw0YT0AlzES5hC9S0X/3BFzna2QlBXNfyzleSW2U2MiYwBHo1M+5Fd7mXsNGwKf Md0hSeaPJkMoJAKRovO4V7Th/WKvAU3qJ3uzStm0SnBtgHEdwAcIqIlf3z6JT6AOEZ WwXsKKSoXIZzm77ixGx0Wn2MhfC4/vH1MLkbxeb/5Gxe/mpjTg7nKhMZabaUxByOqe L8oijFj7s4P3CZbNjso2pP2ysNV58qy8TEHNXIw1l38kkvv7iPBdbwBOibUd+R0Tjw FwCw/2JLf+IFgk+WYtHiyoEyXD+BrQr3e98zkJQmhtvedUHnHwn5V3QT3+mkdtb8fj j+p/kpRl8QsSw== From: Maxime Ripard Date: Thu, 07 Mar 2024 14:38:52 +0100 Subject: [PATCH v8 25/27] drm/vc4: tests: Convert to plane creation helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240307-kms-hdmi-connector-state-v8-25-ef6a6f31964b@kernel.org> References: <20240307-kms-hdmi-connector-state-v8-0-ef6a6f31964b@kernel.org> In-Reply-To: <20240307-kms-hdmi-connector-state-v8-0-ef6a6f31964b@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Jonathan Corbet , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Hans Verkuil , Sebastian Wick , =?utf-8?q?Ville_Syrj=C3=A4l=C3=A4?= , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev, Maxime Ripard , =?utf-8?q?Ma=C3=ADra_Canal?= X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2115; i=mripard@kernel.org; h=from:subject:message-id; bh=EewgHdae7h/0M9r/RvBrwLIDoK5b4L1MDAyj2KDv0e0=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKkvD2dP/WS2Ml1P7a5P5eToh2dfqutlVx1QvnNcvOX7E l/5t62pHaUsDGJcDLJiiiwxwuZL4k7Net3JxjcPZg4rE8gQBi5OAZhIcQEjQ1Pzx9QQ+2yVqTbf 2A8ZfTkxYWttomn+hb6zj7pE3sxrC2dkaFNQ91V1vLnw3bNy6c38akLzDq/e9cXyh6LLtPCQywe /MgAA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D Now that we have a plane create helper for kunit mocked drivers, let's convert to it in vc4. Reviewed-by: MaĆ­ra Canal Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/tests/vc4_mock_plane.c | 34 +++++++----------------------- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/vc4/tests/vc4_mock_plane.c b/drivers/gpu/drm/vc4/tests/vc4_mock_plane.c index 973f5f929097..14357db82238 100644 --- a/drivers/gpu/drm/vc4/tests/vc4_mock_plane.c +++ b/drivers/gpu/drm/vc4/tests/vc4_mock_plane.c @@ -1,43 +1,25 @@ // SPDX-License-Identifier: GPL-2.0 -#include -#include -#include +#include #include #include #include "vc4_mock.h" -static const struct drm_plane_helper_funcs vc4_dummy_plane_helper_funcs = { -}; - -static const struct drm_plane_funcs vc4_dummy_plane_funcs = { - .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, - .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, - .reset = drm_atomic_helper_plane_reset, -}; - -static const uint32_t vc4_dummy_plane_formats[] = { - DRM_FORMAT_XRGB8888, -}; - struct drm_plane *vc4_dummy_plane(struct kunit *test, struct drm_device *drm, enum drm_plane_type type) { struct drm_plane *plane; - plane = __drmm_universal_plane_alloc(drm, sizeof(struct drm_plane), 0, - 0, - &vc4_dummy_plane_funcs, - vc4_dummy_plane_formats, - ARRAY_SIZE(vc4_dummy_plane_formats), - NULL, - DRM_PLANE_TYPE_PRIMARY, - NULL); - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, plane); + KUNIT_ASSERT_EQ(test, type, DRM_PLANE_TYPE_PRIMARY); - drm_plane_helper_add(plane, &vc4_dummy_plane_helper_funcs); + plane = drm_kunit_helper_create_primary_plane(test, drm, + NULL, + NULL, + NULL, 0, + NULL); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, plane); return plane; } -- 2.43.2