Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3425978lqp; Tue, 26 Mar 2024 08:51:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX9YFbHnQplbqg/Y+8amU71q4D6zWvpm4RXxfchY37VseMfMvTiR9YTdq/buFckXJnj36yE8Pk/zi5o0Xau4Y+bKt9cSrNILHriAZi1Sw== X-Google-Smtp-Source: AGHT+IHY2jNjfGvUuszszU9fIBKQn/BJ1n5R0kFSUsJMAhJEuS6OSn1tGzJjQtYYP4PrX71x+jrV X-Received: by 2002:a2e:2285:0:b0:2d2:ea18:bcc7 with SMTP id i127-20020a2e2285000000b002d2ea18bcc7mr44354lji.23.1711468296525; Tue, 26 Mar 2024 08:51:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711468296; cv=pass; d=google.com; s=arc-20160816; b=Cl004glOHPZ76ZGhh3IuNR/kaOABd6NhA4xS/vZQJXuTbHzu0d1HNj3c9ipOs35JQA bQ1KK3f/wgb48Ph5HBfhwkknKHeG4I4Q3r444CWvwOgxstNC9AFw6TEYeOn0az2frsdk 0MBKW3H0m2Kvbaxey8IoeIdFZ76YjMkvDPJSvJxQM6c65+7U0uade50bZO3muWu9O6xZ bNb/um30kAYOgfxA84pgScmQjMhlqfWkCNPcOL4HIUvsX7WxC6FsPPk48PE09otihTIJ 26p6rTJ6biV6Lk1VLZViJYVbVUjI5cygwnsIS+EFFJnIMoBPISdw7nQq2itzCea8KSHm WzmA== 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=vrE48+d4DepnRcLBPRB4defiodHtgWWsJX9Cj9nY40k=; fh=iba4iMK4A01E5lANNVtvxLKnMNbV0ktetP2NDCs9MH8=; b=IerDwy94uT6pDFZXDsNUbFi7bnybbGMfXeGOyqDZlEK5r82lqyNT016ysqrjTUHWBO FGLUrVevPHX2UDpR72jAEgZ9V8/WWRt5rOTjvaDARy/QwiffMxIf5lfftZC5U1KJJcVx U1HvzJFpo+S1jXhYcqDqvw+o15ugNU1VRPqc8651HqBMfsA+nQcbnq96nWC7rB1LoL1L xNA38gxrq4sDJOZYvvWg3Oic2tbpcnyQaXiDoGBTiHYokBDfAgQq0mQgtwLVh2YZo/Ps ePuNpEgUjRV2yhRZTYFU8QUl4mkBGtzGlXHaUFWc1aYkEAi3CZ1l+4sHisP+49sect0c VigQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ieQ1/zKp"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-119384-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119384-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id uz5-20020a170907118500b00a4aaa3b800csi1567965ejb.949.2024.03.26.08.51.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 08:51:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119384-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ieQ1/zKp"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-119384-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119384-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 B561D1F66F23 for ; Tue, 26 Mar 2024 15:51:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C59A1422BD; Tue, 26 Mar 2024 15:41:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ieQ1/zKp" 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 64BD51422A8; Tue, 26 Mar 2024 15:41:42 +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=1711467702; cv=none; b=TFx9870SfFNQ/jx8No4iJmaJsQJYM1NhjW7KGqQufDf1rh9/t08FGOe1ytR7gqPdP/8zesWIEvXst4gTLps1gVDMnon/Kl0TTE8YrFS5tQjX7HsvO/bPTf+cyDLEVJTM3AiSqyu1zI8zCBl+8P87A5Iu4yZ6iIpiF+IXE0SAW7Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711467702; c=relaxed/simple; bh=qqwR8snTsMUCSQhySgzRiBMtDFLDW3r/mg7D3AAdcrw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UQ6HDp1vmZpz/sFvm1NpfRBiG3ddVkAPQZ/WugL3lEIByxgdfrxRMpY3Yd3PFTYFxIE1s7IBAKHlH5zJP7ghi9qHf0nVawl5j8RUo3eV/3z1SmolnV4ESKB3TZBXesvBdHj+JBtJnKFvXhJA2XEvrEZD1n+nS7XzTX8Hs2r9I/0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ieQ1/zKp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1C3BC43609; Tue, 26 Mar 2024 15:41:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711467702; bh=qqwR8snTsMUCSQhySgzRiBMtDFLDW3r/mg7D3AAdcrw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=ieQ1/zKpaN6WK1eamMR1I54zoQeFCmErVGOryySxLoxhH0PKCtTC0c9iLYcYcpCj6 zQaBpK0xkkcrD45bcNm+ssOEpgX30xmjfoSPhc04aOF1jOgx1mtTIYas/YgEMFmbWG YykuOzEAleVenk6ezmLxTwsk3lSpMJOUCZjhsAYnPwVqPDFULv4gmShW70yNDf2Pnm A+P7sv9ng3UhJFTlXKCmpwXN5Qy8ZXJJ8tzA/gKm0NVzSgsoSWaXz7tQF3Nn882/JW FfYdwYN+DtEFsWftJwE68/DlxidFPt5kdi5zcCYWlR9pZRtWuSrjd0FIGIBWk1FwEL yQyx04ggXfX9Q== From: Maxime Ripard Date: Tue, 26 Mar 2024 16:40:29 +0100 Subject: [PATCH v11 25/28] drm/vc4: tests: Remove vc4_dummy_plane structure 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: <20240326-kms-hdmi-connector-state-v11-25-c5680ffcf261@kernel.org> References: <20240326-kms-hdmi-connector-state-v11-0-c5680ffcf261@kernel.org> In-Reply-To: <20240326-kms-hdmi-connector-state-v11-0-c5680ffcf261@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?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.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3744; i=mripard@kernel.org; h=from:subject:message-id; bh=qqwR8snTsMUCSQhySgzRiBMtDFLDW3r/mg7D3AAdcrw=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDGlMb7JWCB+P/3ZnN9PptYIyge9X+Gwv+xH1dbZvxAeXr Qv1PnS/7JjKwiDMySArpsjyRCbs9PL2xVUO9it/wMxhZQIZwsDFKQATmSvC2HCXecr6incBi9Pm CmyZUvE8Kv+vzxbfOr8HzuHppz6Vl6ye0b90VuZLV8ONNU3yxz1OqTHWSp1q4poxbYY+L9sh8zk /jG2Cl5u0Te05Xvhmktr9K+KGLxdM/Zrb9ns2Y15uwEmXc9mbAA== X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D The vc4_dummy_plane structure was introduced as a mean to add mock-specific fields. However, we never really used it and it's still strictly equivalent to vc4_plane (which is in the same situation vs drm_plane), so we can simply remove the vc4_dummy_plane structure and make the mock code cleaner. Reviewed-by: MaĆ­ra Canal 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 becb3dbaa548..0731a7d85d7a 100644 --- a/drivers/gpu/drm/vc4/tests/vc4_mock.c +++ b/drivers/gpu/drm/vc4/tests/vc4_mock.c @@ -107,20 +107,18 @@ 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); crtc = &dummy_crtc->crtc.base; for (i = 0; i < pipe->noutputs; i++) { 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 @@ -19,17 +19,12 @@ struct drm_crtc *vc4_find_crtc_for_encoder(struct kunit *test, return crtc; 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 @@ -20,28 +20,24 @@ static const struct drm_plane_funcs vc4_dummy_plane_funcs = { 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, ARRAY_SIZE(vc4_dummy_plane_formats), 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; } -- 2.44.0