@@ -157,12 +157,18 @@ int drm_atomic_helper_dirtyfb(struct drm_framebuffer *fb,
retry:
drm_for_each_plane(plane, fb->dev) {
struct drm_plane_state *plane_state;
+ bool match;
ret = drm_modeset_lock(&plane->mutex, state->acquire_ctx);
if (ret)
goto out;
- if (plane->state->fb != fb) {
+ match = plane->state->fb == fb;
+ /* Check if objs match to handle dirty buffers of cursors */
+ if (plane->type == DRM_PLANE_TYPE_CURSOR && plane->state->fb)
+ match |= fb->obj[0] == plane->state->fb->obj[0];
+
+ if (!match) {
drm_modeset_unlock(&plane->mutex);
continue;
}
Cursors don't have a framebuffer so the fb comparisson was always failing and atomic state was being committed without any plane state. So here checking if objects match when checking cursors. Fixes: b9fc5e01d1ce ("drm: Add helper to implement legacy dirtyfb") Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Deepak Rawat <drawat@vmware.com> Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com> --- drivers/gpu/drm/drm_damage_helper.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)