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 <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230530151228.22979-11-tzimmermann@suse.de
This commit is contained in:
Thomas Zimmermann 2023-05-30 17:12:25 +02:00
parent e1d49d763e
commit c51b36207c
2 changed files with 25 additions and 0 deletions

View File

@ -670,6 +670,28 @@ static void drm_fb_helper_memory_range_to_clip(struct fb_info *info, off_t off,
drm_rect_init(clip, x1, y1, x2 - x1, y2 - y1); drm_rect_init(clip, x1, y1, x2 - x1, y2 - y1);
} }
/* Don't use in new code. */
void drm_fb_helper_damage_range(struct fb_info *info, off_t off, size_t len)
{
struct drm_fb_helper *fb_helper = info->par;
struct drm_rect damage_area;
drm_fb_helper_memory_range_to_clip(info, off, len, &damage_area);
drm_fb_helper_damage(fb_helper, damage_area.x1, damage_area.y1,
drm_rect_width(&damage_area),
drm_rect_height(&damage_area));
}
EXPORT_SYMBOL(drm_fb_helper_damage_range);
/* Don't use in new code. */
void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height)
{
struct drm_fb_helper *fb_helper = info->par;
drm_fb_helper_damage(fb_helper, x, y, width, height);
}
EXPORT_SYMBOL(drm_fb_helper_damage_area);
/** /**
* drm_fb_helper_deferred_io() - fbdev deferred_io callback function * drm_fb_helper_deferred_io() - fbdev deferred_io callback function
* @info: fb_info struct pointer * @info: fb_info struct pointer

View File

@ -253,6 +253,9 @@ void drm_fb_helper_fill_info(struct fb_info *info,
struct drm_fb_helper *fb_helper, struct drm_fb_helper *fb_helper,
struct drm_fb_helper_surface_size *sizes); struct drm_fb_helper_surface_size *sizes);
void drm_fb_helper_damage_range(struct fb_info *info, off_t off, size_t len);
void drm_fb_helper_damage_area(struct fb_info *info, u32 x, u32 y, u32 width, u32 height);
void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist); void drm_fb_helper_deferred_io(struct fb_info *info, struct list_head *pagereflist);
ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf, ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf,