fbdev: Move I/O read and write code into helper functions
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 28 Apr 2023 12:24:51 +0000 (14:24 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 8 May 2023 13:28:34 +0000 (15:28 +0200)
commit6121cd9ef911432b14c2a17aefaf8cd2f3cfcdff
tree6db707c245921b6460cbda1c20f22e1a737f7f59
parent3f8974f68f408f4983443b745a3cf95b06112469
fbdev: Move I/O read and write code into helper functions

Move the existing I/O read and write code for I/O memory into
the new helpers fb_cfb_read() and fb_cfb_write(). Make them the
default fp_ops. No functional changes.

In the near term, the new functions will be useful to the DRM
subsystem, which currently provides it's own implementation. It
can then use the shared code. In the longer term, it might make
sense to revise the I/O helper's default status and make them
opt-in by the driver. Systems that don't use them would not
contain the code any longer.

v2:
* add detailed commit message (Javier)
* rename fb_cfb_() to fb_io_() (Geert)
* add fixes that got lost while moving the code (Geert)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: Sui Jingfeng <suijingfeng@loongson.cn>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Helge Deller <deller@gmx.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230428122452.4856-19-tzimmermann@suse.de
drivers/video/fbdev/core/Makefile
drivers/video/fbdev/core/fb_io_fops.c [new file with mode: 0644]
drivers/video/fbdev/core/fbmem.c
include/linux/fb.h