fbdev: Add initializer macros for struct fb_ops
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 30 May 2023 15:12:17 +0000 (17:12 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 1 Jun 2023 10:26:45 +0000 (12:26 +0200)
commitf1061fa641b8b15c7815d58c20a6c29f2f1f5337
tree4cbea3ded661fc11ca0dfc251673975d4e1a1122
parent3b99ee5751c2dfa4b88bb00f573c78735563c4d7
fbdev: Add initializer macros for struct fb_ops

For framebuffers in I/O and system memory, add macros that set
struct fb_ops to the respective callback functions.

For deferred I/O, add macros that generate callback functions with
damage handling. Add initializer macros that set struct fb_ops to
the generated callbacks.

These macros can remove a lot boilerplate code from fbdev drivers.
The drivers are supposed to use the macro that is required for its
framebuffer. Each macro is split into smaller helpers, so that
drivers with non-standard callbacks can pick and customize callbacks
as needed. There are individual helper macros for read/write, mmap
and drawing.

v5:
* fix whitespace errors (Jingfeng)

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-3-tzimmermann@suse.de
include/linux/fb.h