aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Zimmermann <[email protected]>2022-11-15 12:58:14 +0100
committerThomas Zimmermann <[email protected]>2022-11-16 13:06:58 +0100
commitb1be5ba29374aaf45142eddef85ce6cfd54c16e8 (patch)
tree0e778efacd9b87d979b9d5168e0c208cf2ac589e
parentb230555f3257f197dd98641ef6ebaf778b52dd51 (diff)
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: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index e0384f967c0b..178615565760 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -576,8 +576,8 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
}
EXPORT_SYMBOL(drm_fb_helper_fini);
-static void drm_fb_helper_damage(struct drm_fb_helper *helper, u32 x, u32 y,
- u32 width, u32 height)
+static void drm_fb_helper_add_damage_clip(struct drm_fb_helper *helper, u32 x, u32 y,
+ u32 width, u32 height)
{
struct drm_clip_rect *clip = &helper->damage_clip;
unsigned long flags;
@@ -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->y2 = max_t(u32, clip->y2, y + height);
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);
}