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: 693443 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3tFBNv4Fywz9t1h for ; Fri, 11 Nov 2016 05:27:43 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755742AbcKJS1l (ORCPT ); Thu, 10 Nov 2016 13:27:41 -0500 Received: from mail.kapsi.fi ([217.30.184.167]:55477 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755024AbcKJS1k (ORCPT ); Thu, 10 Nov 2016 13:27:40 -0500 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 Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org, airlied@linux.ie, Mikko Perttunen 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 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 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",