From patchwork Sat Apr 14 11:52:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prathyush X-Patchwork-Id: 7873 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id D3A1323E49 for ; Mon, 16 Apr 2012 15:39:29 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 824E9A186AE for ; Mon, 16 Apr 2012 15:39:29 +0000 (UTC) Received: by iage36 with SMTP id e36so10369018iag.11 for ; Mon, 16 Apr 2012 08:39:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:x-auditid :from:to:date:message-id:x-mailer:in-reply-to:references :x-brightmail-tracker:x-tm-as-mml:x-mailman-approved-at:cc:subject :x-beenthere:x-mailman-version:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-gm-message-state; bh=x4jxQpXDsSukF0yz6hhlwLZFtQhLILVQJ6AtbkGHd6U=; b=kTB+puRAFjWvD7dlPfdgbYKTEYPKoT+L1ySJPIb0xfIHfu7dLvh/cJQqbr3tiKDnny rJl0AVkrAFqvSMGJPPP6nhl1JI3M0m7SwQskb/JP+HhR9viSCfVNcCPuZeEL3YsUw3qQ k729s6OjrS1yJKghX+51sYrIuwwA32XEeNow3WAYp4/3vGi8N82BfqJUKTNLCviNWEPF F3EM77f18P77F+MgwUXBVJjkKE/dwjmcKz4HQ4KY2xLME5aGuFa10Ax7a6ueo1JsspBg xdpGr5oU88NYuc6RfhDtXzvGnqxZ3UVh9+CSu0LQN87YF+DQDMv3HBrWMFzPgH/9W+IX eTww== Received: by 10.50.135.36 with SMTP id pp4mr6447357igb.19.1334590768801; Mon, 16 Apr 2012 08:39:28 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.137.198 with SMTP id x6csp84608ibt; Mon, 16 Apr 2012 08:39:27 -0700 (PDT) Received: by 10.180.87.106 with SMTP id w10mr14065431wiz.2.1334590766513; Mon, 16 Apr 2012 08:39:26 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id r17si8626149wiw.31.2012.04.16.08.39.25; Mon, 16 Apr 2012 08:39:26 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SJo1T-0002P5-MT; Mon, 16 Apr 2012 15:39:23 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SJ1Ho-0007BF-7V for linaro-mm-sig@lists.linaro.org; Sat, 14 Apr 2012 11:37:00 +0000 Received: from epcpsbgm1.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0M2G0074HW9H2760@mailout4.samsung.com> for linaro-mm-sig@lists.linaro.org; Sat, 14 Apr 2012 20:36:59 +0900 (KST) X-AuditID: cbfee61a-b7c51ae000004a99-e4-4f89615b2933 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 7D.90.19097.B51698F4; Sat, 14 Apr 2012 20:36:59 +0900 (KST) Received: from localhost.localdomain ([107.108.73.106]) by mmp2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTPA id <0M2G00CFAW941S00@mmp2.samsung.com> for linaro-mm-sig@lists.linaro.org; Sat, 14 Apr 2012 20:36:59 +0900 (KST) From: Prathyush To: dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Date: Sat, 14 Apr 2012 17:22:13 +0530 Message-id: <1334404333-24592-5-git-send-email-prathyush.k@samsung.com> X-Mailer: git-send-email 1.7.0.4 In-reply-to: <1334404333-24592-1-git-send-email-prathyush.k@samsung.com> References: <1334404333-24592-1-git-send-email-prathyush.k@samsung.com> X-Brightmail-Tracker: AAAAAA== X-TM-AS-MML: No X-Mailman-Approved-At: Mon, 16 Apr 2012 15:39:19 +0000 Cc: inki.dae@samsung.com, sunilm@samsung.com, subash.rp@samsung.com, prashanth.g@samsung.com, prathyush.k@samsung.com Subject: [Linaro-mm-sig] [PATCH 4/4] [RFC] drm: Releasing FBs before releasing GEM objects during drm_release X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQn66djYJTr+jRMIrQH9PUk0AIIt0+Kz28OTR+YTZDmB0V1P9HtDPQ1pFHSTEE3PmmiyiqYE During DRM release, all the FBs and gem objects are released. If a gem object is being used as a FB and set to a crtc, it must not be freed before releasing the framebuffer first. If FBs are released first, the crtc using the FB is disabled first so now the GEM object can be freed safely. The CRTC will be enabled again when the driver restores fbdev mode. Signed-off-by: Prathyush K --- drivers/gpu/drm/drm_fops.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 6263b01..f6525ef 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c @@ -498,12 +498,12 @@ int drm_release(struct inode *inode, struct file *filp) drm_events_release(file_priv); - if (dev->driver->driver_features & DRIVER_GEM) - drm_gem_release(dev, file_priv); - if (dev->driver->driver_features & DRIVER_MODESET) drm_fb_release(file_priv); + if (dev->driver->driver_features & DRIVER_GEM) + drm_gem_release(dev, file_priv); + mutex_lock(&dev->ctxlist_mutex); if (!list_empty(&dev->ctxlist)) { struct drm_ctx_list *pos, *n;