From patchwork Fri May 31 18:45:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2645341 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 2B89F3FD4E for ; Fri, 31 May 2013 18:42:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D74AE6393 for ; Fri, 31 May 2013 11:42:48 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.localdomain (unknown [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id C76ACE5EF9 for ; Fri, 31 May 2013 11:42:38 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 1005) id 366B18874B; Fri, 31 May 2013 18:42:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on shiva.chad-versace.us X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=ham version=3.3.2 Received: from lundgren.jf.intel.com (jfdmzpr05-ext.jf.intel.com [134.134.139.74]) by shiva.localdomain (Postfix) with ESMTPSA id 7BCE488081; Fri, 31 May 2013 18:42:37 +0000 (UTC) From: Ben Widawsky To: Intel GFX Date: Fri, 31 May 2013 11:45:29 -0700 Message-Id: <1370025929-14270-1-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.3 In-Reply-To: <1370024928-3553-2-git-send-email-ben@bwidawsk.net> References: <1370024928-3553-2-git-send-email-ben@bwidawsk.net> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 2/4] [v2] drm/i915: Unbind the fb X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org This is the only place I could find where we don't already unbind the object before freeing it. This change will allow us to have a nice assertion on free about whether or not an object still has pinned pages. v2: Just use the i915 object instead of casting Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/intel_fb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c index 6b7c3ca..bc81de6 100644 --- a/drivers/gpu/drm/i915/intel_fb.c +++ b/drivers/gpu/drm/i915/intel_fb.c @@ -209,6 +209,7 @@ static void intel_fbdev_destroy(struct drm_device *dev, drm_framebuffer_unregister_private(&ifb->base); drm_framebuffer_cleanup(&ifb->base); if (ifb->obj) { + i915_gem_object_unbind(ifb->obj); drm_gem_object_unreference_unlocked(&ifb->obj->base); ifb->obj = NULL; }