Commit b1be5ba2 authored by Thomas Zimmermann's avatar Thomas Zimmermann

drm/fb-helper: Set damage-clip area in helper

Set the damage area in the new helper drm_fb_helper_add_damage_clip().
It can now be updated without scheduling the damage worker. This change
will help to remove the damage worker entirely. No functional changes.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20221115115819.23088-2-tzimmermann@suse.de
parent b230555f
...@@ -576,8 +576,8 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper) ...@@ -576,8 +576,8 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
} }
EXPORT_SYMBOL(drm_fb_helper_fini); EXPORT_SYMBOL(drm_fb_helper_fini);
static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y, static void drm_fb_helper_add_damage_clip(struct drm_fb_helper *helper, u32 x, u32 y,
u32 width, u32 height) u32 width, u32 height)
{ {
struct drm_clip_rect *clip = &helper->damage_clip; struct drm_clip_rect *clip = &helper->damage_clip;
unsigned long flags; unsigned long flags;
...@@ -588,6 +588,12 @@ static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y, ...@@ -588,6 +588,12 @@ static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y,
clip->x2 = max_t(u32, clip->x2, x + width); clip->x2 = max_t(u32, clip->x2, x + width);
clip->y2 = max_t(u32, clip->y2, y + height); clip->y2 = max_t(u32, clip->y2, y + height);
spin_unlock_irqrestore(&helper->damage_lock, flags); spin_unlock_irqrestore(&helper->damage_lock, flags);
}
static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y,
u32 width, u32 height)
{
drm_fb_helper_add_damage_clip(helper, x, y, width, height);
schedule_work(&helper->damage_work); schedule_work(&helper->damage_work);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment