Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp565669lqi; Thu, 7 Mar 2024 05:47:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUL5ea/3Mo+lcPFJx8VREP0eIsaa5Y+Sa4Zw2aRr3ebeNPnzYlFZR5vtccV5oI4rR3xXB2qS0cD3hxSZ94EFqLUJX9dRQ/4QnZmv2aN/g== X-Google-Smtp-Source: AGHT+IGZ1M7Stl73ERbcjnjWujQSsHpwf+35P+aXe+tDlExm8Yd9j2k24lTk3kTHn/LW2Ae02ZcQ X-Received: by 2002:a17:906:27d3:b0:a45:96ab:28af with SMTP id k19-20020a17090627d300b00a4596ab28afmr1195479ejc.10.1709819272706; Thu, 07 Mar 2024 05:47:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709819272; cv=pass; d=google.com; s=arc-20160816; b=df5ThBEyP6nXLdjWtqYWBo97lmfCl5kPqmT42e5blHH50A+n5vALLLMEKHpi9u1t56 xgTb2yzCZc1jsVKfFJmLzMS7qvLISJ7RqoK+AUS2g4k7Wl3y83iwGyj7b/NxS6cHg0hd T2J7HYH/bMyA9rTHFzLnu/mtTJlRX1NI8sESpeT4b519UclIXzpH91guq57kYrvl+tBt 9qG+9AGyYUfkwKhzW3p/fVyelkJTyYwA+Mp8Hr6QoT8wFmme0eA7Cpu+bmMEcrmR2jgu +4nXf/+1keKfUHFa0bmWGnzx3x58Nqs0bz08EwO6Ay1gN0R6zx/yUYALhdMA4rY89J3a mEJw== 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=XnoAJ1eCzv0uZxTL1/eylsuf2rhz4aNd+Mc5/vO/Ffs=; fh=iba4iMK4A01E5lANNVtvxLKnMNbV0ktetP2NDCs9MH8=; b=qhus3/cUsCZ8i5fTWcbonOPhLYbXd4DE5ONV1WJrwuvrcex5cILxYxh0znNZKp1WQO AeOT3FffkJZG7FPQaM7uzWILkR74jNFciiV0von4u85eMBM3m3bHXbfpBNluAJIE82OL /sWYWPnTioASlcA8At3besk0yAwk1PVeHtkcedZ7Cv88WFSnLzD8X/4mXzwLcl/9Hnzo LRNwn2a/DjOuzZJwBEMWGgM0bz5ElKLlxF0moftzlHyFZoyO6pCbhXjpk0n6yGrBZIOw 8QDNlRbsZuXNHUFSEMKxSKwPxruTGpyMg3gyjw/s2pdPVpPG6wI8dAm+tdYxfHHDhWJg Hp4w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SuWdIUap; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-95648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95648-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 kt23-20020a170906aad700b00a446b5a5228si6066222ejb.623.2024.03.07.05.47.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 05:47:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95648-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=SuWdIUap; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-95648-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95648-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 701501F20EE4 for ; Thu, 7 Mar 2024 13:47:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BEB3012E1EF; Thu, 7 Mar 2024 13:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SuWdIUap" 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 C7D8C12EBDD; Thu, 7 Mar 2024 13:40:03 +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=1709818803; cv=none; b=WiLkupnC+2qXG/Qj1BlRArQLB4yyciP797mqaCG+/+9SVXEKARJ0tVSQarTfrH3+Mv+dcAGLWlzEMAq7QR/dGVdwUDIX7h+OuyPNOw4BX2lchaRpuzK+wfi6C/kY4Y/avizceC9tUL5f9fd2KbFjREu6jwiUhw8eUdOtvV4hTcM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709818803; c=relaxed/simple; bh=xekVGAfWfJvLfOV1ebNOPUR3oLtTkCap7YpzVZIPKAQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=URVVsc/+9zoPfE9y9jtqnRkWLE7FJRXABx/dA4wejbwGjsJis7vhFmKIhMYVuKBuHuaHPzThOrhU/6WgyIkM1jXFfIeDtMKZTIVVsh1rHUdCE9B/shfb8m5LvbN6+a5fhYt8vMu3kzmEw+1cTfg4KevFdI1Bxr9ejaB81Os+fp8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SuWdIUap; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5416EC433A6; Thu, 7 Mar 2024 13:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709818803; bh=xekVGAfWfJvLfOV1ebNOPUR3oLtTkCap7YpzVZIPKAQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=SuWdIUapJVkkow0eGOlH+l2/Pa0UI51/2OJWUQjY237Opj4Uw1TJfyIjn9q2Fn6jn Cvrnlt72FiN4NRUOdb8jfhTFfUPQ9JK01h5a1ob/840HwjFy2M2002k37EIVTNFIyg Qzjjq2d3kPMznjdvlEL7+sT+Kb+8IXPXWI4i3vBkrxhvDFX07KQS8VdFuRjVnwhBCA ch5Yy1gY6STdh21oVF73q2sgtJsNiwr4xMDaPLqEHolJW9nqhpzdA0OnJSssuvoJXN f21jiEQpgRT0uS7TOmTZDwpO/Ol0PkyDViWbMmx6QFWijorHFZYzPS5/nHKewSffHD 0EtnNFL+HFBpA== From: Maxime Ripard Date: Thu, 07 Mar 2024 14:38:51 +0100 Subject: [PATCH v8 24/27] 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: <20240307-kms-hdmi-connector-state-v8-24-ef6a6f31964b@kernel.org> References: <20240307-kms-hdmi-connector-state-v8-0-ef6a6f31964b@kernel.org> In-Reply-To: <20240307-kms-hdmi-connector-state-v8-0-ef6a6f31964b@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=xekVGAfWfJvLfOV1ebNOPUR3oLtTkCap7YpzVZIPKAQ=; b=owGbwMvMwCX2+D1vfrpE4FHG02pJDKkvD2cxJapNSD7aWnjhgt/e39+lPnUvbyx6EbQqIGTGg qB/XPM+dJSyMIhxMciKKbLECJsviTs163UnG988mDmsTCBDGLg4BWAiD58yMhzz+L3ecpKyi+YV 7pPp06sN7x1VUBfRZONuqHJXzPJ/9JCRYYfEQ6ttH9Q4Fv5V/hZ3Wr8mfdUBMaV39uWvP/1/tOr zfx4A 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.43.2