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

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

Initialize each 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-23-tzimmermann@suse.de

+5 -3
+2
drivers/video/fbdev/Kconfig
··· 903 903 select FB_CFB_FILLRECT 904 904 select FB_CFB_COPYAREA 905 905 select FB_CFB_IMAGEBLIT 906 + select FB_IOMEM_FOPS 906 907 select FB_TILEBLITTING 907 908 select FB_MACMODES if PPC_PMAC 908 909 select VIDEO_NOMODESET ··· 990 989 config FB_MATROX_MAVEN 991 990 tristate "G400 second head support" 992 991 depends on FB_MATROX_G && FB_MATROX_I2C 992 + select FB_IOMEM_HELPERS 993 993 help 994 994 WARNING !!! This support does not work with G450 !!! 995 995
+2
drivers/video/fbdev/matrox/matroxfb_base.c
··· 1204 1204 .owner = THIS_MODULE, 1205 1205 .fb_open = matroxfb_open, 1206 1206 .fb_release = matroxfb_release, 1207 + __FB_DEFAULT_IOMEM_OPS_RDWR, 1207 1208 .fb_check_var = matroxfb_check_var, 1208 1209 .fb_set_par = matroxfb_set_par, 1209 1210 .fb_setcolreg = matroxfb_setcolreg, ··· 1215 1214 /* .fb_copyarea = <set by matrox_cfbX_init>, */ 1216 1215 /* .fb_imageblit = <set by matrox_cfbX_init>, */ 1217 1216 /* .fb_cursor = <set by matrox_cfbX_init>, */ 1217 + __FB_DEFAULT_IOMEM_OPS_MMAP, 1218 1218 }; 1219 1219 1220 1220 #define RSDepth(X) (((X) >> 8) & 0x0F)
+1 -3
drivers/video/fbdev/matrox/matroxfb_crtc2.c
··· 567 567 .owner = THIS_MODULE, 568 568 .fb_open = matroxfb_dh_open, 569 569 .fb_release = matroxfb_dh_release, 570 + FB_DEFAULT_IOMEM_OPS, 570 571 .fb_check_var = matroxfb_dh_check_var, 571 572 .fb_set_par = matroxfb_dh_set_par, 572 573 .fb_setcolreg = matroxfb_dh_setcolreg, 573 574 .fb_pan_display =matroxfb_dh_pan_display, 574 575 .fb_blank = matroxfb_dh_blank, 575 576 .fb_ioctl = matroxfb_dh_ioctl, 576 - .fb_fillrect = cfb_fillrect, 577 - .fb_copyarea = cfb_copyarea, 578 - .fb_imageblit = cfb_imageblit, 579 577 }; 580 578 581 579 static struct fb_var_screeninfo matroxfb_dh_defined = {