Commit 6f0f6941 authored by Thomas Zimmermann's avatar Thomas Zimmermann

fbdev: Add fb_ops init macros for framebuffers in DMA-able memory

Add initializer macros for struct fb_ops for framebuffers in DMA-able
memory areas. Also add a corresponding Kconfig token. As of now, this
is equivalent to system framebuffers and mostly useful for labeling
drivers correctly.

A later patch may add a generic DMA-specific mmap operation. Linux
offers a number of dma_mmap_*() helpers for different use cases.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Acked-by: default avatarMaxime Ripard <mripard@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230707083422.18691-2-tzimmermann@suse.de
parent e6fa4816
......@@ -136,6 +136,14 @@ config FB_DEFERRED_IO
bool
depends on FB_CORE
config FB_DMA_HELPERS
bool
depends on FB_CORE
select FB_SYS_COPYAREA
select FB_SYS_FILLRECT
select FB_SYS_FOPS
select FB_SYS_IMAGEBLIT
config FB_IO_HELPERS
bool
depends on FB_CORE
......
......@@ -591,6 +591,19 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
__FB_DEFAULT_SYS_OPS_DRAW, \
__FB_DEFAULT_SYS_OPS_MMAP
/*
* Helpers for framebuffers in DMA-able memory
*/
#define __FB_DEFAULT_DMA_OPS_RDWR \
.fb_read = fb_sys_read, \
.fb_write = fb_sys_write
#define __FB_DEFAULT_DMA_OPS_DRAW \
.fb_fillrect = sys_fillrect, \
.fb_copyarea = sys_copyarea, \
.fb_imageblit = sys_imageblit
/* drivers/video/fbmem.c */
extern int register_framebuffer(struct fb_info *fb_info);
extern void unregister_framebuffer(struct fb_info *fb_info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment