From patchwork Wed Dec 4 13:45:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 3282661 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 011B6C0D4A for ; Wed, 4 Dec 2013 13:46:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 402A6204A7 for ; Wed, 4 Dec 2013 13:45:57 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2BD7F2041D for ; Wed, 4 Dec 2013 13:45:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 81AD3FB797; Wed, 4 Dec 2013 05:45:54 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qe0-f45.google.com (mail-qe0-f45.google.com [209.85.128.45]) by gabe.freedesktop.org (Postfix) with ESMTP id 99188FB797 for ; Wed, 4 Dec 2013 05:45:52 -0800 (PST) Received: by mail-qe0-f45.google.com with SMTP id 6so16136519qea.32 for ; Wed, 04 Dec 2013 05:45:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=T9T8zccdbSRdybAgtQ4Ulcz17VaiHjTrmTsY+BY/cvU=; b=JwclvktvRry9k/Vb+s9BUZiOPKLNro155wt9neIiNHSVVQuKW5xeCY6Rd3H7QpQUUU /qZyrFNOj3iHaRQY0wl8sevMnZ6sFPk5G9UqBvZReppc0NBw3Sby281FZM97P5+Fu8Ei /aCc1NXhcHkWUD5EYvldmahDcB+wHLJ0XECfoLqL2RrlXQpm1OMz1UM7VQyncped1MMd BZrM4ad3xIAgAGVzUIilKz7GYSeu8bm3XrqTemIy2+BOl42JFZjNbzVsbJETOr4yS2mi 3+uRThs2oqw46sX4RI0vbqbCTK7k9PFD7lj492CMcIFDcsuWXl4u29tbxY3+xEs3p/+L /dQA== X-Received: by 10.224.88.134 with SMTP id a6mr37750390qam.73.1386164750807; Wed, 04 Dec 2013 05:45:50 -0800 (PST) Received: from localhost (pool-108-20-244-90.bstnma.east.verizon.net. [108.20.244.90]) by mx.google.com with ESMTPSA id g10sm17864877qaf.9.2013.12.04.05.45.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Dec 2013 05:45:50 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH] udl: fix issue with imported prime buffers Date: Wed, 4 Dec 2013 08:45:43 -0500 Message-Id: <1386164743-22521-1-git-send-email-robdclark@gmail.com> X-Mailer: git-send-email 1.8.4.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@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 5dc9e1e8 was a bit over-ambitious, and accidentially removed handling for imported prime buffers. Signed-off-by: Rob Clark --- drivers/gpu/drm/udl/udl_gem.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/udl/udl_gem.c b/drivers/gpu/drm/udl/udl_gem.c index 24ffbe9..8d67b94 100644 --- a/drivers/gpu/drm/udl/udl_gem.c +++ b/drivers/gpu/drm/udl/udl_gem.c @@ -125,6 +125,12 @@ static int udl_gem_get_pages(struct udl_gem_object *obj, gfp_t gfpmask) static void udl_gem_put_pages(struct udl_gem_object *obj) { + if (obj->base.import_attach) { + drm_free_large(obj->pages); + obj->pages = NULL; + return; + } + drm_gem_put_pages(&obj->base, obj->pages, false, false); obj->pages = NULL; }