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
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.
10 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
12 drivers/gpu/drm/drm_fb_helper.c | 11 ++++++++++-
13 1 file changed, 10 insertions(+), 1 deletion(-)
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;
20 unsigned int width, height;
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);
30 + id = of_alias_get_highest_id("drm_fb");
32 + fb_set_lowest_dynamic_fb(id + 1);
34 + id = of_alias_get_id(dev->dev->of_node, "drm_fb");
37 + info->custom_fb_num = true;
39 ret = register_framebuffer(info);