Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev/nvidiafb: Initialize fb_ops to fbdev I/O-memory helpers

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in I/O address space. Set the read/write,
draw and mmap callbacks to the correct implementation and avoid
implicit defaults. Also select the necessary I/O helpers in Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default implementation to be invoked; hence requiring the I/O
helpers to be built in any case. Setting all callbacks in all
drivers explicitly will allow to make the I/O helpers optional.
This benefits systems that do not use these functions.

No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-25-tzimmermann@suse.de

+3 -1
+1 -1
drivers/video/fbdev/Kconfig
··· 689 689 tristate "nVidia Framebuffer Support" 690 690 depends on FB && PCI 691 691 select FB_BACKLIGHT if FB_NVIDIA_BACKLIGHT 692 - select FB_MODE_HELPERS 693 692 select FB_CFB_FILLRECT 694 693 select FB_CFB_COPYAREA 695 694 select FB_CFB_IMAGEBLIT 695 + select FB_IOMEM_FOPS 696 696 select BITREVERSE 697 697 select VGASTATE 698 698 select VIDEO_NOMODESET
+2
drivers/video/fbdev/nvidia/nvidia.c
··· 1028 1028 .owner = THIS_MODULE, 1029 1029 .fb_open = nvidiafb_open, 1030 1030 .fb_release = nvidiafb_release, 1031 + __FB_DEFAULT_IOMEM_OPS_RDWR, 1031 1032 .fb_check_var = nvidiafb_check_var, 1032 1033 .fb_set_par = nvidiafb_set_par, 1033 1034 .fb_setcolreg = nvidiafb_setcolreg, ··· 1039 1038 .fb_imageblit = nvidiafb_imageblit, 1040 1039 .fb_cursor = nvidiafb_cursor, 1041 1040 .fb_sync = nvidiafb_sync, 1041 + __FB_DEFAULT_IOMEM_OPS_MMAP, 1042 1042 }; 1043 1043 1044 1044 static int nvidiafb_suspend_late(struct device *dev, pm_message_t mesg)