Skip to content

Commit fda5209

Browse files
committed
drm/msm: provide fb_dirty implemenation
Since commit 93e81e3 ("drm/fb_helper: Minimize damage-helper overhead") the drm_fb_helper_funcs::fb_dirty helper is required for proper dirty/damage processing. The drm/msm driver requires that to function to let CMD panels to work. Use simplified version of drm_fbdev_generic_helper_fb_dirty() to fix support for CMD mode panels. Reported-by: Degdag Mohamed <degdagmohamed@gmail.com> Fixes: 93e81e3 ("drm/fb_helper: Minimize damage-helper overhead") Cc: Thomas Zimmermann <tzimmermann@suse.de> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Patchwork: https://patchwork.freedesktop.org/patch/542002/ Link: https://lore.kernel.org/r/20230612031616.3620134-1-dmitry.baryshkov@linaro.org Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
1 parent 155fa3a commit fda5209

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

drivers/gpu/drm/msm/msm_fbdev.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,28 @@ static int msm_fbdev_create(struct drm_fb_helper *helper,
139139
return ret;
140140
}
141141

142+
static int msm_fbdev_fb_dirty(struct drm_fb_helper *helper,
143+
struct drm_clip_rect *clip)
144+
{
145+
struct drm_device *dev = helper->dev;
146+
int ret;
147+
148+
/* Call damage handlers only if necessary */
149+
if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2))
150+
return 0;
151+
152+
if (helper->fb->funcs->dirty) {
153+
ret = helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, clip, 1);
154+
if (drm_WARN_ONCE(dev, ret, "Dirty helper failed: ret=%d\n", ret))
155+
return ret;
156+
}
157+
158+
return 0;
159+
}
160+
142161
static const struct drm_fb_helper_funcs msm_fb_helper_funcs = {
143162
.fb_probe = msm_fbdev_create,
163+
.fb_dirty = msm_fbdev_fb_dirty,
144164
};
145165

146166
/*

0 commit comments

Comments
 (0)