From: Thomas Zimmermann Date: Tue, 1 Apr 2025 09:37:19 +0000 (+0200) Subject: drm/sysfb: Add vesadrm for VESA displays X-Git-Tag: v6.16-rc1~144^2~21^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a84eb6abe2b6a7201610645749275c8ac999fd1a;p=thirdparty%2Flinux.git drm/sysfb: Add vesadrm for VESA displays Add support for screen_info setups with VIDEO_TYPE_VLFB. Provide the minimum functionality of reading modes, updating and clearing the display. There is existing support for these displays provided by simpledrm with CONFIG_SYSFB_SIMPLEFB=y. Using vesadrm over simpledrm will allow for the use of additional functionality provided by VESA, such as EDID information, gamma correction and palette modes. This enhances the user experience and adds support for more display configuratons. v4: - depend on CONFIG_X86 v3: - depend on !SYSFB_SIMPLEFB (Javier) Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://lore.kernel.org/r/20250401094056.32904-17-tzimmermann@suse.de --- diff --git a/drivers/gpu/drm/sysfb/Kconfig b/drivers/gpu/drm/sysfb/Kconfig index ca39f88240938..5ac71d5ff8edf 100644 --- a/drivers/gpu/drm/sysfb/Kconfig +++ b/drivers/gpu/drm/sysfb/Kconfig @@ -57,4 +57,20 @@ config DRM_SIMPLEDRM On x86 BIOS or UEFI systems, you should also select SYSFB_SIMPLEFB to use UEFI and VESA framebuffers. +config DRM_VESADRM + tristate "VESA framebuffer driver" + depends on DRM && MMU && X86 && (!SYSFB_SIMPLEFB || COMPILE_TEST) + select APERTURE_HELPERS + select DRM_CLIENT_SELECTION + select DRM_GEM_SHMEM_HELPER + select DRM_KMS_HELPER + select DRM_SYSFB_HELPER + select SYSFB + help + DRM driver for VESA framebuffers. + + This driver assumes that the display hardware has been initialized + by the firmware or bootloader before the kernel boots. Scanout + buffer, size, and display format must be provided via VBE interfaces. + endmenu diff --git a/drivers/gpu/drm/sysfb/Makefile b/drivers/gpu/drm/sysfb/Makefile index 2f96f52842e63..0d2518c971634 100644 --- a/drivers/gpu/drm/sysfb/Makefile +++ b/drivers/gpu/drm/sysfb/Makefile @@ -5,3 +5,4 @@ obj-$(CONFIG_DRM_SYSFB_HELPER) += drm_sysfb_helper.o obj-$(CONFIG_DRM_EFIDRM) += efidrm.o obj-$(CONFIG_DRM_OFDRM) += ofdrm.o obj-$(CONFIG_DRM_SIMPLEDRM) += simpledrm.o +obj-$(CONFIG_DRM_VESADRM) += vesadrm.o diff --git a/drivers/gpu/drm/sysfb/vesadrm.c b/drivers/gpu/drm/sysfb/vesadrm.c new file mode 100644 index 0000000000000..8a963057ffec9 --- /dev/null +++ b/drivers/gpu/drm/sysfb/vesadrm.c @@ -0,0 +1,448 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include