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

drm/fbdev-dma: Use regular fbdev I/O helpers

Use the regular fbdev helpers for framebuffer I/O instead of DRM's
helpers. Fbdev-dma does not use damage handling, so DRM's fbdev helpers
are mere wrappers around the fbdev code.

By using fbdev helpers directly within each DRM fbdev emulation,
we can eventually remove DRM's wrapper functions entirely.

v4:
* use initializer macros for struct fb_ops
v2:
* use FB_SYS_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-8-tzimmermann@suse.de

+6 -6
+1
drivers/gpu/drm/Kconfig
··· 223 223 config DRM_GEM_DMA_HELPER 224 224 tristate 225 225 depends on DRM 226 + select FB_SYS_HELPERS if DRM_FBDEV_EMULATION 226 227 help 227 228 Choose this if you need the GEM DMA helper functions 228 229
+5 -6
drivers/gpu/drm/drm_fbdev_dma.c
··· 1 1 // SPDX-License-Identifier: MIT 2 2 3 + #include <linux/fb.h> 4 + 3 5 #include <drm/drm_crtc_helper.h> 4 6 #include <drm/drm_drv.h> 5 7 #include <drm/drm_fb_helper.h> ··· 66 64 .owner = THIS_MODULE, 67 65 .fb_open = drm_fbdev_dma_fb_open, 68 66 .fb_release = drm_fbdev_dma_fb_release, 69 - .fb_read = drm_fb_helper_sys_read, 70 - .fb_write = drm_fb_helper_sys_write, 67 + __FB_DEFAULT_SYS_OPS_RDWR, 71 68 DRM_FB_HELPER_DEFAULT_OPS, 72 - .fb_fillrect = drm_fb_helper_sys_fillrect, 73 - .fb_copyarea = drm_fb_helper_sys_copyarea, 74 - .fb_imageblit = drm_fb_helper_sys_imageblit, 75 - .fb_destroy = drm_fbdev_dma_fb_destroy, 69 + __FB_DEFAULT_SYS_OPS_DRAW, 76 70 .fb_mmap = drm_fbdev_dma_fb_mmap, 71 + .fb_destroy = drm_fbdev_dma_fb_destroy, 77 72 }; 78 73 79 74 /*