96941cb20f93b9a81349fe83efeb32ecc14758b9
[openwrt/staging/blocktrron.git] /
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
5 Page-Flips on BCM2711
6
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.
10
11 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
12 ---
13 drivers/gpu/drm/vc4/vc4_crtc.c | 21 ++++++++++++++++++---
14 1 file changed, 18 insertions(+), 3 deletions(-)
15
16 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
17 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
18 @@ -999,16 +999,31 @@ static int vc4_async_page_flip(struct dr
19 return 0;
20 }
21
22 +static int vc5_async_page_flip(struct drm_crtc *crtc,
23 + struct drm_framebuffer *fb,
24 + struct drm_pending_vblank_event *event,
25 + uint32_t flags)
26 +{
27 + return vc4_async_page_flip_common(crtc, fb, event, flags);
28 +}
29 +
30 int vc4_page_flip(struct drm_crtc *crtc,
31 struct drm_framebuffer *fb,
32 struct drm_pending_vblank_event *event,
33 uint32_t flags,
34 struct drm_modeset_acquire_ctx *ctx)
35 {
36 - if (flags & DRM_MODE_PAGE_FLIP_ASYNC)
37 - return vc4_async_page_flip(crtc, fb, event, flags);
38 - else
39 + if (flags & DRM_MODE_PAGE_FLIP_ASYNC) {
40 + struct drm_device *dev = crtc->dev;
41 + struct vc4_dev *vc4 = to_vc4_dev(dev);
42 +
43 + if (vc4->is_vc5)
44 + return vc5_async_page_flip(crtc, fb, event, flags);
45 + else
46 + return vc4_async_page_flip(crtc, fb, event, flags);
47 + } else {
48 return drm_atomic_helper_page_flip(crtc, fb, event, flags, ctx);
49 + }
50 }
51
52 struct drm_crtc_state *vc4_crtc_duplicate_state(struct drm_crtc *crtc)