From patchwork Sat Jul 1 21:44:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 13299128 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 177D9EB64DC for ; Sat, 1 Jul 2023 21:45:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E4DC110E11C; Sat, 1 Jul 2023 21:45:18 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id D39B910E0C1 for ; Sat, 1 Jul 2023 21:45:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688247916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CVp6/k8iItY4Fh6tN5JBgOkeUtA2k8q9cd5KwLvRASM=; b=Ff3y/Kpqea52z+dKlDiWY0nAObnnzcs6AntGj6f851x6mnalLt43ZQPl2NuPwIfpisflLT DMs1jKrphO83UHiWKgwNwDr36iDCIDhokA5EOnJa0xjVWd7Gw4J0nHS1JARMl1tv3mskGC FkTNoXuo+8dlEPpggOriEKv8I3KAPcQ= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-422-3Z-GqHenOg2hT0sH9N6Q7Q-1; Sat, 01 Jul 2023 17:45:15 -0400 X-MC-Unique: 3Z-GqHenOg2hT0sH9N6Q7Q-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-3f9bef91aa4so18319925e9.3 for ; Sat, 01 Jul 2023 14:45:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688247914; x=1690839914; 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=CVp6/k8iItY4Fh6tN5JBgOkeUtA2k8q9cd5KwLvRASM=; b=cqIngyDN7qeDPFcAkqJBMnPvqZTgPUAczABgEdWaKfIN/jL2YelpwbDfHaXPcmqmVF SzeV5BbnYC18SCMASjWzO03DxYz4nXaicRg37z6PN39I0BAbH7LnF+KDbkn5En9FtNa5 1tbKUoCh2YGJ36EN01XR3jpdqQvm8hMSi2uJtkxYfsFMDbx76uT8YYe0DMoz9LDYbGew fX5bQyK5zO15RmpFLyyR9HaOvpgf2oAoHDST4WY0Jh3x+NKHI6YiOj1C20AzUjGhXPzF d4FbN8u6UimpuoTy1h8frmKAvNr/UXojRHNuCfSiXW0Clm6ShLJ49zQuInkXJq4HNn7U wM9A== X-Gm-Message-State: AC+VfDxWwhNyjSEjzIuorVzL/bCQ8gORMUQPzDSB5Pry0WDj6qESLJCa 1wFv4VnUzXPYOtmBooz/mz8o6CSsMoAb2W4JpRvDdZND2Kr7IMTn+MGKYttIIm8QVDtBSBI+ydb 1DccN5Gl+H/VOBVhuWnEYX7NdEM0U X-Received: by 2002:a1c:7706:0:b0:3fb:b61f:c719 with SMTP id t6-20020a1c7706000000b003fbb61fc719mr4959576wmi.33.1688247914152; Sat, 01 Jul 2023 14:45:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5WtvTVFU6XcG3QtAxzUOBs4bnSkgPG7Dra6Iy7iETJyiZfrdtFMs1g1wQAz4NSuuTBGfeRFg== X-Received: by 2002:a1c:7706:0:b0:3fb:b61f:c719 with SMTP id t6-20020a1c7706000000b003fbb61fc719mr4959554wmi.33.1688247913775; Sat, 01 Jul 2023 14:45:13 -0700 (PDT) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id o10-20020a1c750a000000b003fbc0ea491dsm6913800wmc.40.2023.07.01.14.45.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jul 2023 14:45:13 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] fbdev: Split frame buffer support in FB and FB_CORE symbols Date: Sat, 1 Jul 2023 23:44:50 +0200 Message-ID: <20230701214503.550549-2-javierm@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230701214503.550549-1-javierm@redhat.com> References: <20230701214503.550549-1-javierm@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: x86@kernel.org, linux-fbdev@vger.kernel.org, Randy Dunlap , Arnd Bergmann , Greg Kroah-Hartman , Helge Deller , Dave Hansen , Javier Martinez Canillas , dri-devel@lists.freedesktop.org, Ingo Molnar , Borislav Petkov , Thomas Zimmermann , "H. Peter Anvin" , Geert Uytterhoeven , Thomas Gleixner , Andy Shevchenko , Sam Ravnborg Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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). Signed-off-by: Javier Martinez Canillas --- 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 | 40 +++++++++++++++++++------------ drivers/video/fbdev/core/Makefile | 2 +- 5 files changed, 29 insertions(+), 19 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 cecf15418632..da6f7d588f17 100644 --- a/drivers/video/fbdev/Kconfig +++ b/drivers/video/fbdev/Kconfig @@ -6,8 +6,12 @@ config FB_NOTIFY bool +menuconfig FB_CORE + tristate "Core support for frame buffer devices" + 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 @@ -33,6 +37,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. @@ -44,7 +54,7 @@ menuconfig FB config FIRMWARE_EDID bool "Enable firmware EDID" - depends on FB + depends on FB_CORE help This enables access to the EDID transferred from the firmware. On the i386, this is from the Video BIOS. Enable this if DDC/I2C @@ -59,7 +69,7 @@ config FIRMWARE_EDID config FB_DEVICE bool "Provide legacy /dev/fb* device" - depends on FB + select FB_CORE default y help Say Y here if you want the legacy /dev/fb* device file and @@ -75,7 +85,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 @@ -83,7 +93,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) @@ -91,7 +101,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 @@ -99,7 +109,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 @@ -107,7 +117,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 @@ -115,7 +125,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) @@ -123,7 +133,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 @@ -162,22 +172,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 @@ -185,7 +195,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..4c2e4a026d12 100644 --- a/drivers/video/fbdev/core/Makefile +++ b/drivers/video/fbdev/core/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_FB_NOTIFY) += fb_notify.o -obj-$(CONFIG_FB) += fb.o +obj-$(CONFIG_FB_CORE) += fb.o fb-y := fb_backlight.o \ fb_info.o \ fbmem.o fbmon.o fbcmap.o \ From patchwork Sat Jul 1 21:44:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 13299129 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1D1B8EB64DD for ; Sat, 1 Jul 2023 21:45:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 482F610E0C1; Sat, 1 Jul 2023 21:45:23 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id D04AB10E0C1 for ; Sat, 1 Jul 2023 21:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688247919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YjYFztOePLsPaJm5e5mc9Fspsz0Ww9J9HtOwfHiQKzE=; b=FuUULAd0zOsDpqWV2Hm5rGknwFBCiK9PhipDjf41U894eRCkShpIGTO9dmQ3D54/CMwd/Z QDn7xxjKhnCpLI0Sb8b4oEacO1Ard7rNrpaRv6oV7PbqkMWbez6lVarb94+dXgiBormp+5 vEmN/gNnRRIEnrlhWAm80SXn3XaBVUU= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-621-_IhekqT6P-Gh5yzjytG_lA-1; Sat, 01 Jul 2023 17:45:16 -0400 X-MC-Unique: _IhekqT6P-Gh5yzjytG_lA-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-3f9bef91aa4so18319995e9.3 for ; Sat, 01 Jul 2023 14:45:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688247915; x=1690839915; 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=YjYFztOePLsPaJm5e5mc9Fspsz0Ww9J9HtOwfHiQKzE=; b=PTNGUz0Pp4L+9n8ufFuG3I0EKSucQK0K1XME2g3OOms4gbEs2BoTKi12+ue3JY/63y FNtR+M4LMTPrt5pUxZHajqHZkp7LmfhrxgVWMN4zpc3/9KISvv7LUVfcSqqoQnjEZA/P 6dGiuVpCcdZl3rzDt64isGQHonKVpS6JI0wElTsL6pwh2be6ltkJ20yIJUwwurzOrPiL obC4yfcaqa/dvkrhI3HedH/g1s+wNWbsUb9yM31bi31TBwfA0BdgP1pfkZy4Z6JSUnl3 WXkjS9lgoJqBUYwQ6uvHNsAq+iRyQCgHT42u9kHgUiKFbL1TFx6AWoVcATc1tAuSAmZJ ApTg== X-Gm-Message-State: AC+VfDx3MpmmI0cDyy8YkALuyE1Pxkk/gTaedyKm4DJp2g8uMvhQzDtG FOxBXxu2oFBqmyoH2iJo2eGfuvswNGdCAU3dQnwS0zbKYUgda7uo792x9vA3+Cim1a6OdNFoAnq EvH4ayIshJZNw8Kgrq0+mYHyn4urY X-Received: by 2002:a05:600c:2181:b0:3fa:96ae:fd78 with SMTP id e1-20020a05600c218100b003fa96aefd78mr5114274wme.29.1688247915506; Sat, 01 Jul 2023 14:45:15 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4QL/alylsKkmsCF50GPU6dzPKVvFKUXejyBEKTLhORjiMD3xe/aN1kkO/WkkVl4mUmO/qwpg== X-Received: by 2002:a05:600c:2181:b0:3fa:96ae:fd78 with SMTP id e1-20020a05600c218100b003fa96aefd78mr5114264wme.29.1688247915076; Sat, 01 Jul 2023 14:45:15 -0700 (PDT) Received: from minerva.home (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id o10-20020a1c750a000000b003fbc0ea491dsm6913800wmc.40.2023.07.01.14.45.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Jul 2023 14:45:14 -0700 (PDT) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] drm: Make fbdev emulation select FB_CORE instead of depends on FB Date: Sat, 1 Jul 2023 23:44:51 +0200 Message-ID: <20230701214503.550549-3-javierm@redhat.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230701214503.550549-1-javierm@redhat.com> References: <20230701214503.550549-1-javierm@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , Arnd Bergmann , Javier Martinez Canillas , Maxime Ripard , Geert Uytterhoeven , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Now that the fbdev core has been split in FB_CORE and FB, make DRM fbdev emulation layer to just select the former. This allows to disable the CONFIG_FB option if is not needed, which will avoid the need to explicitly disable each of the legacy fbdev drivers. Signed-off-by: Javier Martinez Canillas --- Changes in v2: - Make CONFIG_DRM_FBDEV_EMULATION to select FB_CORE (Thomas Zimmermann). drivers/gpu/drm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index afb3b2f5f425..d9b1710e3ad0 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -132,7 +132,7 @@ config DRM_DEBUG_MODESET_LOCK config DRM_FBDEV_EMULATION bool "Enable legacy fbdev support for your modesetting driver" depends on DRM_KMS_HELPER - depends on FB=y || FB=DRM_KMS_HELPER + select FB_CORE select FRAMEBUFFER_CONSOLE if !EXPERT select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE default y