Skip to content

Commit 1e8985a

Browse files
tombaairlied
authored andcommitted
drm: fix fb refcount issue with atomic modesetting
After commit 027b3f8 ("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: 027b3f8 ("drm/modes: stop handling framebuffer special") Signed-off-by: Tomi Valkeinen <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
1 parent 6709887 commit 1e8985a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/drm_crtc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4839,7 +4839,8 @@ bool drm_property_change_valid_get(struct drm_property *property,
48394839
if (value == 0)
48404840
return true;
48414841

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

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

0 commit comments

Comments
 (0)