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