From patchwork Sat Jun 8 19:01:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrik Jakobsson X-Patchwork-Id: 2692941 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 58ADDDF24C for ; Sat, 8 Jun 2013 19:09:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBD04E6193 for ; Sat, 8 Jun 2013 12:09:39 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 0DE0AE5C40 for ; Sat, 8 Jun 2013 12:02:08 -0700 (PDT) Received: by mail-la0-f41.google.com with SMTP id fn20so4683343lab.28 for ; Sat, 08 Jun 2013 12:02:07 -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; bh=T/NMAx5DC7X9eW3fzTgbNoQfCRHiua0ilPWH9upTmV4=; b=Ol6Rg0CPXfjDfzfOvmC4gwkQkXJtUzksw25PPgLTz7ddPlbT/59duNcAe3+fBFFIGa evkHHJHV2hmEfmDStBHimRQizjq6gAdjEhkAc3I7kTtRYA1Rbpbygk7AqwacKHNpfQ23 cCbai2qchPLQjSACj0BcnsGnq5kds7g0BNYyB4uOD3y3LPO0fDqxd6KEcd162gwEVQkn 2TPEEQ7opmDE7JpJLPSH92vXW0AYyRv8UClCGpU0rRRJyPMC7Gb33Dn9gVc8pI09ZpKF eLl1w94y3I2ZZfMoUh5O9ReejOlmBZN3/X/XL5c/irXFpvWdHytijxAFm/NuzzqQLSt5 6Ajw== X-Received: by 10.152.88.42 with SMTP id bd10mr1824726lab.32.1370718127574; Sat, 08 Jun 2013 12:02:07 -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.06 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 08 Jun 2013 12:02:06 -0700 (PDT) From: Patrik Jakobsson To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/gma500/psb: Unpin framebuffer on crtc disable Date: Sat, 8 Jun 2013 21:01:58 +0200 Message-Id: <1370718119-12903-1-git-send-email-patrik.r.jakobsson@gmail.com> X-Mailer: git-send-email 1.8.1.2 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 Poulsbo. 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 Reviewed-by: Daniel Vetter --- drivers/gpu/drm/gma500/psb_intel_display.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c index 6e8f42b..12d129e 100644 --- a/drivers/gpu/drm/gma500/psb_intel_display.c +++ b/drivers/gpu/drm/gma500/psb_intel_display.c @@ -1150,6 +1150,19 @@ static void psb_intel_crtc_destroy(struct drm_crtc *crtc) kfree(psb_intel_crtc); } +static void psb_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 psb_intel_helper_funcs = { .dpms = psb_intel_crtc_dpms, .mode_fixup = psb_intel_crtc_mode_fixup, @@ -1157,6 +1170,7 @@ const struct drm_crtc_helper_funcs psb_intel_helper_funcs = { .mode_set_base = psb_intel_pipe_set_base, .prepare = psb_intel_crtc_prepare, .commit = psb_intel_crtc_commit, + .disable = psb_intel_crtc_disable, }; const struct drm_crtc_funcs psb_intel_crtc_funcs = {