b61c0e156ba401b3422abe945f4cda0563297c84
[openwrt/staging/blogic.git] /
1 From 37f9fb928b7f32f4ee16cbd494aa15f146b20a65 Mon Sep 17 00:00:00 2001
2 From: Maxime Ripard <maxime@cerno.tech>
3 Date: Thu, 21 Apr 2022 17:29:02 +0200
4 Subject: [PATCH] drm/vc4: drv: Skip BO Backend Initialization on
5 BCM2711
6
7 On the BCM2711, we currently call the vc4_bo_cache_init() and
8 vc4_gem_init() functions. These functions initialize the BO and GEM
9 backends.
10
11 However, this code was initially created to accomodate the requirements
12 of the GPU on the older SoCs, while the BCM2711 has a separate driver
13 for it. So let's just skip these calls when we're on a newer hardware.
14
15 Signed-off-by: Maxime Ripard <maxime@cerno.tech>
16 ---
17 drivers/gpu/drm/vc4/vc4_drv.c | 18 +++++++++++-------
18 1 file changed, 11 insertions(+), 7 deletions(-)
19
20 --- a/drivers/gpu/drm/vc4/vc4_drv.c
21 +++ b/drivers/gpu/drm/vc4/vc4_drv.c
22 @@ -325,19 +325,23 @@ static int vc4_drm_bind(struct device *d
23 platform_set_drvdata(pdev, drm);
24 INIT_LIST_HEAD(&vc4->debugfs_list);
25
26 - mutex_init(&vc4->bin_bo_lock);
27 + if (!is_vc5) {
28 + mutex_init(&vc4->bin_bo_lock);
29
30 - ret = vc4_bo_cache_init(drm);
31 - if (ret)
32 - return ret;
33 + ret = vc4_bo_cache_init(drm);
34 + if (ret)
35 + return ret;
36 + }
37
38 ret = drmm_mode_config_init(drm);
39 if (ret)
40 return ret;
41
42 - ret = vc4_gem_init(drm);
43 - if (ret)
44 - return ret;
45 + if (!is_vc5) {
46 + ret = vc4_gem_init(drm);
47 + if (ret)
48 + return ret;
49 + }
50
51 node = of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-firmware");
52 if (node) {