Skip to content

Commit 4a2262c

Browse files
author
Thomas Zimmermann
committed
drm/msm: Use regular fbdev I/O helpers
Use the regular fbdev helpers for framebuffer I/O instead of DRM's helpers. Msm 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. Msm's fbdev emulation has been incomplete as it didn't implement damage handling. Partilly fix this by implementing damage handling for write and draw operation. It is still missing for mmaped pages. v4: * use initializer macros for struct fb_ops * partially support damage handling v2: * use FB_SYS_HELPERS option Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Cc: Rob Clark <[email protected]> Cc: Abhinav Kumar <[email protected]> Cc: Dmitry Baryshkov <[email protected]> Cc: Sean Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c51b362 commit 4a2262c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

drivers/gpu/drm/msm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ config DRM_MSM
2121
select DRM_BRIDGE
2222
select DRM_PANEL_BRIDGE
2323
select DRM_SCHED
24+
select FB_SYS_HELPERS if DRM_FBDEV_EMULATION
2425
select SHMEM
2526
select TMPFS
2627
select QCOM_SCM

drivers/gpu/drm/msm/msm_fbdev.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Author: Rob Clark <[email protected]>
55
*/
66

7+
#include <linux/fb.h>
8+
79
#include <drm/drm_drv.h>
810
#include <drm/drm_crtc_helper.h>
911
#include <drm/drm_fb_helper.h>
@@ -23,6 +25,10 @@ module_param(fbdev, bool, 0600);
2325
* fbdev funcs, to implement legacy fbdev interface on top of drm driver
2426
*/
2527

28+
FB_GEN_DEFAULT_DEFERRED_SYS_OPS(msm_fbdev,
29+
drm_fb_helper_damage_range,
30+
drm_fb_helper_damage_area)
31+
2632
static int msm_fbdev_mmap(struct fb_info *info, struct vm_area_struct *vma)
2733
{
2834
struct drm_fb_helper *helper = (struct drm_fb_helper *)info->par;
@@ -52,16 +58,9 @@ static void msm_fbdev_fb_destroy(struct fb_info *info)
5258

5359
static const struct fb_ops msm_fb_ops = {
5460
.owner = THIS_MODULE,
61+
__FB_DEFAULT_DEFERRED_OPS_RDWR(msm_fbdev),
5562
DRM_FB_HELPER_DEFAULT_OPS,
56-
57-
/* Note: to properly handle manual update displays, we wrap the
58-
* basic fbdev ops which write to the framebuffer
59-
*/
60-
.fb_read = drm_fb_helper_sys_read,
61-
.fb_write = drm_fb_helper_sys_write,
62-
.fb_fillrect = drm_fb_helper_sys_fillrect,
63-
.fb_copyarea = drm_fb_helper_sys_copyarea,
64-
.fb_imageblit = drm_fb_helper_sys_imageblit,
63+
__FB_DEFAULT_DEFERRED_OPS_DRAW(msm_fbdev),
6564
.fb_mmap = msm_fbdev_mmap,
6665
.fb_destroy = msm_fbdev_fb_destroy,
6766
};

0 commit comments

Comments
 (0)