Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: fix fb refcount issue with atomic modesetting

After commit 027b3f8ba9277410c3191d72d1ed2c6146d8a668 ("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: 027b3f8ba927 ("drm/modes: stop handling framebuffer special")
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by

Tomi Valkeinen and committed by
Dave Airlie
1e8985a8 6709887c

+2 -1
+2 -1
drivers/gpu/drm/drm_crtc.c
··· 4839 4839 if (value == 0) 4840 4840 return true; 4841 4841 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; 4843 4844 } 4844 4845 4845 4846 for (i = 0; i < property->num_values; i++)