From patchwork Thu Nov 10 18:23:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikko Perttunen X-Patchwork-Id: 9421957 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 11C3960484 for ; Thu, 10 Nov 2016 18:27:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 22774297D9 for ; Thu, 10 Nov 2016 18:27:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 175E1297FF; Thu, 10 Nov 2016 18:27:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 273D1297D9 for ; Thu, 10 Nov 2016 18:27:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 015316E811; Thu, 10 Nov 2016 18:27:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kapsi.fi (mx1.kapsi.fi [IPv6:2001:1bc8:1004::1:25]) by gabe.freedesktop.org (Postfix) with ESMTPS id 028406E80A for ; Thu, 10 Nov 2016 18:27:42 +0000 (UTC) Received: from dsl-espbrasgw1-54f9c1-183.dhcp.inet.fi ([84.249.193.183] helo=toshino.dhcp.inet.fi) by mail.kapsi.fi with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1c4u4Y-0001Qc-Ez; Thu, 10 Nov 2016 20:27:38 +0200 From: Mikko Perttunen To: thierry.reding@gmail.com Subject: [PATCH 2/8] drm/tegra: Allocate BOs from lower 4G when without IOMMU Date: Thu, 10 Nov 2016 20:23:39 +0200 Message-Id: <20161110182345.31777-3-mperttunen@nvidia.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161110182345.31777-1-mperttunen@nvidia.com> References: <20161110182345.31777-1-mperttunen@nvidia.com> X-SA-Exim-Connect-IP: 84.249.193.183 X-SA-Exim-Mail-From: mperttunen@nvidia.com X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, Mikko Perttunen X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 64-bit Tegras, buffer object memory allocation may return memory above 4G that units behind Host1x cannot access. Add the GFP_DMA flag to these allocation when IOMMU is not enabled to ensure units can always access BO memory. Signed-off-by: Mikko Perttunen --- drivers/gpu/drm/tegra/gem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 19bf9cd..e36e6c5 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -233,7 +233,7 @@ static int tegra_bo_alloc(struct drm_device *drm, struct tegra_bo *bo) size_t size = bo->gem.size; bo->vaddr = dma_alloc_wc(drm->dev, size, &bo->paddr, - GFP_KERNEL | __GFP_NOWARN); + GFP_KERNEL | GFP_DMA | __GFP_NOWARN); if (!bo->vaddr) { dev_err(drm->dev, "failed to allocate buffer of size %zu\n",