aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_crtc.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-06-14 18:13:16 -0400
committerDave Airlie <airlied@redhat.com>2013-06-24 23:04:11 -0400
commit5cef29aa5227e6347145940a7bccde92fd9a1afa (patch)
tree43b7f4fce89084737d5509f03aeb1dd1ae3eeb59 /include/drm/drm_crtc.h
parentcc85e1217f598f342b69dc44710d7a7355513a1b (diff)
drm: fix fb leak in setcrtc
Drivers are allowed (actually have to) disable unrelated crtcs in their ->set_config callback (when we steal all the connectors from that crtc). If they do that they'll clear crtc->fb to NULL. Which results in a refcount leak, since the drm core is keeping track of that reference. To fix this track the old fb of all crtcs and adjust references for all of them. Of course, since we only hold an additional reference for the fb for the current crtc we need to increase refcounts before we drop the old one. This approach has the benefit that it inches us a bit closer to an atomic modeset world, where we want to update the config of all crtcs in one step. This regression has been introduce in the framebuffer refcount conversion, specifically in commit b0d1232589df5575c5971224ac4cb30e7e525884 Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Dec 11 01:07:12 2012 +0100 drm: refcounting for crtc framebuffers Reported-by: Russell King <linux@arm.linux.org.uk> Cc: Russell King <linux@arm.linux.org.uk> Cc: stable@vger.kernel.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r--include/drm/drm_crtc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 9779ea11e63d..b9ddd3d42acf 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -409,6 +409,10 @@ struct drm_crtc {
409 /* framebuffer the connector is currently bound to */ 409 /* framebuffer the connector is currently bound to */
410 struct drm_framebuffer *fb; 410 struct drm_framebuffer *fb;
411 411
412 /* Temporary tracking of the old fb while a modeset is ongoing. Used
413 * by drm_mode_set_config_internal to implement correct refcounting. */
414 struct drm_framebuffer *old_fb;
415
412 bool enabled; 416 bool enabled;
413 417
414 /* Requested mode from modesetting. */ 418 /* Requested mode from modesetting. */