Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26860441rwd; Mon, 3 Jul 2023 16:29:49 -0700 (PDT) X-Google-Smtp-Source: APBJJlFTZ95cscRbNeDB7JGlBlxTTobYJE7TvYhjFex4kTmr5QbrxZFEcRrcMkbKPVabuQS8fBmW X-Received: by 2002:a05:6a00:1ace:b0:682:4e4c:48bc with SMTP id f14-20020a056a001ace00b006824e4c48bcmr15955257pfv.21.1688426988952; Mon, 03 Jul 2023 16:29:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688426988; cv=none; d=google.com; s=arc-20160816; b=VFrFUUsFdHFDcqIwN2L89UL8tA7C10tjCdtKeqc/5hFSnCZTKsJKKJFnW5zvD3QW33 iUDvGSnJ/feMU11Ej3ylgSQoE2fQu1WIt2CxDiEFT4tYJomFdzOk2FKWYhndVynZ6bzf Mu6fzqU4zgN2nD5w9gLlArgTMdMGO1Tmk4cUQpTfQplZMJjnQ2epdgi/7H8ta54RJ/Me nNU2VTpvn82lGSrHwxhqPpan15PkfUWUCsaE1TevL8dgKpB6OP4/wTJbewTan/hTkMsX 54AR2fXJcQPdQgXanp0F6iUWvtM404lHf4EcBsE+Wu4hWzoK/3In65ayF1BlK4J0ukC9 8j2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uLDMtsQ7x8sK8Yp4yXeZqors8D/LGiL+rTQqlGxqvwY=; fh=LY2S9bPv9LIL3tcSQ+P0U6oU01GYOF5KDQiok7xHlnA=; b=ZxuVPHh+G/xaSoiypXQs6UwIy2Anqmson8vThBN6Xcuou410iBtbI4OMaim+rYSbBK 9jyqTqa1ALq7g99dQT4CzisSpLu4v3YHTxOjKM2rIIkNzRfuGhhOlm5CtAQNyFNUqWUL HMXHvA11aLf8+fe70seOLCfC5euYvc8UlAfLtiW2Py10EymrH0mfAQbJoSIRefSAHPV4 srWtRHE9mFYY1D1YBt9Aoa8DuRRaNNSBiFsWDYJqa7+RjALjIyffhLl6erdcwCGRZp1h X72OvR44iPTqX8XHBQEr/WLOAnbJORsUGMjuDhjSAVCHN55by36gCpwQR3PNSjE0rBBS tScw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CvnrYvAq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s13-20020a632c0d000000b00543a6cc74bfsi18922513pgs.634.2023.07.03.16.29.36; Mon, 03 Jul 2023 16:29:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=CvnrYvAq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230512AbjGCXHZ (ORCPT + 99 others); Mon, 3 Jul 2023 19:07:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231131AbjGCXHT (ORCPT ); Mon, 3 Jul 2023 19:07:19 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41B13E72 for ; Mon, 3 Jul 2023 16:05:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688425549; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uLDMtsQ7x8sK8Yp4yXeZqors8D/LGiL+rTQqlGxqvwY=; b=CvnrYvAqxF+qT8ZjP/AHJUw+NgW17B7ZeeZDqyFo/+60+t9h5Mk2J82ywbQ4Q8T+zEEUHh zf+ercLgUKLWO0dL9XkMcWzLwv9lh9IZYAtiaKS/805Ap/By/5PLEFx0JL8Z5oKC3cO1Bm jqAW7ODg02jaYKh4pySor835oWJio+A= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-108-mcOpe7G5MTeEMEpI_rd6xw-1; Mon, 03 Jul 2023 19:05:48 -0400 X-MC-Unique: mcOpe7G5MTeEMEpI_rd6xw-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3fb40ec952bso31101505e9.0 for ; Mon, 03 Jul 2023 16:05:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688425547; x=1691017547; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uLDMtsQ7x8sK8Yp4yXeZqors8D/LGiL+rTQqlGxqvwY=; b=PvtGeWnSBjlURi2AjuXpBl//49Qb1vR9xKoUGmoTcNlMEmHfQNA4reIr0/JJ253w8l xmhxMHKSmoRgvcEQBcwfIxcrxmE2YgHK8X5uypPA8gD2Rj3391r81nl/ygkVlu5hDJLQ kqCer++M89llfmUzQ7RriYCZj+kqTOKXJUhB4h3RrV0NBosPCs3d9WJLwL7g131YeYHM lW7fWcqF5vJdvs+HOmhbo2B8x0DghCr042mdXovJ0C63LcLnJgNgUeqbnEDmEluJewtD 6G6mCiIHp8ik6NAvizQMnLna+rIoN8k95uz1MAnN+Ztby/d9mzRkj+ZxrqM/K2905sTV RFyA== X-Gm-Message-State: AC+VfDxSi++CqcRdLmVwpAHXQdzsXYP3KFTQCpL+14b3TA0bt0rUrWlZ 9P36Q5NQPWpSZVSf41IclCHIQHHk+drVlbcV/zcq/fE7oUBu73b9eLa+d9SUutq65+nw/m/jGFe ZX1W0cdsrjRuNazZk5ruQluttJBeCQfJlY5U7oDh3nTPrhWe3lHYYpBwHdlgIla0P89V3bqewka bUypkQ0c0= X-Received: by 2002:a1c:4c08:0:b0:3fb:b8a6:33f9 with SMTP id z8-20020a1c4c08000000b003fbb8a633f9mr9977087wmf.0.1688425546996; Mon, 03 Jul 2023 16:05:46 -0700 (PDT) X-Received: by 2002:a1c:4c08:0:b0:3fb:b8a6:33f9 with SMTP id z8-20020a1c4c08000000b003fbb8a633f9mr9977053wmf.0.1688425546709; Mon, 03 Jul 2023 16:05:46 -0700 (PDT) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id cw13-20020a056000090d00b003112f836d4esm26504465wrb.85.2023.07.03.16.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jul 2023 16:05:46 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Cc: Geert Uytterhoeven , Thomas Zimmermann , Arnd Bergmann , Javier Martinez Canillas , Andy Shevchenko , Borislav Petkov , Daniel Vetter , Dave Hansen , Greg Kroah-Hartman , "H. Peter Anvin" , Helge Deller , Ingo Molnar , Randy Dunlap , Sam Ravnborg , Thomas Gleixner , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, x86@kernel.org Subject: [PATCH v4 4/5] fbdev: Split frame buffer support in FB and FB_CORE symbols Date: Tue, 4 Jul 2023 01:05:28 +0200 Message-ID: <20230703230534.997525-5-javierm@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230703230534.997525-1-javierm@redhat.com> References: <20230703230534.997525-1-javierm@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Javier Martinez Canillas --- Changes in v4: - Fix menuconfig hierarchy that was broken in v3 (Arnd Bergmann). Changes in v3: - Really make a hidden symbol by removing the prompt (Arnd Bergmann). - Change FB_CORE to config instead of menuconfig (Arnd Bergmann). - Keep "depends on FB" for FIRMWARE_EDID (Arnd Bergmann). - Compile out fb_backlight.o and fbmon.o that are only needed for FB (Arnd Bergmann). - Make FB_DEVICE to depend on FB_CORE instead of selecting it. Changes in v2: - Keep "depends on FB" for FB_DDC, FB_HECUBA, FB_SVGALIB, FB_MACMODES, FB_BACKLIGHT, FB_MODE_HELPERS and FB_TILEBLITTING (Arnd Bergmann). - Don't change the fb.o object name (Arnd Bergmann). - Make FB_CORE a non-visible Kconfig symbol instead (Thomas Zimmermann). arch/x86/Makefile | 2 +- arch/x86/video/Makefile | 2 +- drivers/video/console/Kconfig | 2 +- drivers/video/fbdev/Kconfig | 10 ++++++++-- drivers/video/fbdev/core/Kconfig | 30 +++++++++++++++++------------- drivers/video/fbdev/core/Makefile | 8 ++++---- 6 files changed, 32 insertions(+), 22 deletions(-) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index b39975977c03..89a02e69be5f 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -259,7 +259,7 @@ drivers-$(CONFIG_PCI) += arch/x86/pci/ # suspend and hibernation support drivers-$(CONFIG_PM) += arch/x86/power/ -drivers-$(CONFIG_FB) += arch/x86/video/ +drivers-$(CONFIG_FB_CORE) += arch/x86/video/ #### # boot loader support. Several targets are kept for legacy purposes diff --git a/arch/x86/video/Makefile b/arch/x86/video/Makefile index 11640c116115..5ebe48752ffc 100644 --- a/arch/x86/video/Makefile +++ b/arch/x86/video/Makefile @@ -1,2 +1,2 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_FB) += fbdev.o +obj-$(CONFIG_FB_CORE) += fbdev.o diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index a2a88d42edf0..1b5a319971ed 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig @@ -72,7 +72,7 @@ config DUMMY_CONSOLE_ROWS config FRAMEBUFFER_CONSOLE bool "Framebuffer Console support" - depends on FB && !UML + depends on FB_CORE && !UML select VT_HW_CONSOLE_BINDING select CRC32 select FONT_SUPPORT diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig index 06199f044546..179e728aff5d 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -4,9 +4,9 @@ # menuconfig FB - tristate "Support for frame buffer devices" + tristate "Support for frame buffer device drivers" + select FB_CORE select FB_NOTIFY - select VIDEO_CMDLINE help The frame buffer device provides an abstraction for the graphics hardware. It represents the frame buffer of some video hardware and @@ -30,6 +30,12 @@ menuconfig FB for more information. + This enables support for native frame buffer device (fbdev) drivers. + + The DRM subsystem provides support for emulated frame buffer devices + on top of KMS drivers, but this option allows legacy fbdev drivers to + be enabled as well. + Say Y here and to the driver for your graphics board below if you are compiling a kernel for a non-x86 architecture. diff --git a/drivers/video/fbdev/core/Kconfig b/drivers/video/fbdev/core/Kconfig index 8e308d12c57b..15ce529d579a 100644 --- a/drivers/video/fbdev/core/Kconfig +++ b/drivers/video/fbdev/core/Kconfig @@ -3,6 +3,10 @@ # fbdev core configuration # +config FB_CORE + select VIDEO_CMDLINE + tristate + config FB_NOTIFY bool @@ -23,7 +27,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 @@ -39,7 +43,7 @@ config FB_DDC config FB_CFB_FILLRECT tristate - depends on FB + depends on FB_CORE help Include the cfb_fillrect function for generic software rectangle filling. This is used by drivers that don't provide their own @@ -47,7 +51,7 @@ config FB_CFB_FILLRECT config FB_CFB_COPYAREA tristate - depends on FB + depends on FB_CORE help Include the cfb_copyarea function for generic software area copying. This is used by drivers that don't provide their own (accelerated) @@ -55,7 +59,7 @@ config FB_CFB_COPYAREA config FB_CFB_IMAGEBLIT tristate - depends on FB + depends on FB_CORE help Include the cfb_imageblit function for generic software image blitting. This is used by drivers that don't provide their own @@ -63,7 +67,7 @@ config FB_CFB_IMAGEBLIT config FB_CFB_REV_PIXELS_IN_BYTE bool - depends on FB + depends on FB_CORE help Allow generic frame-buffer functions to work on displays with 1, 2 and 4 bits per pixel depths which has opposite order of pixels in @@ -71,7 +75,7 @@ config FB_CFB_REV_PIXELS_IN_BYTE config FB_SYS_FILLRECT tristate - depends on FB + depends on FB_CORE help Include the sys_fillrect function for generic software rectangle filling. This is used by drivers that don't provide their own @@ -79,7 +83,7 @@ config FB_SYS_FILLRECT config FB_SYS_COPYAREA tristate - depends on FB + depends on FB_CORE help Include the sys_copyarea function for generic software area copying. This is used by drivers that don't provide their own (accelerated) @@ -87,7 +91,7 @@ config FB_SYS_COPYAREA config FB_SYS_IMAGEBLIT tristate - depends on FB + depends on FB_CORE help Include the sys_imageblit function for generic software image blitting. This is used by drivers that don't provide their own @@ -126,22 +130,22 @@ endchoice config FB_SYS_FOPS tristate - depends on FB + depends on FB_CORE config FB_DEFERRED_IO bool - depends on FB + depends on FB_CORE config FB_IO_HELPERS bool - depends on FB + depends on FB_CORE select FB_CFB_COPYAREA select FB_CFB_FILLRECT select FB_CFB_IMAGEBLIT config FB_SYS_HELPERS bool - depends on FB + depends on FB_CORE select FB_SYS_COPYAREA select FB_SYS_FILLRECT select FB_SYS_FOPS @@ -149,7 +153,7 @@ config FB_SYS_HELPERS config FB_SYS_HELPERS_DEFERRED bool - depends on FB + depends on FB_CORE select FB_DEFERRED_IO select FB_SYS_HELPERS 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 fb-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o fb-$(CONFIG_FB_DEVICE) += fb_chrdev.o \ fb_procfs.o \ -- 2.41.0