Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2854457lqt; Tue, 23 Apr 2024 03:52:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU3GCYiKVNIfBlVNG7qoufd4Uh0lh8oNbAwlnRDQlKdX2BQiKNFfSO8lBXYqifKBwdLYuR8AxBMTLVEkhbz1u9D6/kbbPjG0+N5iW0t5Q== X-Google-Smtp-Source: AGHT+IEOAbj5Uzkvp/ig8pfqiM5POulVCeiMW/JH4sbQyn1AzgT4mwszTHjIaSbhULa405uex44T X-Received: by 2002:a17:907:7dac:b0:a56:2555:1235 with SMTP id oz44-20020a1709077dac00b00a5625551235mr3584710ejc.45.1713869578088; Tue, 23 Apr 2024 03:52:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713869578; cv=pass; d=google.com; s=arc-20160816; b=cFM72NunBK6OYo1gdW148VFq3LLwh7KN3lj3M2jhouB9/AMFD4WVD2XdO+h+CnYOsv JRSdul7NjiXZlzulGv0FPM02n994CtN1zNVfAAgCb0pCblXV7v7hSrUltW/K2989d49v 6CsFNuk8xnijzOtT/GevD4eYOFUlk/ZLVix3FmlWMmqjBie7Iz8iIrs+PpQVCMEkQ9lg lwvHnhOBAxOcosfhHgl7xpCLZBx+lLULcve4YyLCIOJ8BeymXBzrZkzT+dyK41DlTeCH d8Mzv8fKThhgAYLooW9hEe7o4vqY4hzzAEMHrsMbdETnkuIWEO5rIsVAEnb/B5vi3x2m FlZA== 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=shsv5Fp7elncfZHZOnDPZNd3/25mCMga8gEXwL5a6yo=; fh=r/IQdUhM+izf1DBtdeXsvTqzb+iJn8kGsFxm/9n8OYo=; b=Fc0+CqT+7jJF8vf7q3v7OR7J/qmZ77h58id9X13tUJ6KYTkwsEpK0xK+iJctJmG50/ DRXXZAl2vvi3dWZ8nkSdaVbOqFpT2bf52Afj/SrqIuuZ3pzE6fm6pSiUCDggFHumR/oo Vg7BwyFvdk5Vi9+KAgKFphR7FYE0Zq6/0IhKOHhitjQsHY/9EAgdXSj2OLBv2VO7+dT/ YZxgNfaY3yqwsVJnPveDqkTU7YFYdQtB/pk/2qrWxszyHYHzcXzG2UwpfZ9BQkCA1WJx 19dZsUJzoumEYSjRCKa49elOH6i/tgCYEJHbb2adxqmfZSwKc7g3OAaubQ2AYrmbP/yL E6tw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uSLSZDWe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-154918-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154918-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 i20-20020a170906091400b00a555faeeb4asi7005237ejd.856.2024.04.23.03.52.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 03:52:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-154918-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=uSLSZDWe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-154918-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-154918-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 CCF9A1F222B1 for ; Tue, 23 Apr 2024 10:52:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A857113BAD7; Tue, 23 Apr 2024 10:46:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uSLSZDWe" 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 C490483CCB; Tue, 23 Apr 2024 10:46:58 +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=1713869218; cv=none; b=hqcGptWtb9XrbB26nKvE76EcbdRFwH2lZSrHwgGRDP3l+d4+mU2uCr4gz4LITDInRRqxVnGlCD4yi419/9WY4ZDFppVe/vcPO6qZ1S3VcRh2XmtOtkgptJbUVqt8e5OxddEmEr/45qlBGkYdH5Q3qiyGt9c/oaJjT2u06adZYyg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713869218; c=relaxed/simple; bh=KphIRHuqty8drrA3+chsi6Ea8a803tyozTB0Wym2y9I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U+GJ213VDy5o3ZBm1Z4w908t6QkFxKJ+TqLyFg8kdX2NrhGzsh3Wb2CgC99e8tSZLMH7t+HtBya8QhG2Bp/2Uc5CoGvocNTbTzQDPoy60YDhVgL9ZOInU7YhcNufBuHFhxHeOjotNTes7++e30SiBfEP9Oq+PUNRztRjG2mfvJk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uSLSZDWe; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54343C116B1; Tue, 23 Apr 2024 10:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713869218; bh=KphIRHuqty8drrA3+chsi6Ea8a803tyozTB0Wym2y9I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=uSLSZDWeqoVYQZRIf13KHsHL9WJDhZjR8otc+SdH9lDwgy04za0AXfLAex/JEducn RJGmJxpoEms4CAThh/+StrPci7+DqixxsPdLy55mx358NC9t8w+vrfmJQWz0y1xbkD vReN6CF2BDjJsRBsP7j3DA30hRfUPv9ee2NuezJoiYQ+kbevRvpDb9RKWaje/JrA+L buLrA4wFNdzoYu3LHw2O6ODOTEDYYF7JNzTaISN3SCRM6w53cK1nLs3wJaj32v/UcZ 4lE3aY5RJ1c2CGmIrBPuck1yLJfF2Tpv7rnthoxWjSGW2al72XpRC4bWKFpcTcuZzJ 8tYnnSpfxbisg== From: Maxime Ripard Date: Tue, 23 Apr 2024 12:45:55 +0200 Subject: [PATCH v12 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: <20240423-kms-hdmi-connector-state-v12-26-3338e4c0b189@kernel.org> References: <20240423-kms-hdmi-connector-state-v12-0-3338e4c0b189@kernel.org> In-Reply-To: <20240423-kms-hdmi-connector-state-v12-0-3338e4c0b189@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=KphIRHuqty8drrA3+chsi6Ea8a803tyozTB0Wym2y9I=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDGnqE8P+vHWY2vbrqOefl+f+xZyb42KR9tguVNF2xakcq akJgjm7O6ayMAhzMsiKKbI8kQk7vbx9cZWD/cofMHNYmUCGMHBxCsBE1mQw1mmtXlt7ZsuBPJGD bZGcamXtJsvmHupd/uZbvvssmxnMtr3CzE4lZnkcIrJOxuXTmaJDGWtl5Tou8+gZWrqe3Lg0xDE 6xPWax69aX9uCDyylJ3srJzgUWNTw3u/lOuN/UeFcQIhjDwA= 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.44.0