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

fbdev/controlfb: 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>
Link: https://patchwork.freedesktop.org/patch/msgid/20230927074722.6197-12-tzimmermann@suse.de

+3 -6
+1 -3
drivers/video/fbdev/Kconfig
··· 309 309 config FB_CONTROL 310 310 bool "Apple \"control\" display support" 311 311 depends on (FB = y) && ((PPC_PMAC && PPC32) || COMPILE_TEST) 312 - select FB_CFB_FILLRECT 313 - select FB_CFB_COPYAREA 314 - select FB_CFB_IMAGEBLIT 312 + select FB_IOMEM_HELPERS 315 313 select FB_MACMODES 316 314 help 317 315 This driver supports a frame buffer for the graphics adapter in the
+2 -3
drivers/video/fbdev/controlfb.c
··· 755 755 756 756 static const struct fb_ops controlfb_ops = { 757 757 .owner = THIS_MODULE, 758 + __FB_DEFAULT_IOMEM_OPS_RDWR, 758 759 .fb_check_var = controlfb_check_var, 759 760 .fb_set_par = controlfb_set_par, 760 761 .fb_setcolreg = controlfb_setcolreg, 761 762 .fb_pan_display = controlfb_pan_display, 762 763 .fb_blank = controlfb_blank, 764 + __FB_DEFAULT_IOMEM_OPS_DRAW, 763 765 .fb_mmap = controlfb_mmap, 764 - .fb_fillrect = cfb_fillrect, 765 - .fb_copyarea = cfb_copyarea, 766 - .fb_imageblit = cfb_imageblit, 767 766 }; 768 767 769 768 /*