Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2072928lqb; Mon, 27 May 2024 07:07:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUwyUSkUiiYrJ3vvDGDcwSSmIzHMFEjQg7GhwpCTLc51UDAePOoKlDEjRKaKQdNz6uIld1w3I37c7IDivC7ffkbsFIzWTwV/o4ygnZylw== X-Google-Smtp-Source: AGHT+IE3uTlU9Sjm+HO83Yvh9KbZBzFaNARmzIUWmuCLccRdS+xdEiFmBmq+TCFEKAbm0eCJgE9m X-Received: by 2002:a19:6405:0:b0:523:ac80:e660 with SMTP id 2adb3069b0e04-52964ca874dmr4886807e87.38.1716818820373; Mon, 27 May 2024 07:07:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716818820; cv=pass; d=google.com; s=arc-20160816; b=XiHaO9p+gBAFixRugu/cZgQTthNG+hjf8cQUatv7SxIEOteHQ1IVkQKLfavIiQ+W+y FC/4BRo85eMVkmZfDZCw3C+Ii5cLBnlIvIGTmC1fB4B66Y7mHiVGjH46Kqf1q+hMt9OU 0FEV4A9c4st3CeKsXTPfATuTtQN4WYWwN+XiaBDJplSO0+5iuCVOj+6RiGE0jzvZQnPb P2D6TXlo2WuG9YGwJrJhOFuV8tYSqIEKAJw0YKmWVZ+CFDEWfMpZw5jWfgiuCz9Uw70o orPJ+Zh+/eFuLtdzHemuwOrGU1MZiA0BSLX5xpXHkTN7jxwU1t2QjgxpZyxhxDUbTe6z DWeA== 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=0nXsltI3CLYzT465HvoBfSEgZt1uxuzC8g1VzjQ/RgvoxABXrjXOjbzgqYS9RK/jik Zk/qLoBtSPolVB5qMSYbqgYqseP3tL4Yi76QjEWSL2PVYYrHGMtsUfXtwhx/KfCvDwzs No8LcZUmXjenZppv94sNXMJdpfv+53eR9e2qbONLOwUlqVOAMRBlkfXABXqv+dHEPHi4 EdbZG7k0gY57h5Q0PX+PmKtZ+qrM76wprSQwY4XF1WiA0pZCkzdRAgP3m/ok3OgNkMXd X0aimQFTg75r4UVJVFGKqaKZDQYTmnt5djFsYvE/z8tak8MnuugCy3hVwK1FfYzWlX5B RHmg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EhmewPdy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190790-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190790-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 a640c23a62f3a-a62a0215025si299747866b.433.2024.05.27.07.07.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 07:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-190790-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=EhmewPdy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-190790-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-190790-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 CA25E1F210B5 for ; Mon, 27 May 2024 14:06:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC58816F0E4; Mon, 27 May 2024 13:59:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EhmewPdy" 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 BF23716F0CE; Mon, 27 May 2024 13:59:23 +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=1716818363; cv=none; b=sIYRu8Uj0ZFh08W0C/AwiD4NjptoWeUOKLGiOJzhOGPE972zggstm9m3jLDw8wY5RaFirMMoYVQBfIz+16cSDmVRGrAHmPdak7JPrHpq8kSgZj/L8oe0JWX+ku8zkpIAD8EuAmi4GIXgKVKBeivOslkmu5AGZc2AHjj1mg5WksE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716818363; c=relaxed/simple; bh=7kp1dFVIU1GWBJN/S2jYDRC3Mp7yeADRvgV4od+K6E0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gg/iaiSiDoNKgea/xIe1zGm3ZHaq9HTQxqnuIwRBBxvGPONegWLxMBB/E1QNcheSUdMF6Bs2Dv5u0TWvKLQ9+r1aGnT1HYIDMesdSE/7Dr3pAxFwZsIfwfDA4XdZpBmGTEYUf+9y2W7cPr2C9cBi0JGX+8KB5ZaB+PtBFRQoaTg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EhmewPdy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED3A8C32789; Mon, 27 May 2024 13:59:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716818363; bh=7kp1dFVIU1GWBJN/S2jYDRC3Mp7yeADRvgV4od+K6E0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=EhmewPdyShDry8+QEL8giz8LFFo422V44Ts1wdgG6GxxCZ9UxadRXP8Px+FNvvEuq rfrZ5zDs99kJ6PZlpSXh3sWHJV9SkhbqGt7XKUc/bnDSLDHd3xHXH78ORZQZIy57Ci /q4o52JNeDDmXSOXFsXeMJx52AVxgfgEwy4w1r8pEuz0EVjDwYAyvwaU1mdXIpcA0K boHdnbMfsr7+Vglt67YwgltNZL7D/BXDj1XcXsIlFbNyXWlweQaoc7v/z7GDutFl/U UlyZzZ6cvHKGC3ewogfWHqVB1RKZOGuFHnRVixZ+jEwoT0lEmza8u0a2GxvotmbsrH pyMvrpDzn55Dg== From: Maxime Ripard Date: Mon, 27 May 2024 15:58:16 +0200 Subject: [PATCH v15 27/29] 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: <20240527-kms-hdmi-connector-state-v15-27-c5af16c3aae2@kernel.org> References: <20240527-kms-hdmi-connector-state-v15-0-c5af16c3aae2@kernel.org> In-Reply-To: <20240527-kms-hdmi-connector-state-v15-0-c5af16c3aae2@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=owGbwMvMwCmsHn9OcpHtvjLG02pJDGkhE3MY4g6vX7Xlsd7DDZv1LCcmXefV37flhPijYHb54 jDOQJ4FHVNZGIQ5GWTFFFmeyISdXt6+uMrBfuUPmDmsTGBDuDgFYCLdaYwNXXkbjke4ybufnBOQ O+nj06ZDvs+0xGf8vfD3z6PFqR719+9VHnER1n8k3v582trCjS8dGatZJ/PxPpymu7JN7eDViSk m+y/Ib1YVvJ3G3sEc167czhGzUMznffGMuebty5b1r9bjjgQA 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