From patchwork Fri Feb 15 20:21:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2149901 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 25494DF24C for ; Fri, 15 Feb 2013 20:19:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E582EE5FAC for ; Fri, 15 Feb 2013 12:19:58 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f182.google.com (mail-ea0-f182.google.com [209.85.215.182]) by gabe.freedesktop.org (Postfix) with ESMTP id 69696E5C7B for ; Fri, 15 Feb 2013 12:19:24 -0800 (PST) Received: by mail-ea0-f182.google.com with SMTP id a12so1690575eaa.13 for ; Fri, 15 Feb 2013 12:19:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=knZLzk4iLbu/2nbzN8HQegU9QW1cMuGhJW46PMVwyR0=; b=ht5PphZP/s67rEXthtIbQPqP8yTQk18xIZUBly5uVosGT1R0iFqT+Vk5OM3krcO6kP T4WW2fIpFlzDtZQ7FEGjstvNlb7SJ0lB7egfPS0Snuyz2VtQCl0tXwAdG9lK85Y6IqIi 1ywMaE67JyqU6DSksez7ZIW2RzvJ08OpcLqCY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=knZLzk4iLbu/2nbzN8HQegU9QW1cMuGhJW46PMVwyR0=; b=gOWEcRJfCyBdb4Yom9xQyb4uISf2yQ40xHvX9FWBTO6gzq2AWmoGCFUqZD6ZAeVMzr QCaJIKLRLUBdHk4rluB1ulfMwb7Ef4M13a7Xxk8mH9kqkaWL2yhAtcFs6e6wjgpvs9/H 5OTjO8Si/e8U3BVDcYjJQ7u//VVmg9aIdulNQCNZcYXpYPhZI9SiZnHvs4CtmbymGqTl oDJ6usngd4gWziXSH/8rm0qEjoZohCmwIkbgxo5G4POkW7IirPtJtbXXIBeJBi+4ObX2 kQam6efd/TNsx8aFrzvSc+tl88HSrr3aSo+beGeFrl8wOW1gZReg626zqTWrjca84pGd rbCw== X-Received: by 10.14.207.73 with SMTP id m49mr12114659eeo.24.1360959563210; Fri, 15 Feb 2013 12:19:23 -0800 (PST) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id q5sm85268000eep.11.2013.02.15.12.19.21 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 12:19:22 -0800 (PST) From: Daniel Vetter To: Intel Graphics Development Subject: [PATCH] drm: Don't set the plane->fb to NULL on successfull set_plane Date: Fri, 15 Feb 2013 21:21:37 +0100 Message-Id: <1360959697-23322-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.10.4 X-Gm-Message-State: ALoCoQkz6FFfubzXnpQRlP4D+9Djnc4I8ceJYFd25wDohFlI/pigbMnBIi+jKAW0uzk7D86pA8zg Cc: Daniel Vetter , DRI Development , Rob Clark 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 We need to clear the local variable to get the refcounting right (since the reference drm_mode_setplane holds is transferred to the plane->fb pointer). But should be done _after_ we update the pointer. Breakage introduced in commit 6c2a75325c800de286166c693e0cd33c3a1c5ec8 Author: Daniel Vetter Date: Tue Dec 11 00:59:24 2012 +0100 drm: refcounting for sprite framebuffers Reported-by: Jesse Barnes Cc: Jesse Barnes Cc: Rob Clark Signed-off-by: Daniel Vetter Reviewed-by: Jesse Barnes Reviewed-by: Ville Syrjälä Reviewed-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 826a5ca..1960418 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1982,9 +1982,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; - fb = NULL; plane->crtc = crtc; plane->fb = fb; + fb = NULL; } drm_modeset_unlock_all(dev);