Skip to content

Commit c51b362

Browse files
author
Thomas Zimmermann
committed
drm/fb-helper: Export helpers for marking damage areas
Export drm_fb_helper_damage() and drm_fb_helper_damage_range(), which handle damage areas for fbdev emulation. This is a temporary export that allows to move the DRM I/O helpers for fbdev into drivers. Only fbdev-generic and i915 need them. Both will be updated to implement damage handling by themselves and the exported functions will be removed. v4: * update interfaces Signed-off-by: Thomas Zimmermann <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e1d49d7 commit c51b362

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,28 @@ static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off,
670670
drm_rect_init(clip, x1, y1, x2 - x1, y2 - y1);
671671
}
672672

673+
/* Don't use in new code. */
674+
void drm_fb_helper_damage_range(struct fb_info *info, off_t off, size_t len)
675+
{
676+
struct drm_fb_helper *fb_helper = info->par;
677+
struct drm_rect damage_area;
678+
679+
drm_fb_helper_memory_range_to_clip(info, off, len, &damage_area);
680+
drm_fb_helper_damage(fb_helper, damage_area.x1, damage_area.y1,
681+
drm_rect_width(&damage_area),
682+
drm_rect_height(&damage_area));
683+
}
684+
EXPORT_SYMBOL(drm_fb_helper_damage_range);
685+
686+
/* Don't use in new code. */
687+
void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
688+
{
689+
struct drm_fb_helper *fb_helper = info->par;
690+
691+
drm_fb_helper_damage(fb_helper, x, y, width, height);
692+
}
693+
EXPORT_SYMBOL(drm_fb_helper_damage_area);
694+
673695
/**
674696
* drm_fb_helper_deferred_io() - fbdev deferred_io callback function
675697
* @info: fb_info struct pointer

include/drm/drm_fb_helper.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ void drm_fb_helper_fill_info(struct fb_info *info,
253253
struct drm_fb_helper *fb_helper,
254254
struct drm_fb_helper_surface_size *sizes);
255255

256+
void drm_fb_helper_damage_range(struct fb_info *info, off_t off, size_t len);
257+
void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
258+
256259
void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist);
257260

258261
ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf,

0 commit comments

Comments
 (0)