Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp534500lqh; Tue, 7 May 2024 06:56:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXiKvnWVHn1Ot93kBSqFdCONRdmMpmbwvo4hB89+AGjDvTp1ZwlElLAW4BnZlJfiLBl/qLxCnXFjcX3al1Dmi0TCUBQh0SfbYa7hnKsqw== X-Google-Smtp-Source: AGHT+IHq9iMTBHdyqp4tF58aiKPndjuMfdt2xHOl9YVVNCAtJXJRlcv0s6t1pzmvXEaqtvEXzL23 X-Received: by 2002:a05:6a21:920d:b0:1ab:82fe:9285 with SMTP id tl13-20020a056a21920d00b001ab82fe9285mr13640190pzb.58.1715090165360; Tue, 07 May 2024 06:56:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715090165; cv=pass; d=google.com; s=arc-20160816; b=ktLe2aeDf8RmaNlxFJPtBzXjsL91W2nPV7KayCJP0yP53qV44C0QvOMciq2lglCHcj /yXkWCmWwQgayVvhB6xz1qjvdHWPqEEklsJH/XmaO8r2SJcyuG+VQTdkGf+YnJIujIWb fuABWsxZL0T4qBDygP0DJw+k8ElZEnuwOpiOhzGUKQE9H+l3x5HCyH4n2lgE1tYJ0kJV +Npsc8b6cLFQSz9XJ3lu+eJcg/RvlqLW0n9/BjfzoiawrGSW7561dPLOQN2eBJX0/EHO mdt0bxlclTf+lHxkcDJB7Xm0RcpcupLf1E4CweNDXahmp0XyFwK0h9VmNejCx8KMl/Ue Npog== 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=hFP+2Nl1xBq4tb6zr3T9a0LrT9rJ4SDyxA4zj9wz+Bk=; fh=r/IQdUhM+izf1DBtdeXsvTqzb+iJn8kGsFxm/9n8OYo=; b=BtZnRukKc1KXFpr6PPnOfmhDcj1BJq8p0hTuv6qIO0rsYX9+huUabkNhJ/fmjhiiGf EI/0/fkKIrGiV7f5GSgy92ooEmrUL1QHtE2aAdvpUc6AcaIzUfEacqiPM+/0bQw74uST baals85mR76uuZlqdpyznhenaJzv27XK/2Yt/DQhORsewboYMwhY8u6JOuJZJCcsUx4Y remI9QgNn9l4XFP8SnPh7c4pNo3Zuj4voJbdd+pvsg8rL2w3pD+11s/zrjmoQw2MnJ/v UxVkc3yGycjKVeOey/5ra4z1H2u0zZGaLVQvodOIBZQJg5UjcgaIEsoMj84MkgEgIvMQ Urgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="CT8hK2/c"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u12-20020a170902e80c00b001e832ed6fc0si10773151plg.606.2024.05.07.06.56.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:56:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="CT8hK2/c"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171416-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 5E4AAB2AE01 for ; Tue, 7 May 2024 13:31:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BC94E1BED93; Tue, 7 May 2024 13:18:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CT8hK2/c" 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 A8D7015ECF8; Tue, 7 May 2024 13:18:57 +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=1715087937; cv=none; b=RiCOrJo0IF7Uwe3+3zyHStPn7vL24avqEm/IIqpoKR30Ad3QAxO/Ff4lH1X8wJOUTAd5Mvhw+NeNVlBa8jshUOPDb6slCwJCG9q9ZMIKzb9gNLg546GtMIImpbgf6mjmdW8x8ZWM/CDUGEfd6Gz848nG/6UGkZiDYUlOdmAOwGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087937; c=relaxed/simple; bh=7kp1dFVIU1GWBJN/S2jYDRC3Mp7yeADRvgV4od+K6E0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MBivFtK8HE8L34L7YsgKoYblaJWSiKks51pgoFfsmF0AXPTBrltVlZMw2JyDHDyO730DnEVjmwynkkD/MWcBi2zyiEomOIiV+zjFFLJqv1mj8tCz/p+D1tFrDN+R9Gh4pvIM+zsakDNCYNnJnjgqKwgzuAFHy4YuL7q1jzYrsso= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CT8hK2/c; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DC047C4AF68; Tue, 7 May 2024 13:18:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715087937; bh=7kp1dFVIU1GWBJN/S2jYDRC3Mp7yeADRvgV4od+K6E0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=CT8hK2/czlVSPWVCq+lcEXJJQ2N2KEXMXj7mVZ1MoXuYvUSMuSbT8Tfwiv3g/xcfr DyWFD+5eFmbyocOS2n8yVNmgKPYsD0imSvTqFAUO2jCWvpi9ev2/Y9JeJ+0llfiXs5 Ix46eE9ssWl265hgJqcv/adOcrdKE/39VF8FbmmICXBkSylQiTUHos/bvxfNq4OHi7 Vu5du9zGlCXlO5bW7etcDsb6sKwJQiztim1WuYFxek5K8qFd8GW4thG67DqYfYdx3u T3eQ6F5683kFD3BB7s40EZcK35oLlgvNkACZ7qTEqkGCswEFN6Wx3GLQ7S+ZIuFqkK bBS7I/ec5kGbQ== From: Maxime Ripard Date: Tue, 07 May 2024 15:17:44 +0200 Subject: [PATCH v13 26/28] 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: <20240507-kms-hdmi-connector-state-v13-26-8fafc5efe8be@kernel.org> References: <20240507-kms-hdmi-connector-state-v13-0-8fafc5efe8be@kernel.org> In-Reply-To: <20240507-kms-hdmi-connector-state-v13-0-8fafc5efe8be@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 , Andy Yan 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.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2115; i=mripard@kernel.org; h=from:subject:message-id; bh=7kp1dFVIU1GWBJN/S2jYDRC3Mp7yeADRvgV4od+K6E0=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDGlWmp/2sjf4fHwisZHbZ8K2E7sqLwg2sfT29u7V9KqVu PK/efHajqksDMKcDLJiiixPZMJOL29fXOVgv/IHzBxWJpAhDFycAjCR/EDG+rrCp9XqF47+0fy0 +vX0S9768/7fM3oSXBZZuaKAuWhV4SquNgthdev4BX6/Vs2z3PhIj7HOUkngxt+X1yQ2e3+0/fy w+5DLNhfFeM/LVwx6+BfHe6YHmp6/UuJ2RqJU8/T8Sec29MQCAA== 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.45.0