mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Javier Martinez Canillas" <javierm@redhat.com>,
	linux-kernel@vger.kernel.org
Cc: "Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Daniel Thompson" <daniel.thompson@linaro.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"H. Peter Anvin" <hpa@zytor.com>, "Helge Deller" <deller@gmx.de>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Jingoo Han" <jingoohan1@gmail.com>, "Lee Jones" <lee@kernel.org>,
	"Randy Dunlap" <rdunlap@infradead.org>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	x86@kernel.org
Subject: Re: [PATCH v5 3/4] fbdev: Split frame buffer support in FB and FB_CORE symbols
Date: Tue, 18 Jul 2023 21:27:32 +0200	[thread overview]
Message-ID: <91486e8b-49ca-4a8a-8dd6-e9a2c6ed63ee@app.fastmail.com> (raw)
In-Reply-To: <20230714171642.91185-4-javierm@redhat.com>

On Fri, Jul 14, 2023, at 19:16, Javier Martinez Canillas wrote:
> Currently the CONFIG_FB option has to be enabled even if no legacy fbdev
> drivers are needed (e.g: only to have support for framebuffer consoles).
>
> The DRM subsystem has a fbdev emulation layer, but depends on CONFIG_FB
> and so it can only be enabled if that dependency is enabled as well.
>
> That means fbdev drivers have to be explicitly disabled if users want to
> enable CONFIG_FB, only to use fbcon and/or the DRM fbdev emulation layer.
>
> This patch introduces a non-visible CONFIG_FB_CORE symbol that could be
> enabled just to have core support needed for CONFIG_DRM_FBDEV_EMULATION,
> allowing CONFIG_FB to be disabled (and automatically disabling all the
> fbdev drivers).
>
> Nothing from fb_backlight.o and fbmon.o is used by the DRM fbdev emulation
> layer so these two objects can be compiled out when CONFIG_FB is disabled.

I gave this a spin in my randconfig build setup and found one small
mistake:

> diff --git a/drivers/video/fbdev/core/Makefile 
> b/drivers/video/fbdev/core/Makefile
> index 9150bafd9e89..2cd213716c12 100644
> --- a/drivers/video/fbdev/core/Makefile
> +++ b/drivers/video/fbdev/core/Makefile
> @@ -1,10 +1,10 @@
>  # SPDX-License-Identifier: GPL-2.0
>  obj-$(CONFIG_FB_NOTIFY)           += fb_notify.o
> -obj-$(CONFIG_FB)                  += fb.o
> -fb-y                              := fb_backlight.o \
> -                                     fb_info.o \
> -                                     fbmem.o fbmon.o fbcmap.o \
> +obj-$(CONFIG_FB_CORE)             += fb.o
> +fb-y                              := fb_info.o \
> +                                     fbmem.o fbcmap.o \
>                                       modedb.o fbcvt.o fb_cmdline.o 
> fb_io_fops.o
> +fb-$(CONFIG_FB)                   += fb_backlight.o fbmon.o

With CONFIG_FB_CORE=y and CONFIG_FB=m, Kbuild does not include
the fb_backlight.o and fbmon.o files in fb.ko because they are not
set to =y, causing link failures for fbdev drivers later:

ERROR: modpost: "of_get_fb_videomode" [drivers/video/fbdev/clps711x-fb.ko] undefined!
ERROR: modpost: "fb_videomode_from_videomode" [drivers/video/fbdev/atmel_lcdfb.ko] undefined!
ERROR: modpost: "of_get_fb_videomode" [drivers/video/fbdev/imxfb.ko] undefined!
ERROR: modpost: "fb_destroy_modedb" [drivers/video/fbdev/udlfb.ko] undefined!
ERROR: modpost: "fb_edid_to_monspecs" [drivers/video/fbdev/udlfb.ko] undefined!
ERROR: modpost: "fb_destroy_modedb" [drivers/video/fbdev/smscufx.ko] undefined!
ERROR: modpost: "fb_edid_to_monspecs" [drivers/video/fbdev/smscufx.ko] undefined!
ERROR: modpost: "fb_destroy_modedb" [drivers/video/fbdev/uvesafb.ko] undefined!
ERROR: modpost: "fb_validate_mode" [drivers/video/fbdev/uvesafb.ko] undefined!
ERROR: modpost: "fb_get_mode" [drivers/video/fbdev/uvesafb.ko] undefined!


Folding this fixup into the patch makes it work:

diff --git a/drivers/video/fbdev/core/Makefile b/drivers/video/fbdev/core/Makefile
index 2cd213716c12f..84ddc5d308b58 100644
--- a/drivers/video/fbdev/core/Makefile
+++ b/drivers/video/fbdev/core/Makefile
@@ -4,7 +4,9 @@ obj-$(CONFIG_FB_CORE)             += fb.o
 fb-y                              := fb_info.o \
                                      fbmem.o fbcmap.o \
                                      modedb.o fbcvt.o fb_cmdline.o fb_io_fops.o
-fb-$(CONFIG_FB)                   += fb_backlight.o fbmon.o
+ifdef CONFIG_FB
+fb-y		                   += fb_backlight.o fbmon.o
+endif
 fb-$(CONFIG_FB_DEFERRED_IO)       += fb_defio.o
 fb-$(CONFIG_FB_DEVICE)            += fb_chrdev.o \
                                      fb_procfs.o \


     Arnd

  reply	other threads:[~2023-07-18 19:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-14 17:16 [PATCH v5 0/4] Allow disabling all native fbdev drivers and only keeping DRM emulation Javier Martinez Canillas
2023-07-14 17:16 ` [PATCH v5 1/4] video: Add auxiliary display drivers to Graphics support menu Javier Martinez Canillas
2023-07-14 17:16 ` [PATCH v5 2/4] fbdev: Move core fbdev symbols to a separate Kconfig file Javier Martinez Canillas
2023-07-18 19:36   ` Arnd Bergmann
2023-07-19  7:59     ` Javier Martinez Canillas
2023-07-14 17:16 ` [PATCH v5 3/4] fbdev: Split frame buffer support in FB and FB_CORE symbols Javier Martinez Canillas
2023-07-18 19:27   ` Arnd Bergmann [this message]
2023-07-19  7:57     ` Javier Martinez Canillas
2023-07-14 17:16 ` [PATCH v5 4/4] drm: Make FB_CORE to be selected if DRM fbdev emulation is enabled Javier Martinez Canillas
2023-07-18 19:37 ` [PATCH v5 0/4] Allow disabling all native fbdev drivers and only keeping DRM emulation Arnd Bergmann
2023-07-19  8:00   ` Javier Martinez Canillas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91486e8b-49ca-4a8a-8dd6-e9a2c6ed63ee@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=daniel.thompson@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=dave.hansen@linux.intel.com \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=javierm@redhat.com \
    --cc=jingoohan1@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    --cc=tzimmermann@suse.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome