bcm27xx: update 6.1 patches to latest version
[openwrt/openwrt.git] / target / linux / bcm27xx / patches-6.1 / 950-1036-drm-fb-helper-Look-up-preferred-fbdev-node-number-fr.patch
1 From 1216ea56c2e30aee4975b4dcce79ebd199afaf8f Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Mon, 9 Oct 2023 16:34:36 +0100
4 Subject: [PATCH] drm/fb-helper: Look up preferred fbdev node number from DT
5
6 For situations where there are multiple DRM cards in a system,
7 add a query of DT for "drm_fb" designations for cards to set
8 their preferred /dev/fbN designation.
9
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
11 ---
12 drivers/gpu/drm/drm_fb_helper.c | 11 ++++++++++-
13 1 file changed, 10 insertions(+), 1 deletion(-)
14
15 --- a/drivers/gpu/drm/drm_fb_helper.c
16 +++ b/drivers/gpu/drm/drm_fb_helper.c
17 @@ -1932,7 +1932,7 @@ __drm_fb_helper_initial_config_and_unloc
18 struct drm_device *dev = fb_helper->dev;
19 struct fb_info *info;
20 unsigned int width, height;
21 - int ret;
22 + int ret, id;
23
24 width = dev->mode_config.max_width;
25 height = dev->mode_config.max_height;
26 @@ -1967,6 +1967,15 @@ __drm_fb_helper_initial_config_and_unloc
27 * register the fbdev emulation instance in kernel_fb_helper_list. */
28 mutex_unlock(&fb_helper->lock);
29
30 + id = of_alias_get_highest_id("drm_fb");
31 + if (id >= 0)
32 + fb_set_lowest_dynamic_fb(id + 1);
33 +
34 + id = of_alias_get_id(dev->dev->of_node, "drm_fb");
35 + if (id >= 0) {
36 + info->node = id;
37 + info->custom_fb_num = true;
38 + }
39 ret = register_framebuffer(info);
40 if (ret < 0)
41 return ret;