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

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
...@@ -4839,7 +4839,8 @@ bool drm_property_change_valid_get(struct drm_property *property, ...@@ -4839,7 +4839,8 @@ bool drm_property_change_valid_get(struct drm_property *property,
if (value == 0) if (value == 0)
return true; 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++) for (i = 0; i < property->num_values; i++)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment