Skip to content

Commit ec7cc3f

Browse files
arndbmlankhorst
authored andcommitted
fbdev: simplefb: fix Kconfig dependencies
Configurations with both CONFIG_FB_SIMPLE=y and CONFIG_DRM_SIMPLEDRM=m are allowed by Kconfig because the 'depends on !DRM_SIMPLEDRM' dependency does not disallow FB_SIMPLE as long as SIMPLEDRM is not built-in. This can however result in a build failure when cfb_fillrect() etc are then also in loadable modules: x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x1f8): undefined reference to `cfb_fillrect' x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x200): undefined reference to `cfb_copyarea' x86_64-linux-ld: drivers/video/fbdev/simplefb.o:(.rodata+0x208): undefined reference to `cfb_imageblit' To work around this, change FB_SIMPLE to be a 'tristate' symbol, which still allows both to be =m together, but not one of them to be =y if the other one is =m. If a distro kernel picks this configuration, it can be determined by local policy which of the two modules gets loaded. The 'of_chosen' export is needed as this is the first loadable module referencing it. Alternatively, the Kconfig dependency could be changed to 'depends on DRM_SIMPLEDRM=n', which would forbid the configuration with both drivers. Fixes: 11e8f5f ("drm: Add simpledrm driver") Acked-by: Rob Herring <[email protected]> # for drivers/of/ Link: https://lore.kernel.org/all/[email protected]/ Signed-off-by: Arnd Bergmann <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Daniel Vetter <[email protected]> # fbdev support Cc: Maxime Ripard <[email protected]> Cc: Liam Girdwood <[email protected]> Cc: Mark Brown <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Javier Martinez Canillas <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Geert Uytterhoeven <[email protected]> Cc: Peter Collingbourne <[email protected]> Cc: Andy Shevchenko <[email protected]> Cc: [email protected] Cc: [email protected] Cc: <[email protected]> # v5.14+ Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maarten Lankhorst <[email protected]>
1 parent 413e8d0 commit ec7cc3f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/of/base.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ LIST_HEAD(aliases_lookup);
3636
struct device_node *of_root;
3737
EXPORT_SYMBOL(of_root);
3838
struct device_node *of_chosen;
39+
EXPORT_SYMBOL(of_chosen);
3940
struct device_node *of_aliases;
4041
struct device_node *of_stdout;
4142
static const char *of_stdout_options;

drivers/video/fbdev/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,8 +2193,9 @@ config FB_HYPERV
21932193
This framebuffer driver supports Microsoft Hyper-V Synthetic Video.
21942194

21952195
config FB_SIMPLE
2196-
bool "Simple framebuffer support"
2197-
depends on (FB = y) && !DRM_SIMPLEDRM
2196+
tristate "Simple framebuffer support"
2197+
depends on FB
2198+
depends on !DRM_SIMPLEDRM
21982199
select FB_CFB_FILLRECT
21992200
select FB_CFB_COPYAREA
22002201
select FB_CFB_IMAGEBLIT

0 commit comments

Comments
 (0)