From patchwork Tue Feb 19 15:18:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 2163291 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 8CFECDF24C for ; Tue, 19 Feb 2013 15:18:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C909E6556 for ; Tue, 19 Feb 2013 07:18:27 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by gabe.freedesktop.org (Postfix) with ESMTP id 64C29E5CD5 for ; Tue, 19 Feb 2013 07:18:13 -0800 (PST) Received: from mailbox.adnet.avionic-design.de (mailbox.avionic-design.de [109.75.18.3]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0LeQDB-1UfWfc2aY1-00qX9B; Tue, 19 Feb 2013 16:18:10 +0100 Received: from localhost (localhost [127.0.0.1]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id 9F20028C033D; Tue, 19 Feb 2013 16:18:08 +0100 (CET) X-Virus-Scanned: amavisd-new at avionic-design.de Received: from mailbox.adnet.avionic-design.de ([127.0.0.1]) by localhost (mailbox.avionic-design.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eUGY2jlGyW7G; Tue, 19 Feb 2013 16:18:07 +0100 (CET) Received: from mailman.adnet.avionic-design.de (mailman.adnet.avionic-design.de [172.20.31.172]) by mailbox.adnet.avionic-design.de (Postfix) with ESMTP id 9633A2A28128; Tue, 19 Feb 2013 16:18:07 +0100 (CET) Received: from localhost (avionic-0098.adnet.avionic-design.de [172.20.31.233]) by mailman.adnet.avionic-design.de (Postfix) with ESMTP id DD927100425; Tue, 19 Feb 2013 16:18:02 +0100 (CET) From: Thierry Reding To: Dave Airlie Subject: [PATCH] drm: Keep a reference to the active plane framebuffer Date: Tue, 19 Feb 2013 16:18:07 +0100 Message-Id: <1361287087-32035-1-git-send-email-thierry.reding@avionic-design.de> X-Mailer: git-send-email 1.8.1.2 X-Provags-ID: V02:K0:pnjHUuq4Awc7fEFtHMngp7Y/OJ4fqVJ+Ld9eNcHl3LC /BONOtNcq5V4ydma6geJDEOF0UdL0xw8mF9OMPJ/tFO8DYIDCF 0eUb2/lkyl0uT/VGUj/a5PnDPJ8KClbyn7WuSNBgn5Ylp6oYyR l5dEWAGxUW6ZM+/qkipE5eGycJ4emYATEx2A2ZBfM4z4tEr6bT Q931zFhti8ay+aFKk1bFZZLVuh5O5UUqgc5gs14uDEkR9Akow9 ol04G9lxPP2X/ccJYCYGVTZENPjqGop3XreFxT1379Kfq3TSFp OqhDF14JHQeDdaChE/Hfnv2Bem01pHoDyiDaJromZA4UJhqWbG Rt8DnDq/Vs3QwtVk1zZrCixzyUUMbp+q8MG/GmE0z/7wQwFLet 1YgNT+BAXDuSmx9BHP0BoJbF6UhHdkkwn1t3UDD6nPT6/v6YEX hpaT2 Cc: Daniel Vetter , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org When updating a plane, the DRM core always sets the plane's framebuffer to NULL. This in turn will cause the reference count on the plane's active framebuffer to become unbalanced because on the next update, the old framebuffer will be NULL. Signed-off-by: Thierry Reding --- drivers/gpu/drm/drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index d06ec7e..b235fa0 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1984,9 +1984,9 @@ int drm_mode_setplane(struct drm_device *dev, void *data, plane_req->src_w, plane_req->src_h); if (!ret) { old_fb = plane->fb; + plane->fb = fb; fb = NULL; plane->crtc = crtc; - plane->fb = fb; } drm_modeset_unlock_all(dev);