drm/gma500: Use regular fbdev I/O helpers
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 30 May 2023 15:12:20 +0000 (17:12 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 1 Jun 2023 10:26:49 +0000 (12:26 +0200)
Use the regular fbdev helpers for framebuffer I/O instead of DRM's
helpers. Gma500 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_IO_HELPERS option

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-6-tzimmermann@suse.de
drivers/gpu/drm/gma500/Kconfig
drivers/gpu/drm/gma500/fbdev.c

index 2efc0eb41c642f43e198a0774e59f9fa9ef3705a..cd3d92725ed48f6231ab7f6bae456d84f0a32c1d 100644 (file)
@@ -3,6 +3,7 @@ config DRM_GMA500
        tristate "Intel GMA500/600/3600/3650 KMS Framebuffer"
        depends on DRM && PCI && X86 && MMU
        select DRM_KMS_HELPER
+       select FB_IO_HELPERS if DRM_FBDEV_EMULATION
        select I2C
        select I2C_ALGOBIT
        # GMA500 depends on ACPI_VIDEO when ACPI is enabled, just like i915
index 4f0309548b2b5764c8e660cbfeae9646241b856a..955cbe9f05a72eab99a671bc456a0ee19d6ee22e 100644 (file)
@@ -5,6 +5,7 @@
  *
  **************************************************************************/
 
+#include <linux/fb.h>
 #include <linux/pfn_t.h>
 
 #include <drm/drm_crtc_helper.h>
@@ -134,13 +135,10 @@ static void psb_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops psb_fbdev_fb_ops = {
        .owner = THIS_MODULE,
+       __FB_DEFAULT_IO_OPS_RDWR,
        DRM_FB_HELPER_DEFAULT_OPS,
        .fb_setcolreg = psb_fbdev_fb_setcolreg,
-       .fb_read = drm_fb_helper_cfb_read,
-       .fb_write = drm_fb_helper_cfb_write,
-       .fb_fillrect = drm_fb_helper_cfb_fillrect,
-       .fb_copyarea = drm_fb_helper_cfb_copyarea,
-       .fb_imageblit = drm_fb_helper_cfb_imageblit,
+       __FB_DEFAULT_IO_OPS_DRAW,
        .fb_mmap = psb_fbdev_fb_mmap,
        .fb_destroy = psb_fbdev_fb_destroy,
 };