1 From 7aa9189e401ddee705d851fe30b59d81cc71ebac Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Mon, 2 May 2022 15:28:05 +0200
4 Subject: [PATCH] drm/vc4: crtc: Don't call into BO Handling on Async
7 The BCM2711 doesn't have a v3d GPU so we don't want to call into its BO
8 management code. Let's create an asynchronous page-flip handler for the
9 BCM2711 that just calls into the common code.
11 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
13 drivers/gpu/drm/vc4/vc4_crtc.c | 21 ++++++++++++++++++---
14 1 file changed, 18 insertions(+), 3 deletions(-)
16 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
17 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
18 @@ -983,16 +983,31 @@ static int vc4_async_page_flip(struct dr
22 +static int vc5_async_page_flip(struct drm_crtc *crtc,
23 + struct drm_framebuffer *fb,
24 + struct drm_pending_vblank_event *event,
27 + return vc4_async_page_flip_common(crtc, fb, event, flags);
30 int vc4_page_flip(struct drm_crtc *crtc,
31 struct drm_framebuffer *fb,
32 struct drm_pending_vblank_event *event,
34 struct drm_modeset_acquire_ctx *ctx)
36 - if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
37 - return vc4_async_page_flip(crtc, fb, event, flags);
39 + if (flags & DRM_MODE_PAGE_FLIP_ASYNC) {
40 + struct drm_device *dev = crtc->dev;
41 + struct vc4_dev *vc4 = to_vc4_dev(dev);
44 + return vc5_async_page_flip(crtc, fb, event, flags);
46 + return vc4_async_page_flip(crtc, fb, event, flags);
48 return drm_atomic_helper_page_flip(crtc, fb, event, flags, ctx);
52 struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc)