Skip to content

Commit

Permalink
drm/fb-helper: Unmap client buffer during shutdown
Browse files Browse the repository at this point in the history
The fbdev helper's generic probe function establishes a mapping for
framebuffers without shadow buffer. The clean-up function did not unmap
the buffer object. Add the unmap operation.

As fbdev devices are usally released during system shutdown, this has
not been a problem in practice.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Sam Ravnborg <[email protected]>
Acked-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
Thomas Zimmermann committed Nov 24, 2020
1 parent a102172 commit 763aea1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1988,14 +1988,19 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)
if (!fb_helper->dev)
return;

if (fbi && fbi->fbdefio) {
fb_deferred_io_cleanup(fbi);
shadow = fbi->screen_buffer;
if (fbi) {
if (fbi->fbdefio)
fb_deferred_io_cleanup(fbi);
if (drm_fbdev_use_shadow_fb(fb_helper))
shadow = fbi->screen_buffer;
}

drm_fb_helper_fini(fb_helper);

vfree(shadow);
if (shadow)
vfree(shadow);
else
drm_client_buffer_vunmap(fb_helper->buffer);

drm_client_framebuffer_delete(fb_helper->buffer);
}
Expand Down

0 comments on commit 763aea1

Please sign in to comment.