Skip to content

Commit dfc8f67

Browse files
6by9popcornmix
authored andcommitted
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 <[email protected]> drm/fb_helper: Change query for FB designation from drm_fb to drm-fb Fixes: 1216ea5 ("drm/fb-helper: Look up preferred fbdev node number from DT") Signed-off-by: Dave Stevenson <[email protected]>
1 parent ee76d85 commit dfc8f67

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1820,7 +1820,7 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper)
18201820
struct drm_device *dev = fb_helper->dev;
18211821
struct fb_info *info;
18221822
unsigned int width, height;
1823-
int ret;
1823+
int ret, id;
18241824

18251825
width = dev->mode_config.max_width;
18261826
height = dev->mode_config.max_height;
@@ -1848,6 +1848,15 @@ __drm_fb_helper_initial_config_and_unlock(struct drm_fb_helper *fb_helper)
18481848
* register the fbdev emulation instance in kernel_fb_helper_list. */
18491849
mutex_unlock(&fb_helper->lock);
18501850

1851+
id = of_alias_get_highest_id("drm-fb");
1852+
if (id >= 0)
1853+
fb_set_lowest_dynamic_fb(id + 1);
1854+
1855+
id = of_alias_get_id(dev->dev->of_node, "drm-fb");
1856+
if (id >= 0) {
1857+
info->node = id;
1858+
info->custom_fb_num = true;
1859+
}
18511860
ret = register_framebuffer(info);
18521861
if (ret < 0)
18531862
return ret;

0 commit comments

Comments
 (0)