Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e8985a8 authored by Tomi Valkeinen's avatar Tomi Valkeinen Committed by Dave Airlie
Browse files

drm: fix fb refcount issue with atomic modesetting



After commit 027b3f8b ("drm/modes: stop
handling framebuffer special") extra fb refs are left around when doing
atomic modesetting.

The problem is that the new drm_property_change_valid_get() does not
return anything in the '**ref' parameter, which causes
drm_property_change_valid_put() to do nothing.

For some reason this doesn't cause problems with legacy API.

Also, previously the code only set the 'ref' variable for fbs, with this
patch the 'ref' is set for all objects.

Fixes: 027b3f8b ("drm/modes: stop handling framebuffer special")
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 6709887c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4839,7 +4839,8 @@ bool drm_property_change_valid_get(struct drm_property *property,
		if (value == 0)
			return true;

		return _object_find(property->dev, value, property->values[0]) != NULL;
		*ref = _object_find(property->dev, value, property->values[0]);
		return *ref != NULL;
	}

	for (i = 0; i < property->num_values; i++)