Checking if damage clip is valid is common to all fb helpers. Makes more sense to check it in higher level than adding into all helpers. Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> Cc: Thomas Zimmermann <tzimmermann@xxxxxxx> Cc: Jani Nikula <jani.nikula@xxxxxxxxx> Signed-off-by: Jouni Högander <jouni.hogander@xxxxxxxxx> --- drivers/gpu/drm/drm_fb_helper.c | 4 ++++ drivers/gpu/drm/drm_fbdev_generic.c | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index b3a731b9170a..78c889dbc610 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -384,6 +384,10 @@ static void drm_fb_helper_fb_dirty(struct drm_fb_helper *helper) clip->x2 = clip->y2 = 0; spin_unlock_irqrestore(&helper->damage_lock, flags); + /* Call damage handlers only if necessary */ + if (!(clip_copy.x1 < clip_copy.x2 && clip_copy.y1 < clip_copy.y2)) + return; + ret = helper->funcs->fb_dirty(helper, &clip_copy); if (ret) goto err; diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 0a4c160e0e58..6c6bb0dd2ea8 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -334,10 +334,6 @@ static int drm_fbdev_fb_dirty(struct drm_fb_helper *helper, struct drm_clip_rect if (!drm_fbdev_use_shadow_fb(helper)) return 0; - /* Call damage handlers only if necessary */ - if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2)) - return 0; - if (helper->buffer) { ret = drm_fbdev_damage_blit(helper, clip); if (drm_WARN_ONCE(dev, ret, "Damage blitter failed: ret=%d\n", ret)) -- 2.34.1