Skip to content

Commit 9225b33

Browse files
committed
drm/msm: Fix dirtyfb refcounting
refcount_t complains about 0->1 transitions, which isn't *quite* what we wanted. So use dirtyfb==1 to mean that the fb is not connected to any output that requires dirtyfb flushing, so that we can keep the underflow and overflow checking. Fixes: 9e4dde2 ("drm/msm: Avoid dirtyfb stalls on video mode displays (v2)") Signed-off-by: Rob Clark <robdclark@chromium.org> Link: https://lore.kernel.org/r/20220304202146.845566-1-robdclark@gmail.com
1 parent cca9658 commit 9225b33

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/gpu/drm/msm/msm_fb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static int msm_framebuffer_dirtyfb(struct drm_framebuffer *fb,
3737
/* If this fb is not used on any display requiring pixel data to be
3838
* flushed, then skip dirtyfb
3939
*/
40-
if (refcount_read(&msm_fb->dirtyfb) == 0)
40+
if (refcount_read(&msm_fb->dirtyfb) == 1)
4141
return 0;
4242

4343
return drm_atomic_helper_dirtyfb(fb, file_priv, flags, color,
@@ -221,6 +221,8 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev,
221221
goto fail;
222222
}
223223

224+
refcount_set(&msm_fb->dirtyfb, 1);
225+
224226
drm_dbg_state(dev, "create: FB ID: %d (%p)", fb->base.id, fb);
225227

226228
return fb;

0 commit comments

Comments
 (0)