From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C166EB64DC for ; Tue, 18 Jul 2023 19:28:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229879AbjGRT2H (ORCPT ); Tue, 18 Jul 2023 15:28:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229843AbjGRT2H (ORCPT ); Tue, 18 Jul 2023 15:28:07 -0400 Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DEE5198D; Tue, 18 Jul 2023 12:27:59 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailnew.nyi.internal (Postfix) with ESMTP id 1E0F55801F1; Tue, 18 Jul 2023 15:27:56 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Tue, 18 Jul 2023 15:27:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1689708476; x=1689715676; bh=3v 5olxqQbLHEUCw1wGcplsHOcuOaFlaTEOubTkDMSCY=; b=EKxjS+X8XjLaKcSjTM 7VlHdd5cD4mhgvP83FlCd2TWGW9gfWbhvLBagTe+GE2se/43Ik0MCMjjT2c3bdVS KM5EMAg+Be1ww/HAkXJQibi11eulu31uXuD8eA9hDrgaUZjG+PlI+zFItCfMHoWs 3gOT8/VbI3erWYArJZVYwO3Kl4m3KxhlZ3QinLJpPnkjaOpOJJFdXexgEg+Uaj1h hzvqtFXJ0Aj03BMVE0CKhX77LXn7hxYibm8XZGb9Gk3ZCr5vR/M1azcftLFJQjMv npTyGxx9wunQ4OaVn2H0dKJx1uLZTS8pEF+28/M8Xr4oYYklVZGTMVZSj5mR47Y/ 1QGg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1689708476; x=1689715676; bh=3v5olxqQbLHEU Cw1wGcplsHOcuOaFlaTEOubTkDMSCY=; b=lBfpAEOc91iqQkRxRnoe9r+Hc5VIe u7P5e6pp7ptT9MD7v+vbSgYEJWI/gQN+Us99eRkCBxtnSFcTcV9G7vD6j9S+zz+6 FkSX02PMrF9Y2Sv9ysEOHnZ9N7XJNZstKoKNiOB8F5/f1v4RnvCgR1H78b8fdGjt SsagM7fSrar7+UIjkvtYnzMsDpKPGcGfsYZJkTwRGI6IZvweGi1rwOSfZyvyAEhU psuTd1bR7/soXkHz9fcPh9Doe1k6ES6od3X0XHrQWnsim1g1R1o7VArXK/CLB+8y mNUsS47U6pb/swIoGGP9KPHKpphRgwaX1SpvzHteSUE/SkBW3bTLAaW0g== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggddufeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 357ECB60086; Tue, 18 Jul 2023 15:27:54 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-531-gfdfa13a06d-fm-20230703.001-gfdfa13a0 Mime-Version: 1.0 Message-Id: <91486e8b-49ca-4a8a-8dd6-e9a2c6ed63ee@app.fastmail.com> In-Reply-To: <20230714171642.91185-4-javierm@redhat.com> References: <20230714171642.91185-1-javierm@redhat.com> <20230714171642.91185-4-javierm@redhat.com> Date: Tue, 18 Jul 2023 21:27:32 +0200 From: "Arnd Bergmann" To: "Javier Martinez Canillas" , linux-kernel@vger.kernel.org Cc: "Geert Uytterhoeven" , "Thomas Zimmermann" , "Andy Shevchenko" , "Borislav Petkov" , "Daniel Thompson" , "Daniel Vetter" , "Dave Hansen" , "Greg Kroah-Hartman" , "H. Peter Anvin" , "Helge Deller" , "Ingo Molnar" , "Jingoo Han" , "Lee Jones" , "Randy Dunlap" , "Sam Ravnborg" , "Thomas Gleixner" , 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 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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