linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>
Cc: "Arnd Bergmann" <arnd@kernel.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Dave Airlie" <airlied@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Helge Deller" <deller@gmx.de>,
	"Christian König" <christian.koenig@amd.com>,
	"Dave Airlie" <airlied@redhat.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Jim Cromie" <jim.cromie@gmail.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Arthur Grillo" <arthurgrillo@riseup.net>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	linux-fbdev@vger.kernel.org
Subject: Re: [PATCH] drm: fix up fbdev Kconfig defaults
Date: Tue, 12 Sep 2023 05:04:37 -0400	[thread overview]
Message-ID: <9a7c7cb2-fa9e-4bf9-891b-ccd754d1fc25@app.fastmail.com> (raw)
In-Reply-To: <CAMuHMdW63WjidvAovqRz70bMgbLt4cSkOP1xSh7sEcqdwR3tOw@mail.gmail.com>

On Tue, Sep 12, 2023, at 04:18, Geert Uytterhoeven wrote:
> On Tue, Sep 12, 2023 at 10:11 AM Thomas Zimmermann <tzimmermann@suse.de> wrote:
>> Am 12.09.23 um 09:14 schrieb Geert Uytterhoeven:
>> [...]
>> >> --- a/drivers/gpu/drm/Kconfig
>> >> +++ b/drivers/gpu/drm/Kconfig
>> >> @@ -135,7 +135,7 @@ config DRM_FBDEV_EMULATION
>> >>          bool "Enable legacy fbdev support for your modesetting driver"
>> >>          depends on DRM
>> >>          select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
>> >> -       default y
>> >> +       default FB
>> >
>> > While this is true for existing configs, it is no longer true in general,
>> > as DRM_FBDEV_EMULATION is no longer related to FB.
>>
>> Would it make sense to make FRAMEBUFFER_CONSOLE an independent option
>> and have FBDEV_EMULATION depend on it? Something like this:
>>
>> FRAMEBUFFER_CONSOLE
>>         depends on DRM || FB
>>         select FB_CORE
>>
>> FBDEV_EMULATION
>>         depends on DRM
>>         depends on FRAMEBUFFER_CONSOLE
>>         default y
>
> Oops, now you can no longer have FBDEV_EMULATION without
> FRAMEBUFFER_CONSOLE, which is useful to be able to enable
> FB_DEVICE...
>
> And what's the point (if DRM is enabled) of having FB_CORE with
> FBDEV_EMULATION disabled?

I think we technically have the choice between selecting FB_CORE from
all the providers (FB and DRM_FBDEV_EMULATION) or from all the
consumers (FRAMEBUFFER_CONSOLE, FB_DEVICE and LOGO). We chose
to have it the former way at the moment, and I think what Thomas
suggests here is to change it to the latter.

The downside of the current approach is that you can have
pointless configuration with

CONFIG_FB=y
CONFIG_DRM=y
CONFIG_DRM_FBDEV_EMULATION=y
CONFIG_FRAMEBUFFER_CONSOLE=n
CONFIG_FB_DEVICE=n
CONFIG_LOGO=n

where the fb_core module gets initialized but it is impossible
for anything to draw on it.

Another option we have would be to try to separate the Kconfig
options for DRM and FB a little further, in anticipation of
reducing the amount of shared code in the long run (a lot of
FB code is built but never used when enabling console on
DRM).

So adding a new

config DRM_CONSOLE
     bool "enable console on DRM devices"
     depends on DRM
     depends on VT_CONSOLE
     depends on !UML
     select FB_CORE
     select FRAMEBUFFER_CONSOLE_CORE # new helper sym
     select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY
     default y

would give us a path to minimize the shared code
further, allowing the console code to be reused as
before, but without having to pull in the code that
is now only needed for FB_DEVICE. In this scenario,
we'd still have CONFIG_DRM_FBDEV_EMULATION like

config DRM_FBDEV_EMULATION
      bool "full emulation of fbdev layer for DRM"
      select FB_CORE
      select FB_DEVICE
      default FB # if enabled already, use it

but only use that if we actually want FB_DEVICE.

      Arnd

  parent reply	other threads:[~2023-09-12  9:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 20:52 [PATCH] drm: fix up fbdev Kconfig defaults Arnd Bergmann
2023-09-12  5:00 ` Javier Martinez Canillas
2023-09-12  7:14 ` Geert Uytterhoeven
2023-09-12  7:39   ` Arnd Bergmann
2023-09-12  7:50     ` Geert Uytterhoeven
2023-09-12  7:55     ` Javier Martinez Canillas
2023-09-12  7:48   ` Javier Martinez Canillas
2023-09-12  7:53     ` Geert Uytterhoeven
2023-09-12  7:58     ` Arnd Bergmann
2023-09-12  8:11   ` Thomas Zimmermann
2023-09-12  8:18     ` Geert Uytterhoeven
2023-09-12  8:38       ` Thomas Zimmermann
2023-09-12  8:50         ` Geert Uytterhoeven
2023-09-12  9:04       ` Arnd Bergmann [this message]
2023-09-18  7:25 ` Thomas Zimmermann
2023-09-18  8:57   ` 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=9a7c7cb2-fa9e-4bf9-891b-ccd754d1fc25@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=airlied@gmail.com \
    --cc=airlied@redhat.com \
    --cc=arnd@kernel.org \
    --cc=arthurgrillo@riseup.net \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=javierm@redhat.com \
    --cc=jim.cromie@gmail.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=sam@ravnborg.org \
    --cc=tzimmermann@suse.de \
    /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;
as well as URLs for NNTP newsgroup(s).