From patchwork Tue Nov 28 10:24:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 170699 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp3814425vqx; Tue, 28 Nov 2023 02:27:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IEA1eJWxT1w2vSil3W0Tj4323R9Uwqa1YyeZngsgdmh0gAlZJuUKOYDDdBMYPIByZKPAW6f X-Received: by 2002:a05:6871:3a2c:b0:1fa:3685:1cae with SMTP id pu44-20020a0568713a2c00b001fa36851caemr9167133oac.6.1701167276770; Tue, 28 Nov 2023 02:27:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701167276; cv=none; d=google.com; s=arc-20160816; b=DQGeso5wL719j+gbyJDwts8YE8VoDhU5D/P+b4Q2OV4O9xOSg4DpjLjDdBF3kk1pAx n0tWqdaLfqGX8fP6WuudwKIxZKfoxIk4vNkg6xWSv0pm6qv+qR2TdtomrIBNzpI8NB70 6Mk1aWcGM64P2JD3aN1R9tRgLNUdwffPuD7k/3LfPsOtjCewPlGAxsRBP4GScK2koiy6 76tJdrh1CDPPNW3SxGgYgOYY/v4Bw+meIl5PpRibDTFoFlHPphUXGeft21hnL7Feev99 fi2As0ZYifVYt8rdN6bOkczVKm2jh0zz8IG8nB+td8i6r6Q5+s+8ySBmaPTfeXF32CrT Ofsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=TelYhrf3lHSfmuQbsDQx8yiDqfqm5sf6AGVpVKTVo0k=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=tY3pmKV0gkVb++65tuuZx4ILZVX2vuUQdd2hh4ShxsbnneAXev1Zi/9SQsaBkAxSAq AwFRn1iGTpZKpLOJRcX8D4hqJbzutT8ZJ1pDURwNWgV3uKcLOFwb02/eC7Tc+sXKvuvq h1JK5C951mvxJIdfPgajfhTOc52ERrz2duyc28JgNPBjFaqYhXgAuvom7UVhDvqm+ZVi 0RDv+MEj0wmxcABA+rhGsbgDj0qZ9Zg3yWHATWwjwD/VwVZVwL1QllmcwVRmdnOsz/RU 3kHUosFwdsOxXZUAirtqSi09laOmzu3+hNxTAo4vpoqXNAsyZ1noHhU1c3KoV9mXnD+K 7AtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nnbjrnTU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h14-20020a056a00230e00b006cb88a284dfsi11938084pfh.164.2023.11.28.02.27.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 02:27:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nnbjrnTU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id D317380E0D08; Tue, 28 Nov 2023 02:27:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344298AbjK1K10 (ORCPT + 99 others); Tue, 28 Nov 2023 05:27:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344281AbjK1K0h (ORCPT ); Tue, 28 Nov 2023 05:26:37 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEE1326A2 for ; Tue, 28 Nov 2023 02:25:23 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 97452C43391; Tue, 28 Nov 2023 10:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701167123; bh=D4BPROK9mHKg2SOBmNbMJbX24ynWespGqsn/dV5n270=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=nnbjrnTUyNuTRzF4BF2/drlI7BY+fUoAv7deH48V5iA58AKwSu4MofN4kSh2ZWHE9 LiI9T1QXVB0MmdQLgK1Lvm7tZJItqEhen1b+6M+SWOjWUdPn78+nW7vK8LjJ0CP9MY Syqxax8OzKI2w5xztMoJAPDMargttWQIamWjZ6u5U0kmuc1f3AiVvkapAyDwjs83mC llhzbE/Q/ypUlxflfd3OPXtF4Vim6OIERHJjTmyCh69pUqtOCpr22loYOHT7t8QgEn 4vszaATylGPQqy5uRCpYxLhto+ywnmFoYH9sfhXHA7RlDwMf12LGpziuD04UK3z+WC oPYFNf7vY33Xg== From: Maxime Ripard Date: Tue, 28 Nov 2023 11:24:32 +0100 Subject: [PATCH v4 21/45] drm/vc4: tests: Remove vc4_dummy_plane structure MIME-Version: 1.0 Message-Id: <20231128-kms-hdmi-connector-state-v4-21-c7602158306e@kernel.org> References: <20231128-kms-hdmi-connector-state-v4-0-c7602158306e@kernel.org> In-Reply-To: <20231128-kms-hdmi-connector-state-v4-0-c7602158306e@kernel.org> To: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Emma Anholt , Jonathan Corbet , Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: Hans Verkuil , 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=3334; i=mripard@kernel.org; h=from:subject:message-id; bh=D4BPROK9mHKg2SOBmNbMJbX24ynWespGqsn/dV5n270=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmp+y+9W9adc0nE0a4r//OGHMd9ew/JtxTYmVaI3JcJi ub7d2ZnRykLgxgXg6yYIkuMsPmSuFOzXney8c2DmcPKBDKEgYtTACaytYvhv591tsyH6L0PPs2p K07UPTn/V+bt/nJHoQcKTp+WXLVbz87w37Gp8EFBu+GT+AyTYIvQlseGSx5rnjE+vHDmTLf2Mgt uVgA= X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 28 Nov 2023 02:27:52 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783803178233609429 X-GMAIL-MSGID: 1783803178233609429 The vc4_dummy_plane structure is an exact equivalent to vc4_plane, so we don't need it. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/tests/vc4_mock.c | 6 ++---- drivers/gpu/drm/vc4/tests/vc4_mock.h | 9 ++------- drivers/gpu/drm/vc4/tests/vc4_mock_plane.c | 14 +++++--------- 3 files changed, 9 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/vc4/tests/vc4_mock.c b/drivers/gpu/drm/vc4/tests/vc4_mock.c index 63ca46f4cb35..1c1be39141ba 100644 --- a/drivers/gpu/drm/vc4/tests/vc4_mock.c +++ b/drivers/gpu/drm/vc4/tests/vc4_mock.c @@ -109,16 +109,14 @@ static const struct vc4_mock_desc vc5_mock = static int __build_one_pipe(struct kunit *test, struct drm_device *drm, const struct vc4_mock_pipe_desc *pipe) { - struct vc4_dummy_plane *dummy_plane; struct drm_plane *plane; struct vc4_dummy_crtc *dummy_crtc; struct drm_crtc *crtc; unsigned int i; - dummy_plane = vc4_dummy_plane(test, drm, DRM_PLANE_TYPE_PRIMARY); - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dummy_plane); + plane = vc4_dummy_plane(test, drm, DRM_PLANE_TYPE_PRIMARY); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, plane); - plane = &dummy_plane->plane.base; dummy_crtc = vc4_mock_pv(test, drm, plane, pipe->data); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dummy_crtc); diff --git a/drivers/gpu/drm/vc4/tests/vc4_mock.h b/drivers/gpu/drm/vc4/tests/vc4_mock.h index 2d0b339bd9f3..002b6218960c 100644 --- a/drivers/gpu/drm/vc4/tests/vc4_mock.h +++ b/drivers/gpu/drm/vc4/tests/vc4_mock.h @@ -21,13 +21,8 @@ struct drm_crtc *vc4_find_crtc_for_encoder(struct kunit *test, return NULL; } -struct vc4_dummy_plane { - struct vc4_plane plane; -}; - -struct vc4_dummy_plane *vc4_dummy_plane(struct kunit *test, - struct drm_device *drm, - enum drm_plane_type type); +struct drm_plane *vc4_dummy_plane(struct kunit *test, struct drm_device *drm, + enum drm_plane_type type); struct vc4_dummy_crtc { struct vc4_crtc crtc; diff --git a/drivers/gpu/drm/vc4/tests/vc4_mock_plane.c b/drivers/gpu/drm/vc4/tests/vc4_mock_plane.c index 62b18f5f41db..973f5f929097 100644 --- a/drivers/gpu/drm/vc4/tests/vc4_mock_plane.c +++ b/drivers/gpu/drm/vc4/tests/vc4_mock_plane.c @@ -22,15 +22,12 @@ static const uint32_t vc4_dummy_plane_formats[] = { DRM_FORMAT_XRGB8888, }; -struct vc4_dummy_plane *vc4_dummy_plane(struct kunit *test, - struct drm_device *drm, - enum drm_plane_type type) +struct drm_plane *vc4_dummy_plane(struct kunit *test, struct drm_device *drm, + enum drm_plane_type type) { - struct vc4_dummy_plane *dummy_plane; struct drm_plane *plane; - dummy_plane = drmm_universal_plane_alloc(drm, - struct vc4_dummy_plane, plane.base, + plane = __drmm_universal_plane_alloc(drm, sizeof(struct drm_plane), 0, 0, &vc4_dummy_plane_funcs, vc4_dummy_plane_formats, @@ -38,10 +35,9 @@ struct vc4_dummy_plane *vc4_dummy_plane(struct kunit *test, NULL, DRM_PLANE_TYPE_PRIMARY, NULL); - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, dummy_plane); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, plane); - plane = &dummy_plane->plane.base; drm_plane_helper_add(plane, &vc4_dummy_plane_helper_funcs); - return dummy_plane; + return plane; }