From patchwork Sun May 26 18:03:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrik Jakobsson X-Patchwork-Id: 2616721 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 3A2F93FD4E for ; Sun, 26 May 2013 18:05:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 18927E5EC5 for ; Sun, 26 May 2013 11:05:55 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com [209.85.217.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C4C3E5F42 for ; Sun, 26 May 2013 11:04:05 -0700 (PDT) Received: by mail-lb0-f171.google.com with SMTP id v20so6129739lbc.16 for ; Sun, 26 May 2013 11:04:04 -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=4Y4I4lb/MKZgDeQa3ny90hvuE3aRc3QbutJzXJX5PP0=; b=Sb2kK+nOnnRQzk5yP7t74OHz9BY+8Cv6tGmoEQDmw7SDjAFfEGkD54wz0tHD6EtpCT zNH+nbxQk9lrSCSaw0nO1MFnoEZMFSusvGlJCvqJziHwOycAXuH54jvX4A65+nWVQOxa lV2BWepPKc54kqZktMbB6WqsbaULgu6YdM+pg06sIXBp8K5O1FpvhQvaBO9djtP/iDXS Hgbkzgtp24xnnAwoRh+/n54AMZ6Kpk2/USdon9d0cYD3XZe+x83RaySZd3KYzwhdsRrf +LZfVB3uVFunssVEmNFV1YaBqLC7x4Rf20JE2XcbxTd55LhKU7fY2B0D6nJ14uF32L+X 1q/w== X-Received: by 10.112.17.7 with SMTP id k7mr12562219lbd.124.1369591442437; Sun, 26 May 2013 11:04:02 -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 7sm3250944lax.1.2013.05.26.11.04.01 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 May 2013 11:04:01 -0700 (PDT) From: Patrik Jakobsson To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/gma500: Unpin framebuffer when destroying it Date: Sun, 26 May 2013 20:03:53 +0200 Message-Id: <1369591435-1691-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 A framebuffer is pinned when it's set as pipe base, so we also need to unpin it when it's destroyed. Some framebuffers are never used as scanout (no mode set on them) so if the pin count is less than one, no unpinning is needed. 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/framebuffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c index 8b1b6d9..1a11b69 100644 --- a/drivers/gpu/drm/gma500/framebuffer.c +++ b/drivers/gpu/drm/gma500/framebuffer.c @@ -668,6 +668,11 @@ static void psb_user_framebuffer_destroy(struct drm_framebuffer *fb) /* Let DRM do its clean up */ drm_framebuffer_cleanup(fb); + + /* Unpin any psb_intel_pipe_set_base() pinning */ + if (r->in_gart > 0) + psb_gtt_unpin(r); + /* We are no longer using the resource in GEM */ drm_gem_object_unreference_unlocked(&r->gem); kfree(fb);