Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp536939lqh; Tue, 7 May 2024 07:00:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVsvYzfGur5332f6/3DMlU8C2THXoev74jltMG5b5iYP/suRR4xiSYAjwZgIdl4svmBz01E2tz9Xx5mnqjyiBWO8gqWHGRlUsNPe/xR4w== X-Google-Smtp-Source: AGHT+IG8tQ9TUJydqGah/KZ1HNiUKtqKx7MHU7Itf0kuwx9LMo40t1m0L01Ucn1qBKUeEB5a2JaP X-Received: by 2002:a05:6358:2996:b0:186:3fea:b69f with SMTP id j22-20020a056358299600b001863feab69fmr23063213rwc.21.1715090415425; Tue, 07 May 2024 07:00:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715090415; cv=pass; d=google.com; s=arc-20160816; b=TkYQtsCWIQmfJTMyVfDrtQYfJHWz0EhaywWd0ydP29OT9ypP1dY+zqQbgdA4cRGbUv dXDsF6ekUjijwesxVhFuxr5t5n39VeIE1BSKs+F66KgTkKVdmtEJKRJ/2mMrDh+wqDRa mBBlYrvoao4axVo+srJifL7pFm4eaQM40d4xrjKQYrAGVyc3N0I/qtERWennaBVdL8+H uSqd9ZfI2Qv07Jvdz9S6vWp04XoW9fAH5Hyxou32QQgUAVy2NWPo3t5EM7gSKF6V9g5L z4JBwD3Iv2KXGCueEGgJg+08FyPm3IvUlzYh302gvhFktsLYNsDbW8ZhNmRx6ZmQsx1V wkLA== 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=PGy55AZycCQRvwVMYPhC6ty+hFxbuuf6b9dssePNzyvmVMe5a46ZgfZptQkNl1bLK1 oa+WfaKXgXdB6+EwHheKc/Kx8L8QUqpOOu86qaMbq6grKiTLVeF0e/tsHvuh+LXEqqpd N1MsjkVTcNB7R3vSsCauO5/+gFD5BNXJP9PaoQzAuhOwTDIdUxQsIyRSRGy76CsRlt/Q aZT27z6Ap2fic9rc2bbqxQkWkqlaQ8FMd8CfzJeyFML6nh1G9FQbBnfzoIKIt21993hm EbIJz68W9BjOzFvfbhzPK4NvvoyR/POlsuUtHND9+RTBvdA2CV5ZIn2wSZMihWfZFn0i /A0w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C7Skz4oW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171415-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q11-20020a656a8b000000b006052356fd7csi10239965pgu.79.2024.05.07.07.00.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:00:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C7Skz4oW; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-171415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171415-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 04C0FB2AC5E for ; Tue, 7 May 2024 13:31:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E272E19DF5B; Tue, 7 May 2024 13:18:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C7Skz4oW" 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 E9F7A173324; Tue, 7 May 2024 13:18:54 +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=1715087935; cv=none; b=XOsFMd+UXViDiS+NwJ3D8FZnRlJzIi48Dvoa9GM/KooV5l93tX64vGjKouhMkL6GwTPoRV1NlamJszqB8OxkqMg+yX0VDaPyJM2akrXY6sNWNvIgsUd4YPP13YCv+ERqrkb4fzfTOzf852pzYh1f6k6eF9vaGO90BEVz+2z/tHo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087935; c=relaxed/simple; bh=mxuD7pT2tlDQ0zzNZkqWfj36MC0sF3/2cyZNsO+d0UQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JyOuRFnE3+shmyFNoraP+TR62oYdBfAO2XPO4SLjbJjJU96cubVN8GhtdcRfOKSrQ9Ojf1Mxt9kLGG0YHs9qsxaBU3jRokFI0SQ7BtT6vu35XfD66a+9ymfDkpvtDTVsEs4OrPiAvf9OisGas3/xTRaElbrS7L+rgQ5tpTYhhb0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C7Skz4oW; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C5FBC2BBFC; Tue, 7 May 2024 13:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715087934; bh=mxuD7pT2tlDQ0zzNZkqWfj36MC0sF3/2cyZNsO+d0UQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=C7Skz4oWmm7q6tad0dSn62GOGTbg4unvNaJjxDdz2rBEV0wH/V9C3VBGle8OxXlPc YT3dFbDZD5V7apomiZ6JcF5leIFhtV9mBvsA0NsAxcudAMLiZTECdquX4KN08vnTlP oXJTWOpBnHYqozJ9Zy7xDdS0oJWZntx61iMZE2FnzGmghE53K3DSBGSHgtZnrYbZGk LSDL1Cddos0jHHTEoiI8LhwdZhS9TmdfPW0fR64mXxgKQHzQsKo5JWFo5fifdEx1Jp fGoOfAC8JKaYulPoDHt496GVfhbnosb++zyo4yulmV+6Fuj5hdSGTukjna8svQUdxb RdIGJW6PFTJlA== From: Maxime Ripard Date: Tue, 07 May 2024 15:17:43 +0200 Subject: [PATCH v13 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: <20240507-kms-hdmi-connector-state-v13-25-8fafc5efe8be@kernel.org> References: <20240507-kms-hdmi-connector-state-v13-0-8fafc5efe8be@kernel.org> In-Reply-To: <20240507-kms-hdmi-connector-state-v13-0-8fafc5efe8be@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=owGbwMvMwCmsHn9OcpHtvjLG02pJDGlWmp+8lCerRpqt2XrQgSm2xTAv+R1zrm7Q9rA/i199N 99a4zCpYyoLgzAng6yYIssTmbDTy9sXVznYr/wBM4eVCWQIAxenAEwkcCZjnT3Xx03q7yPWG9+w KbrE9nzF/jkpiZpNj8T2H3zItPjE39oo0zM8ksUvdt5891vjQveh94wNc2YJJfnJnUu7tfNJsqd oLOudumW5F7SD1WYwyLPPM3JXqtrb37IzUqic/cH6rsU1mpwA 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