f1eafeefe759e6ae6b1514e7ecb7fd8f394f02aa
[openwrt/staging/xback.git] /
1 From 35f881ca59d6f8bbf49889a792d3539d9bab6ed2 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 0679/1085] drm/fb-helper: Look up preferred fbdev node number
5 from DT
6
7 For situations where there are multiple DRM cards in a system,
8 add a query of DT for "drm_fb" designations for cards to set
9 their preferred /dev/fbN designation.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 ---
13 drivers/gpu/drm/drm_fb_helper.c | 11 ++++++++++-
14 1 file changed, 10 insertions(+), 1 deletion(-)
15
16 --- a/drivers/gpu/drm/drm_fb_helper.c
17 +++ b/drivers/gpu/drm/drm_fb_helper.c
18 @@ -1840,7 +1840,7 @@ __drm_fb_helper_initial_config_and_unloc
19 struct drm_device *dev = fb_helper->dev;
20 struct fb_info *info;
21 unsigned int width, height;
22 - int ret;
23 + int ret, id;
24
25 width = dev->mode_config.max_width;
26 height = dev->mode_config.max_height;
27 @@ -1868,6 +1868,15 @@ __drm_fb_helper_initial_config_and_unloc
28 * register the fbdev emulation instance in kernel_fb_helper_list. */
29 mutex_unlock(&fb_helper->lock);
30
31 + id = of_alias_get_highest_id("drm_fb");
32 + if (id >= 0)
33 + fb_set_lowest_dynamic_fb(id + 1);
34 +
35 + id = of_alias_get_id(dev->dev->of_node, "drm_fb");
36 + if (id >= 0) {
37 + info->node = id;
38 + info->custom_fb_num = true;
39 + }
40 ret = register_framebuffer(info);
41 if (ret < 0)
42 return ret;