From patchwork Sat Jun 8 19:01:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrik Jakobsson X-Patchwork-Id: 2692951 Return-Path: X-Original-To: patchwork-dri-devel@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 EC3EA3FC23 for ; Sat, 8 Jun 2013 19:10:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF6BEE61A1 for ; Sat, 8 Jun 2013 12:10:36 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-la0-f47.google.com (mail-la0-f47.google.com [209.85.215.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 49AB7E5E69 for ; Sat, 8 Jun 2013 12:02:09 -0700 (PDT) Received: by mail-la0-f47.google.com with SMTP id fe20so4658152lab.34 for ; Sat, 08 Jun 2013 12:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=xJNqeTPN/YdVikAvR2lxctHlZwTCwG3nGUUhwBUhhO8=; b=S+7wvjRPLTavDPXNSkxWIqaM6wEBxDE4VPAQ5QB+dAfBKc22lqjfl3IQYCyWhCpiwV 3DJHW/Tf2jyzeuvg3bWzIemhoXtSjPuwx+JEfXY9ow0qeu/aHcmilaBmjg+BBn8w1RGE 5HLjg7iINnFLhEu2DL8ny2dfRKitCVCxBUdj66zrex48Emi+iMOpjm9y01YS1qFjABim okX+TNcMgLNn8bIDfw5s8hfLjz3elNn05k2KS01xNxPl00TvjiKn+zNduA5IF9BL4a1B YmYFFLzBZHLCCAgSq6D+5MtpgIDDOKc8Tw+rZM6fURx0j0LEL777neNbsRBzseVLc1n1 C8lA== X-Received: by 10.152.5.234 with SMTP id v10mr1830011lav.52.1370718128425; Sat, 08 Jun 2013 12:02:08 -0700 (PDT) Received: from patrik-1201HA.lan (h138n8-oer-a32.ias.bredband.telia.com. [2.248.103.138]) by mx.google.com with ESMTPSA id f8sm2959189lbr.10.2013.06.08.12.02.07 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 08 Jun 2013 12:02:07 -0700 (PDT) From: Patrik Jakobsson To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/gma500/cdv: Unpin framebuffer on crtc disable Date: Sat, 8 Jun 2013 21:01:59 +0200 Message-Id: <1370718119-12903-2-git-send-email-patrik.r.jakobsson@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1370718119-12903-1-git-send-email-patrik.r.jakobsson@gmail.com> References: <1370718119-12903-1-git-send-email-patrik.r.jakobsson@gmail.com> 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 The framebuffer needs to be unpinned in the crtc->disable callback because of previous pinning in psb_intel_pipe_set_base(). This will fix a memory leak where the framebuffer was released but not unpinned properly. This patch only affects Cedarview. Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=889511 Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=812113 Signed-off-by: Patrik Jakobsson --- drivers/gpu/drm/gma500/cdv_intel_display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/gma500/cdv_intel_display.c b/drivers/gpu/drm/gma500/cdv_intel_display.c index 3cfd093..d6742dc 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_display.c +++ b/drivers/gpu/drm/gma500/cdv_intel_display.c @@ -1750,6 +1750,19 @@ static void cdv_intel_crtc_destroy(struct drm_crtc *crtc) kfree(psb_intel_crtc); } +static void cdv_intel_crtc_disable(struct drm_crtc *crtc) +{ + struct gtt_range *gt; + struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; + + crtc_funcs->dpms(crtc, DRM_MODE_DPMS_OFF); + + if (crtc->fb) { + gt = to_psb_fb(crtc->fb)->gtt; + psb_gtt_unpin(gt); + } +} + const struct drm_crtc_helper_funcs cdv_intel_helper_funcs = { .dpms = cdv_intel_crtc_dpms, .mode_fixup = cdv_intel_crtc_mode_fixup, @@ -1757,6 +1770,7 @@ const struct drm_crtc_helper_funcs cdv_intel_helper_funcs = { .mode_set_base = cdv_intel_pipe_set_base, .prepare = cdv_intel_crtc_prepare, .commit = cdv_intel_crtc_commit, + .disable = cdv_intel_crtc_disable, }; const struct drm_crtc_funcs cdv_intel_crtc_funcs = {