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 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>,
	"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 1/2] fbdev: Split frame buffer support in FB and FB_CORE symbols
Date: Fri, 30 Jun 2023 11:01:27 +0200	[thread overview]
Message-ID: <723a3c51-7997-46d0-9262-68f33384a9e7@app.fastmail.com> (raw)
In-Reply-To: <20230629225113.297512-2-javierm@redhat.com>

On Fri, Jun 30, 2023, at 00:51, 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 CONFIG_FB_CORE option that could be enabled just
> to have the core support needed for CONFIG_DRM_FBDEV_EMULATION, allowing
> CONFIG_FB to be disabled (and automatically disabling all fbdev drivers).
>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> ---

This looks really nice!

I tried to do something like this a few years ago, but failed as
I did too much at once by attempting to cut out msot of the fb core
support that is not actually used by DRM at the same time.

Doing just the Kconfig bits as you do here is probably better
anyway, cutting out unneeded bits into separate modules or #ifdef
sections can come later.

> @@ -59,7 +71,7 @@ config FIRMWARE_EDID
> 
>  config FB_DEVICE
>  	bool "Provide legacy /dev/fb* device"
> -	depends on FB
> +	depends on FB_CORE
>  	default y
>  	help
>  	  Say Y here if you want the legacy /dev/fb* device file and

I don't see this symbol in linux-next yet, what tree are you using
as a base?

> @@ -69,13 +81,13 @@ config FB_DEVICE
> 
>  config FB_DDC
>  	tristate
> -	depends on FB
> +	depends on FB_CORE
>  	select I2C_ALGOBIT
>  	select I2C

This seems to only be used by actual fbdev drivers, so maybe
don't change the dependency here.

> @@ -162,22 +174,22 @@ endchoice
> 
>  config FB_SYS_FOPS
>  	tristate
> -	depends on FB
> +	depends on FB_CORE

Same for this one

>  config FB_HECUBA
>  	tristate
> -	depends on FB
> +	depends on FB_CORE
>  	depends on FB_DEFERRED_IO
> 
>  config FB_SVGALIB
>  	tristate
> -	depends on FB
> +	depends on FB_CORE
>  	help
>  	  Common utility functions useful to fbdev drivers of VGA-based
>  	  cards.
>  config FB_MACMODES
>  	tristate
> -	depends on FB
> +	depends on FB_CORE
> 

These three seem to actually be part of fbdev drivers rather
than the core, and it may be best to move them into
drviers/video/fbdev/ as standalone modules. That would be a
separate patch of course.
 
>  config FB_BACKLIGHT
>  	tristate
> -	depends on FB
> +	depends on FB_CORE
>  	select BACKLIGHT_CLASS_DEVICE

Separating this one from FB_CORE would help avoid circular dependencies,
this one keeps causing issues.

> @@ -1,22 +1,22 @@
>  # SPDX-License-Identifier: GPL-2.0
>  obj-$(CONFIG_FB_NOTIFY)           += fb_notify.o
> -obj-$(CONFIG_FB)                  += fb.o
> -fb-y                              := fb_backlight.o \
> +obj-$(CONFIG_FB_CORE)             += fb_core.o
> +fb_core-y                         := fb_backlight.o \
>                                       fb_info.o \
>                                       fbmem.o fbmon.o fbcmap.o \
>                                       modedb.o fbcvt.o fb_cmdline.o 

I would not bother renaming the module itself here, that
might cause problems if anything relies on loading the
module by name or a named module parameter.

      Arnd

  reply	other threads:[~2023-06-30  9:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 22:51 [PATCH 0/2] Allow disabling all native fbdev drivers and only keeping DRM emulation Javier Martinez Canillas
2023-06-29 22:51 ` [PATCH 1/2] fbdev: Split frame buffer support in FB and FB_CORE symbols Javier Martinez Canillas
2023-06-30  9:01   ` Arnd Bergmann [this message]
2023-06-30 10:51     ` Javier Martinez Canillas
2023-06-30 11:34       ` Arnd Bergmann
2023-06-30 12:22         ` Javier Martinez Canillas
2023-06-29 22:51 ` [PATCH 2/2] drm: Make fbdev emulation depend on FB_CORE instead of FB Javier Martinez Canillas
2023-06-30 11:19 ` [PATCH 0/2] Allow disabling all native fbdev drivers and only keeping DRM emulation Thomas Zimmermann
2023-06-30 12:33   ` Javier Martinez Canillas
2023-06-30 12:41     ` Thomas Zimmermann
2023-07-01 19:49   ` Arnd Bergmann
2023-06-30 17:31 ` Andy Shevchenko
2023-06-30 17:38   ` Javier Martinez Canillas
2023-06-30 17:42     ` Andy Shevchenko
2023-06-30 17:43       ` Andy Shevchenko
2023-06-30 20:29       ` Javier Martinez Canillas
2023-07-03  8:21         ` Andy Shevchenko
2023-07-03  8:43           ` 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=723a3c51-7997-46d0-9262-68f33384a9e7@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bp@alien8.de \
    --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=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

all inboxes | Powered by JetHome®