Skip to content

Commit d1d5101

Browse files
author
Thomas Zimmermann
committed
drm/fb-helper: Set framebuffer for vga-switcheroo clients
Set the framebuffer info for drivers that support VGA switcheroo. Only affects the amdgpu and nouveau drivers, which use VGA switcheroo and generic fbdev emulation. For other drivers, this does nothing. This fixes a potential regression in the console code. Both, amdgpu and nouveau, invoked vga_switcheroo_client_fb_set() from their internal fbdev code. But the call got lost when the drivers switched to the generic emulation. Fixes: 087451f ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.") Fixes: 4a16dd9 ("drm/nouveau/kms: switch to drm fbdev helpers") Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: Karol Herbst <[email protected]> Cc: Lyude Paul <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Javier Martinez Canillas <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Evan Quan <[email protected]> Cc: Christian König <[email protected]> Cc: Alex Deucher <[email protected]> Cc: Hawking Zhang <[email protected]> Cc: Likun Gao <[email protected]> Cc: "Christian König" <[email protected]> Cc: Stanley Yang <[email protected]> Cc: "Tianci.Yin" <[email protected]> Cc: Xiaojian Du <[email protected]> Cc: Andrey Grodzovsky <[email protected]> Cc: YiPeng Chai <[email protected]> Cc: Somalapuram Amaranath <[email protected]> Cc: Bokun Zhang <[email protected]> Cc: Guchun Chen <[email protected]> Cc: Hamza Mahfooz <[email protected]> Cc: Aurabindo Pillai <[email protected]> Cc: Mario Limonciello <[email protected]> Cc: Solomon Chiu <[email protected]> Cc: Kai-Heng Feng <[email protected]> Cc: Felix Kuehling <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: "Marek Olšák" <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Hans de Goede <[email protected]> Cc: "Ville Syrjälä" <[email protected]> Cc: [email protected] Cc: [email protected] Cc: <[email protected]> # v5.17+ Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a273e95 commit d1d5101

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
3131

3232
#include <linux/console.h>
33+
#include <linux/pci.h>
3334
#include <linux/sysrq.h>
35+
#include <linux/vga_switcheroo.h>
3436

3537
#include <drm/drm_atomic.h>
3638
#include <drm/drm_drv.h>
@@ -1909,6 +1911,11 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
19091911
return ret;
19101912

19111913
strcpy(fb_helper->fb->comm, "[fbcon]");
1914+
1915+
/* Set the fb info for vgaswitcheroo clients. Does nothing otherwise. */
1916+
if (dev_is_pci(dev->dev))
1917+
vga_switcheroo_client_fb_set(to_pci_dev(dev->dev), fb_helper->info);
1918+
19121919
return 0;
19131920
}
19141921

0 commit comments

Comments
 (0)