dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: Daniel Vetter <daniel.vetter@intel.com>,
	David Airlie <airlied@linux.ie>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Maxime Ripard <maxime@cerno.tech>
Cc: Melissa Wen <mwen@igalia.com>, dri-devel@lists.freedesktop.org
Subject: [PATCH 07/14] drm/vc4: plane: Register a different drm_plane_helper_funcs on BCM2711
Date: Tue,  3 May 2022 14:13:34 +0200	[thread overview]
Message-ID: <20220503121341.983842-8-maxime@cerno.tech> (raw)
In-Reply-To: <20220503121341.983842-1-maxime@cerno.tech>

On the BCM2711, our current definition of drm_plane_helper_funcs uses
the custom vc4_prepare_fb() and vc4_cleanup_fb().

Those functions rely on the buffer allocation path that was relying on
the GPU, and is no longer relevant.

Let's create another drm_plane_helper_funcs structure that we will
register on the BCM2711.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/vc4/vc4_plane.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index ba7359516d75..1e866dc00ac3 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -1389,6 +1389,13 @@ static const struct drm_plane_helper_funcs vc4_plane_helper_funcs = {
 	.atomic_async_update = vc4_plane_atomic_async_update,
 };
 
+static const struct drm_plane_helper_funcs vc5_plane_helper_funcs = {
+	.atomic_check = vc4_plane_atomic_check,
+	.atomic_update = vc4_plane_atomic_update,
+	.atomic_async_check = vc4_plane_atomic_async_check,
+	.atomic_async_update = vc4_plane_atomic_async_update,
+};
+
 static bool vc4_format_mod_supported(struct drm_plane *plane,
 				     uint32_t format,
 				     uint64_t modifier)
@@ -1493,7 +1500,10 @@ struct drm_plane *vc4_plane_init(struct drm_device *dev,
 	if (ret)
 		return ERR_PTR(ret);
 
-	drm_plane_helper_add(plane, &vc4_plane_helper_funcs);
+	if (vc4->is_vc5)
+		drm_plane_helper_add(plane, &vc5_plane_helper_funcs);
+	else
+		drm_plane_helper_add(plane, &vc4_plane_helper_funcs);
 
 	drm_plane_create_alpha_property(plane);
 	drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0,
-- 
2.35.1


  parent reply	other threads:[~2022-05-03 12:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 12:13 [PATCH 00/14] drm/vc4: Properly separate v3d on BCM2711, and fix frame ordering Maxime Ripard
2022-05-03 12:13 ` [PATCH 01/14] drm/vc4: plane: Prevent async update if we don't have a dlist Maxime Ripard
2022-05-03 12:13 ` [PATCH 02/14] drm/vc4: Consolidate Hardware Revision Check Maxime Ripard
2022-05-03 12:13 ` [PATCH 03/14] drm/vc4: bo: Rename vc4_dumb_create Maxime Ripard
2022-05-03 12:13 ` [PATCH 04/14] drm/vc4: bo: Split out Dumb buffers fixup Maxime Ripard
2022-05-03 12:13 ` [PATCH 05/14] drm/vc4: drv: Register a different driver on BCM2711 Maxime Ripard
2022-05-09 16:37   ` Melissa Wen
2022-05-03 12:13 ` [PATCH 06/14] drm/vc4: kms: Register a different drm_mode_config_funcs " Maxime Ripard
2022-05-03 12:13 ` Maxime Ripard [this message]
2022-05-03 12:13 ` [PATCH 08/14] drm/vc4: drv: Skip BO Backend Initialization " Maxime Ripard
2022-05-03 12:13 ` [PATCH 09/14] drm/vc4: crtc: Use an union to store the page flip callback Maxime Ripard
2022-05-03 12:13 ` [PATCH 10/14] drm/vc4: crtc: Move the BO handling out of common page-flip callback Maxime Ripard
2022-05-03 12:13 ` [PATCH 11/14] drm/vc4: crtc: Move the BO Handling out of Common Page-Flip Handler Maxime Ripard
2022-05-03 12:13 ` [PATCH 12/14] drm/vc4: crtc: Don't call into BO Handling on Async Page-Flips on BCM2711 Maxime Ripard
2022-05-03 12:13 ` [PATCH 13/14] drm/vc4: crtc: Fix out of order frames during asynchronous page flips Maxime Ripard
2022-05-03 13:53   ` kernel test robot
2022-05-09 17:10   ` Melissa Wen
2022-05-09 17:15     ` Melissa Wen
2022-05-12 10:44       ` Melissa Wen
2022-06-06 13:59         ` Maxime Ripard
2022-06-08 11:24           ` Melissa Wen
2022-05-03 12:13 ` [PATCH 14/14] drm/vc4: Warn if some v3d code is run on BCM2711 Maxime Ripard
2022-05-09 16:52   ` Melissa Wen
2022-05-31  9:40     ` Maxime Ripard
2022-05-09 18:26 ` [PATCH 00/14] drm/vc4: Properly separate v3d on BCM2711, and fix frame ordering Melissa Wen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220503121341.983842-8-maxime@cerno.tech \
    --to=maxime@cerno.tech \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mwen@igalia.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox