From patchwork Fri Aug 31 11:31:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Imre Deak X-Patchwork-Id: 1392901 Return-Path: X-Original-To: patchwork-intel-gfx@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 13974E0000 for ; Fri, 31 Aug 2012 11:33:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 026CAA0A55 for ; Fri, 31 Aug 2012 04:33:53 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C808A0A2F for ; Fri, 31 Aug 2012 04:31:51 -0700 (PDT) Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 31 Aug 2012 04:31:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,346,1344236400"; d="scan'208";a="187330602" Received: from ideak-desk.fi.intel.com (HELO localhost) ([10.237.72.156]) by azsmga001.ch.intel.com with ESMTP; 31 Aug 2012 04:31:50 -0700 From: Imre Deak To: intel-gfx@lists.freedesktop.org Date: Fri, 31 Aug 2012 14:31:51 +0300 Message-Id: <1346412711-4257-2-git-send-email-imre.deak@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346412711-4257-1-git-send-email-imre.deak@intel.com> References: <1346412711-4257-1-git-send-email-imre.deak@intel.com> Subject: [Intel-gfx] [PATCH xf86-video 2/2] dri: fix leakage of FB when closing the screen 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 Calling drmModeRmFB is only allowed in DRM master mode. Since leaving the VT also drops master mode we need to remove the FB before calling I830LeaveVT. This is only a real leak in case of a server reset, otherwise the server process will exit anyway and the kernel will clean up the FB. Signed-off-by: Imre Deak --- src/intel_driver.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/intel_driver.c b/src/intel_driver.c index c5be679..ca8e530 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -1049,10 +1049,6 @@ static Bool I830CloseScreen(CLOSE_SCREEN_ARGS_DECL) I830UeventFini(scrn); #endif - if (scrn->vtSema == TRUE) { - I830LeaveVT(VT_FUNC_ARGS(0)); - } - DeleteCallback(&FlushCallback, intel_flush_callback, scrn); intel_glamor_close_screen(screen); @@ -1082,6 +1078,10 @@ static Bool I830CloseScreen(CLOSE_SCREEN_ARGS_DECL) intel->front_buffer = NULL; } + if (scrn->vtSema == TRUE) { + I830LeaveVT(VT_FUNC_ARGS(0)); + } + intel_batch_teardown(scrn); if (INTEL_INFO(intel)->gen >= 40)