Skip to content

Commit

Permalink
Revert "drm/fb-helper: Schedule deferred-I/O worker after writing to …
Browse files Browse the repository at this point in the history
…framebuffer"

This reverts commit 7f5cc4a.

Needed to restore the fbdev damage worker. There have been bug reports
about locking order [1] and incorrectly takens branches. [2] Restore
the damage worker until these problems have been resovled.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://intel-gfx-ci.01.org/tree/drm-tip/fi-kbl-8809g.html # 1
Link: https://lore.kernel.org/dri-devel/20221115115819.23088-6-tzimmermann@suse.de/T/#m06eedc0a468940e4cbbd14ca026733b639bc445a # 2
Link: https://patchwork.freedesktop.org/patch/msgid/20221118133535.9739-3-tzimmermann@suse.de
  • Loading branch information
Thomas Zimmermann committed Nov 20, 2022
1 parent 7aa3d63 commit 8b83e1a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 25 deletions.
9 changes: 1 addition & 8 deletions drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,16 +599,9 @@ static void drm_fb_helper_add_damage_clip(struct drm_fb_helper *helper, u32 x, u
static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y,
u32 width, u32 height)
{
struct fb_info *info = helper->info;

drm_fb_helper_add_damage_clip(helper, x, y, width, height);

/*
* The current fbdev emulation only flushes buffers if a damage
* update is necessary. And we can assume that deferred I/O has
* been enabled as damage updates require deferred I/O for mmap.
*/
fb_deferred_io_schedule_flush(info);
schedule_work(&helper->damage_work);
}

/*
Expand Down
16 changes: 0 additions & 16 deletions drivers/video/fbdev/core/fb_defio.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,19 +332,3 @@ void fb_deferred_io_cleanup(struct fb_info *info)
mutex_destroy(&fbdefio->lock);
}
EXPORT_SYMBOL_GPL(fb_deferred_io_cleanup);

void fb_deferred_io_schedule_flush(struct fb_info *info)
{
struct fb_deferred_io *fbdefio = info->fbdefio;

if (WARN_ON_ONCE(!fbdefio))
return; /* bug in driver logic */

/*
* There's no requirement from callers to schedule the
* flush immediately. Rather schedule the worker with a
* delay and let a few more writes pile up.
*/
schedule_delayed_work(&info->deferred_work, fbdefio->delay);
}
EXPORT_SYMBOL_GPL(fb_deferred_io_schedule_flush);
1 change: 0 additions & 1 deletion include/linux/fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,6 @@ extern void fb_deferred_io_open(struct fb_info *info,
struct inode *inode,
struct file *file);
extern void fb_deferred_io_cleanup(struct fb_info *info);
extern void fb_deferred_io_schedule_flush(struct fb_info *info);
extern int fb_deferred_io_fsync(struct file *file, loff_t start,
loff_t end, int datasync);

Expand Down

0 comments on commit 8b83e1a

Please sign in to comment.