From patchwork Thu Feb 22 18:14:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 204974 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp129834dyb; Thu, 22 Feb 2024 10:29:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUm/0cvwvPGav9esRnNNdENnW6GEDG0+gZhJrqqAcHQ8i+8+qDRRo28OWccYVSkAM0PQOr6N0MjTpFysyasGnVdXdYeJA== X-Google-Smtp-Source: AGHT+IHWTxqonHMzsM8/r2rzn1Z8JYBvyhDF2ZwRsHMt2uhf54UGAIu0JgrZbncL1V51QGwx20LG X-Received: by 2002:a05:6a20:8f20:b0:1a0:de5c:aabd with SMTP id b32-20020a056a208f2000b001a0de5caabdmr455408pzk.22.1708626579198; Thu, 22 Feb 2024 10:29:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708626579; cv=pass; d=google.com; s=arc-20160816; b=OuxQ46KUKfZ4Z+pDOIRxMgnLHN56L2kcN/6ynW4bplbjqkYII+gpYSeaOaRoZGgi0S nt4vMfynJIaYN/drAf46pM9MtUlIYQ8M5mCG+ZYSrDrjLktRjrtZncucT3lNPC1Pn9T5 sbYL7QVVBP3HNDYSHSZOYICLoWcgA6+tabp0vosp+ki7ix/PMHdXaAVap38u8p7jidJP hSMLrIuxs88Kp1psfi3xnh4xcmm/V6H0Gr2BvgUe4mVpjv7GyBR+38/QqY3MirjcprjI NlWUpAwFGpB7ERooWUdLrlH/FlSULaHzqVeRNfnRxtMwfrwVZPhhBSTUGBg7Pg3HIR1Y xgzQ== 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=GcpVXsJcy60zS9t2ACfwVyym7WjKVKCydaA9dFZHyko=; fh=7mnR4/DMo6zaWtUGaVI9DND4TR+QGflpVaaXOChu5h0=; b=pIfsf6DtAJ1VkoOO0WMO/IWwetGj1YPyBzCoE7V440TNHtVelhBN/OZDFT0n2doTLv mc3HxCde55ypdUh3TrCm5ABNXrFdBtDYsYNVBCY66UJIBnjj7o5fjR161FT6B9onmqdK dD+wy47PXti3Y02koaMpI8Ia5ammHZOjAPXF1ViAGazd9PfONEm5sfGjUY3VDfBTOMEK CO5yj1kXcPZtKxo31eIFJY50PPhkNjA7Ht45Ffg1pAU0WBkND+erZK02qGKxH2Ez1kEB wzUH2+5QIo9YPCYpTki70APR+s2Zx8Aj36wvO3Q7KTexI+ovKDFkxvzB0PfdcY1iGOKe nkdw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QR1hMWSI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77109-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77109-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p3-20020a170902780300b001dc4adf9a63si1789050pll.512.2024.02.22.10.29.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:29:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77109-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QR1hMWSI; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-77109-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77109-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 0A2352862E3 for ; Thu, 22 Feb 2024 18:29:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C41A140387; Thu, 22 Feb 2024 18:15:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QR1hMWSI" 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 97B5A140366; Thu, 22 Feb 2024 18:15:52 +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=1708625752; cv=none; b=ivpiZmSf2U/OKS8Nx6mdBtLS5ZY2QRQZgXvFXwyz44SjKRzOTCc3PdPqVwowDhTZw16OHJ2lDHKf6p8MHRvR6BfNNyfLWxThtTKVUXTSQaPau10aWpzeth09MvRBQ5LL3wvNW8s4VvGhPv/X/wB9QuBITlxvw6UPW+j3qBfB+L0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708625752; c=relaxed/simple; bh=8tamAetoSgHQ1OcsRskLkqCtZqUknTtgTwiDjxhENTo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CG3k+xSMsGSuoDDrClcq2TXpIOpTlBQroLusB5ZafLi2NLBsL60EPugEPjbqFPKaRH+oCPR5JlaV3yea8zrr7WThbaJ+/czFwyvxeaD7hYm1jI4Fl2hFMSR1Vm0DqduhH3YNJOrwjel/VPacIRflPeVuWSmPsAMCD8ZcGSqq7Wg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QR1hMWSI; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25C59C433C7; Thu, 22 Feb 2024 18:15:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708625752; bh=8tamAetoSgHQ1OcsRskLkqCtZqUknTtgTwiDjxhENTo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QR1hMWSIWiLieEB07vaDhgJeHXTdXha3tjaZH33S3sg362WRN1ZZmhTXdIBRJ2RIf kx5G6BVDwCFO2Pw8zKk3fB2XvclUOSpITaHM3lqqvIkXIYzyl96eagH3ajpktkHGz1 RqnIoyB6FYqgD63xmGjdZdw+smV+y0a//JDUBtaa+JlqvGSJ2DeBCP3hVa6WBFe0BC QQE2Ify7Tb7bNNr9u3aY2UU5ba24WpD/o0QL6ND+9jauSeUtCls8QxG/nLoBrbfgrr cLgiQYtjjkcwsJFjqul27/k+DKr/TkF29jBqwh7bwT7BBxywGsC8TgpXk8O5R0haLC ksyfoNvuab6Pw== From: Maxime Ripard Date: Thu, 22 Feb 2024 19:14:16 +0100 Subject: [PATCH v7 30/36] 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 Message-Id: <20240222-kms-hdmi-connector-state-v7-30-8f4af575fce2@kernel.org> References: <20240222-kms-hdmi-connector-state-v7-0-8f4af575fce2@kernel.org> In-Reply-To: <20240222-kms-hdmi-connector-state-v7-0-8f4af575fce2@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?b?VmlsbGUgU3lyasOkbMOk?= , 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 X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2025; i=mripard@kernel.org; h=from:subject:message-id; bh=8tamAetoSgHQ1OcsRskLkqCtZqUknTtgTwiDjxhENTo=; b=kA0DAAoW4+8Nb2cYUcUByyZiAGXXjvyhaRrBDlWjl3LMUICDVFNoGLYbz56S+cfYlsUBjdB/8 4h1BAAWCgAdFiEEXBM3pF7KmuuJBg6e4+8Nb2cYUcUFAmXXjvwACgkQ4+8Nb2cYUcX6lQD+LVKq N8MxTOTivfG8G6auJjmW4gY0MqC1O3/UbUDHPsgBAL3lPa49s3q5gr6HBNPRtQL4Ct9vghvk+cx KHDnHkGQN X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791624823924071606 X-GMAIL-MSGID: 1791624823924071606 Now that we have a plane create helper for kunit mocked drivers, let's convert to it in vc4. Signed-off-by: Maxime Ripard Reviewed-by: MaĆ­ra Canal --- 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_EQ(test, type, DRM_PLANE_TYPE_PRIMARY); + + plane = drm_kunit_helper_create_primary_plane(test, drm, + NULL, + NULL, + NULL, 0, + NULL); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, plane); - drm_plane_helper_add(plane, &vc4_dummy_plane_helper_funcs); - return plane; }