[PATCHv1] drm/omap: get fbdev working for manually updated display

Sebastian Reichel sebastian.reichel at collabora.com
Sat May 1 20:00:50 UTC 2021


Running a legacy application, which directly uses /dev/fb0
currently results in display not being refreshed when the
application mmaps the memory instead of calling write().

Deferred IO support will also schedule dirty_work with the
damage collected from the mmap page writes and thus gets
some more legacy applications working.

Delay frequency settings have been taken over from
drm_fb_helper_generic_probe().

Reported-by: Carl Philipp Klemm <philipp at uvos.xyz>
Tested-by: Carl Philipp Klemm <philipp at uvos.xyz>
Signed-off-by: Sebastian Reichel <sebastian.reichel at collabora.com>
---
Hi,

I still need to fix my Droid 4, so I only compile tested this
myself.

-- Sebastian
---
 drivers/gpu/drm/omapdrm/omap_fbdev.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index 42eac6ad12bd..fc3897d2d7cc 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -87,6 +87,11 @@ static const struct fb_ops omap_fb_ops = {
 	.fb_imageblit = drm_fb_helper_sys_imageblit,
 };
 
+static struct fb_deferred_io omap_fb_defio = {
+	.delay		= HZ / 20,
+	.deferred_io	= drm_fb_helper_deferred_io,
+};
+
 static int omap_fbdev_create(struct drm_fb_helper *helper,
 		struct drm_fb_helper_surface_size *sizes)
 {
@@ -176,6 +181,9 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
 
 	drm_fb_helper_fill_info(fbi, helper, sizes);
 
+	fbi->fbdefio = &omap_fb_defio;
+	fb_deferred_io_init(fbi);
+
 	dev->mode_config.fb_base = dma_addr;
 
 	fbi->screen_buffer = omap_gem_vaddr(fbdev->bo);

base-commit: 152d32aa846835987966fd20ee1143b0e05036a0
-- 
2.30.2



More information about the dri-devel mailing list