difos/target/linux/bcm27xx/patches-6.12/950-0393-drm-fb-helper-Look-up-preferred-fbdev-node-number-fr.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

46 lines
1.5 KiB
Diff

From 193412691cb0f4758623d27dd03dee9dd4f9fecf Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Mon, 9 Oct 2023 16:34:36 +0100
Subject: [PATCH] drm/fb-helper: Look up preferred fbdev node number from DT
For situations where there are multiple DRM cards in a system,
add a query of DT for "drm_fb" designations for cards to set
their preferred /dev/fbN designation.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drm/fb_helper: Change query for FB designation from drm_fb to drm-fb
Fixes: 1216ea56c2e3 ("drm/fb-helper: Look up preferred fbdev node number from DT")
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
drivers/gpu/drm/drm_fb_helper.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -1803,7 +1803,7 @@ __drm_fb_helper_initial_config_and_unloc
struct drm_device *dev = fb_helper->dev;
struct fb_info *info;
unsigned int width, height;
- int ret;
+ int ret, id;
width = dev->mode_config.max_width;
height = dev->mode_config.max_height;
@@ -1831,6 +1831,15 @@ __drm_fb_helper_initial_config_and_unloc
* register the fbdev emulation instance in kernel_fb_helper_list. */
mutex_unlock(&fb_helper->lock);
+ id = of_alias_get_highest_id("drm-fb");
+ if (id >= 0)
+ fb_set_lowest_dynamic_fb(id + 1);
+
+ id = of_alias_get_id(dev->dev->of_node, "drm-fb");
+ if (id >= 0) {
+ info->node = id;
+ info->custom_fb_num = true;
+ }
ret = register_framebuffer(info);
if (ret < 0)
return ret;