From patchwork Thu Dec 7 15:49:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 175254 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4876576vqy; Thu, 7 Dec 2023 07:54:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IGeUOFtIT5z+HytjX1/gkinS763uJ7jknSM4PLV4948BR4Aox/NAjqvGOFtnoCNqSZlXZKT X-Received: by 2002:a17:902:bc84:b0:1d0:5218:a7e9 with SMTP id bb4-20020a170902bc8400b001d05218a7e9mr2388392plb.53.1701964447124; Thu, 07 Dec 2023 07:54:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701964447; cv=none; d=google.com; s=arc-20160816; b=QVjsc2UNRQ4gtGMkI7k2QknE17fwUonkxyLvvH+FhzQrNJEARaLrbDefEZrmasbCz6 ho/H1dU83gHXdfooEgCjg8K7lCTwYgTr03Lpsx3cJh2Zae10poP7CJS5bWlCekDsYtFD JVjvFINbi2/NwHoStm8jZZPcBRI07QMu9hR9hBoh1SQPshhW0pS/TYbn0mviSX4G5Oh+ haEV0NMXoZwejTtyPGomMSsiXrBiHRGytN8p1yFjpbz3zv+Z5K5SL4e88GzE8mMW8F2q je7YBhLD2DsqEv2ID2VESGON6pVp/OjExL2liTpkxcupINEMoPecAvx9AoQOKRa+E/uk 5I1g== 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=mv+2ikShuMN+dY92lfWCcT9vJiP0+AsCoyPJXat97JQ=; fh=e6/uyeFf2k7v8JUtB6fPyaAS5iN3eSA1hjtg35V2Rzw=; b=bgNsvLKQufZ18IpGRUhy2fL5lAJvaoSXqkTePUz2oRGjoAJc2/m4kpZHCwQ+N95WZh MRSeBmpRVOosvDQLJTSxrAQMOTvOD45qaxMHcR0kDUjPssypsANUIedMBrJ4FKzXbguU p/wHMXUne1b0yiF2sC7khAyLkoisaaEqBpL6qIrUWDdRVonRxgz4qOYh6vqP9usyr8RH qK6Vvmumzftth2DYTxITgiMqiYxkuPhWRbUGEscRNi3u1SJn0/V+dvYBYyvc7X+EJ6ly V+cubt5DysJPifsweU56op1T3lzTLh1qjRfK+2d9xxUkLLY+0Cfd2Ts/amJm6nYI0nV2 cahQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="oKJ/17OH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id i9-20020a170902eb4900b001d0b273f9f2si1292865pli.127.2023.12.07.07.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 07:54:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="oKJ/17OH"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 74053819D9E6; Thu, 7 Dec 2023 07:53:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443603AbjLGPvM (ORCPT + 99 others); Thu, 7 Dec 2023 10:51:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443597AbjLGPuw (ORCPT ); Thu, 7 Dec 2023 10:50:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A9AA2113 for ; Thu, 7 Dec 2023 07:50:29 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82DA0C43391; Thu, 7 Dec 2023 15:50:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701964228; bh=Yu+T4WCmV/LVjhCEdfQlyO9Lu7gGgQ3FuKEzvGbxZvM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=oKJ/17OH7rkdjG5BcoE3FN0c4+7ifO9mEQA/PIWcbyRUy8EtPGChywtg2Rrv4J7px NphVWN2KA9yNaEF8H/GbBarDvSm5XW8F62KhbWFVJmR2yDym31OdBELHKE76WyaVTl p/bd80ybmzk91L7QMAxzaLxY4/28VmRt2VBWkfmj+X371RZ3b0Bxa4qY14IrJkWIpi TN5Dtb1hLPd5EgKJbyKCxkfvkluQjL5m4izltLOdtsilS9IgUpTTZIAZGhH2PFLSnw UtLlZuh++epwCphjoaSAtCE0PJ33AcvQh5gFbb34bLLYDKXCJtQFjCrmYy3I6C7aM0 doj3/hwVcZXqA== From: Maxime Ripard Date: Thu, 07 Dec 2023 16:49:43 +0100 Subject: [PATCH v5 20/44] drm/vc4: tests: Remove vc4_dummy_plane structure MIME-Version: 1.0 Message-Id: <20231207-kms-hdmi-connector-state-v5-20-6538e19d634d@kernel.org> References: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org> In-Reply-To: <20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@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=Yu+T4WCmV/LVjhCEdfQlyO9Lu7gGgQ3FuKEzvGbxZvM=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKmFL1vXTxf+qn/jzY6W1WeO37hUOI+hXfzl8yPfnr/47 KQifGbN5I5SFgYxLgZZMUWWGGHzJXGnZr3uZOObBzOHlQlkCAMXpwBM5HQow/+KxRM2vq5vktI6 tM2vk6/5yEXfD4vmrM04qvZuK/MyfwdNRoYFKqETIjljJb6V5Etkvjblb0qRKOn7k9LkyfFxrfw he34A 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 pete.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 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 07:53:44 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784639071737536512 X-GMAIL-MSGID: 1784639071737536512 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; }