Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2982698lqo; Tue, 21 May 2024 03:21:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUWzsAkKlWJ/1uDYWySGOndKSNt4/mo8azXtSvf5BrmaMl3TTBNjqvUe2KSozZcGjwZx4UxjJ1jlrIBOD1pH/DAJH8nt0fOnxRRse4sKw== X-Google-Smtp-Source: AGHT+IGQPvfJfUAkKrveFro6tyC8nfoU44+zl0mtGEI2KIowzh8PKAORZvWl9A2fIs0+eiHYvsDF X-Received: by 2002:a25:b11d:0:b0:de5:8467:35da with SMTP id 3f1490d57ef6-dee4f1b79fcmr30919793276.2.1716286913314; Tue, 21 May 2024 03:21:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716286913; cv=pass; d=google.com; s=arc-20160816; b=Dos++Px8gJ1+S9V7DolgS0yqkxYtxtVKzsccFbDTkkVkJCPtNNUvL9vbTArS82sEvl Q6sKtpblU7367dUDoDNsdKOQQ0xrXabjVy/D0yBUCp5ZO1JVLpWkQ9y0xqTKevIQ8bYS AGsYDOsw3Qex20HcYi5fKFRL2WiCHeye/AcPRBq3S6JWmEwFI3eENVN6LBUhoYXCKXcB bRjgjjw5H/8QBopRiyNf0dUNzS+CIx6uWcfmA2y1EgAR3hE10e+R3TDTb6+XSyDrpcd2 Mjg3OET/iFjG8H4EebIS1bGvGjbeSaPvGNtiAhCMu8gvdByKeslSjDcPzI8UgIieySVA CO6A== 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=m/1GXg7Y6ObL9qsLNf/VV5nvrG9m/5YHQd+E61fj1sg=; fh=r/IQdUhM+izf1DBtdeXsvTqzb+iJn8kGsFxm/9n8OYo=; b=KQ/V5ak1GAMnt1WkO028GUU5O+9OLEaTOU8GrQPsljYKohJPKszkxGI/9Z2pDP59px JisnWZAiXtfaKTgOZl3y+PE9+NaXicm3pzm1POlFKG0PNVHwFGt6bAlgQad7tD+PEr55 xpe97oASiz0ebIZ2ZQXtn0ZPNSshYK31WVbcbQ3mUiOKzAMOKF87ypyn7KxeegJt2BYq mqM68KqpQNNX75C9YKlVD8psoCsimhq1zP7kR+QZPCV5mJJ+h09frOUxiAztoKn6WUzC 9Klm1/L6UIFA1xx+m8p7XIsWUTT0JnB0sRPLvoEV81BPoEU2jzTIpSlq1wqg0hNLGNSN wMzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sSxHTiRB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184786-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184786-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ab75c526absi8478796d6.176.2024.05.21.03.21.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 03:21:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184786-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sSxHTiRB; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184786-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184786-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 01F5D1C218D7 for ; Tue, 21 May 2024 10:21:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1178082D90; Tue, 21 May 2024 10:15:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sSxHTiRB" 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 14DB257308; Tue, 21 May 2024 10:15:02 +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=1716286502; cv=none; b=Bz3SEqy3ovO3WGD8/FeOGedhkKTIoWIr9UfhUpAxAPtHyh+b6LyxqnavAKDe6mvODsnmQG6NO0BSmh14Df/+IEAVl9eJ7et3Apk6Wv+XQM8LH5cnA425+EY006Uim3lpSuTLNswOOsYOHa0tq9/UeB70NqxHTiwN4KlaX5RwzR4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716286502; c=relaxed/simple; bh=mxuD7pT2tlDQ0zzNZkqWfj36MC0sF3/2cyZNsO+d0UQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rmOQ205bktjz86zWV0xrXYtR7/eK7KFsm4dkpWdRFeg5IZUjW44O27yjzRIUfLnC7VSTXPGK+kTJGsAprZPbBzejeCDA6B/TrUP0TceDwI6swZASM2rvdwkVSzBhyAsppyLGU+uR6jo+YpW8dgy+BtsnAGmCsaR3KbQGd80noUY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sSxHTiRB; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8ED4BC32782; Tue, 21 May 2024 10:15:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716286501; bh=mxuD7pT2tlDQ0zzNZkqWfj36MC0sF3/2cyZNsO+d0UQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=sSxHTiRBj2YO4HQyHB3XYyTth7bNk3Ihk854oFX9r83sg/mlVPXmCtE99JOtTnLcz N0GB7MnStXa+AzPvasoat4gXZ6E8l5/wxHq50l4VOwfyEYgVSDK1MNJgkHixoW850h zN124zuqdZLpcfnishpzCBX+Rwz8n4UNlZ8avdjT/NWuoeEDwb6C1o0WUnVrxkv6IM 5zAlepBsi6phkU8TYtCmRlU/vHopLQLJHd4/0Sjzy5vcspUbOJRL9mgHVedAfGyk0O JbpZn8CoblM/7UEgXQe0emvVgFHM86wSJeSjzkHNkpl/CknH268Zr6/Ke1Vt/ZtNHU xE5TV2ESXgRFg== From: Maxime Ripard Date: Tue, 21 May 2024 12:13:58 +0200 Subject: [PATCH v14 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: <20240521-kms-hdmi-connector-state-v14-25-51950db4fedb@kernel.org> References: <20240521-kms-hdmi-connector-state-v14-0-51950db4fedb@kernel.org> In-Reply-To: <20240521-kms-hdmi-connector-state-v14-0-51950db4fedb@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=3744; i=mripard@kernel.org; h=from:subject:message-id; bh=mxuD7pT2tlDQ0zzNZkqWfj36MC0sF3/2cyZNsO+d0UQ=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDGk+xbfTf4Tev/TKoXZe7by8MImYnTOdvfh7e67+Vt4W/ lYk62JCx1QWBmFOBlkxRZYnMmGnl7cvrnKwX/kDZg4rE8gQBi5OAZjIaRfGhtcn5t4ITDzPyWuo /KLgwf4F6w4UsBq/Odn0vMlg67x3ksde6cfd/8rx9XvYN3nPZTFBOoz12YZat/pF/vfqsBb2b/7 bezGl4FJsn55lt8qR/0fTOy8oTL50bHXmpceTDy7YlTXdLfoNAA== 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.45.0