fbdev/au1200fb: Initialize fb_ops with fbdev macros
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 27 Nov 2023 13:15:46 +0000 (14:15 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 29 Nov 2023 11:20:31 +0000 (12:20 +0100)
Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in DMA-able virtual address space. Set the
read/write, draw and mmap callbacks to the correct implementation
and avoid implicit defaults. Also select the necessary helpers in
Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based 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.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231127131655.4020-18-tzimmermann@suse.de
drivers/video/fbdev/Kconfig
drivers/video/fbdev/au1200fb.c

index de57bf59e0179f99b94909361025859e596088a3..4c82890887ba17b95a080a72e1aefeebabf153f9 100644 (file)
@@ -1457,10 +1457,7 @@ config FB_AU1100
 config FB_AU1200
        bool "Au1200/Au1300 LCD Driver"
        depends on (FB = y) && MIPS_ALCHEMY
-       select FB_SYS_FILLRECT
-       select FB_SYS_COPYAREA
-       select FB_SYS_IMAGEBLIT
-       select FB_SYS_FOPS
+       select FB_DMAMEM_HELPERS
        help
          This is the framebuffer driver for the Au1200/Au1300 SOCs.
          It can drive various panels and CRTs by passing in kernel cmd line
index 817c1ebb625b6247c8668cef8d3003512e763701..16ebbab5009721c652c7abe566dfbc65b387475d 100644 (file)
@@ -1488,15 +1488,12 @@ static int au1200fb_ioctl(struct fb_info *info, unsigned int cmd,
 
 static const struct fb_ops au1200fb_fb_ops = {
        .owner          = THIS_MODULE,
+       __FB_DEFAULT_DMAMEM_OPS_RDWR,
        .fb_check_var   = au1200fb_fb_check_var,
        .fb_set_par     = au1200fb_fb_set_par,
        .fb_setcolreg   = au1200fb_fb_setcolreg,
        .fb_blank       = au1200fb_fb_blank,
-       .fb_fillrect    = sys_fillrect,
-       .fb_copyarea    = sys_copyarea,
-       .fb_imageblit   = sys_imageblit,
-       .fb_read        = fb_sys_read,
-       .fb_write       = fb_sys_write,
+       __FB_DEFAULT_DMAMEM_OPS_DRAW,
        .fb_sync        = NULL,
        .fb_ioctl       = au1200fb_ioctl,
        .fb_mmap        = au1200fb_fb_mmap,