drm/radeon: Use regular fbdev I/O helpers
authorThomas Zimmermann <tzimmermann@suse.de>
Tue, 30 May 2023 15:12:21 +0000 (17:12 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Thu, 1 Jun 2023 10:26:50 +0000 (12:26 +0200)
Use the regular fbdev helpers for framebuffer I/O instead of DRM's
helpers. Radeon 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: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-7-tzimmermann@suse.de
drivers/gpu/drm/radeon/Kconfig
drivers/gpu/drm/radeon/radeon_fbdev.c

index e19d77d5881066a8ce2b4251ee450227cf2a4ad3..fe498c8af1bb1f2c4c0f0a0195b17528b8ca6bcb 100644 (file)
@@ -11,6 +11,7 @@ config DRM_RADEON
        select DRM_SUBALLOC_HELPER
         select DRM_TTM
        select DRM_TTM_HELPER
+       select FB_IO_HELPERS if DRM_FBDEV_EMULATION
        select SND_HDA_COMPONENT if SND_HDA_CORE
        select POWER_SUPPLY
        select HWMON
index fe76e29910efadd8022ef2edebd6f48ef7017301..28212c2d6c986c4137ff436f754bf81075df26a5 100644 (file)
@@ -24,6 +24,7 @@
  *     David Airlie
  */
 
+#include <linux/fb.h>
 #include <linux/pci.h>
 #include <linux/pm_runtime.h>
 #include <linux/vga_switcheroo.h>
@@ -190,14 +191,10 @@ static void radeon_fbdev_fb_destroy(struct fb_info *info)
 
 static const struct fb_ops radeon_fbdev_fb_ops = {
        .owner = THIS_MODULE,
-       DRM_FB_HELPER_DEFAULT_OPS,
        .fb_open = radeon_fbdev_fb_open,
        .fb_release = radeon_fbdev_fb_release,
-       .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,
+       DRM_FB_HELPER_DEFAULT_OPS,
        .fb_destroy = radeon_fbdev_fb_destroy,
 };