From patchwork Wed May 7 11:51:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Sharma X-Patchwork-Id: 4127421 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 1D7E6BFF02 for ; Wed, 7 May 2014 12:30:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 447D22010F for ; Wed, 7 May 2014 12:30:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id ED82E2024D for ; Wed, 7 May 2014 12:29:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5C9366E4F9; Wed, 7 May 2014 05:29:56 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id BCD1E6ECB9 for ; Wed, 7 May 2014 04:52:29 -0700 (PDT) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N5700BSQCZGBH60@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 07 May 2014 20:52:28 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 5A.AF.11120.C7E1A635; Wed, 07 May 2014 20:52:28 +0900 (KST) X-AuditID: cbfee68f-b7eff6d000002b70-f7-536a1e7c9a1e Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id BE.6F.25708.C7E1A635; Wed, 07 May 2014 20:52:28 +0900 (KST) Received: from localhost.localdomain ([107.108.83.245]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N5700G7RCZ1JG20@mmp1.samsung.com>; Wed, 07 May 2014 20:52:28 +0900 (KST) From: Rahul Sharma To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: allocate non-contigous buffers when iommu is enabled Date: Wed, 07 May 2014 17:21:29 +0530 Message-id: <1399463489-6925-1-git-send-email-rahul.sharma@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMLMWRmVeSWpSXmKPExsWyRsSkWrdGLivY4NxMfYsrX9+zWUy6P4HF 4vuuL+wWM87vY7JY+CLeYsqiw6wObB47Z91l97jffZzJo2/LKkaPz5vkAliiuGxSUnMyy1KL 9O0SuDL+X3/OVPCWv2Ll7GbWBsZFvF2MnBwSAiYSt7ZcYIKwxSQu3FvP1sXIxSEksJRRYs/p w+xdjBxgRVd3yUPEFzFKfP05gQnCaWeSuPJxFRtIN5uArsTsg88YQWwRAWWJvxNXMYIUMQv0 MUp8uvWdGSQhLBAs8eriT7AGFgFVifX3XrOC2LwC7hIb189lgtimIDFnkg1Ir4TAdzaJG3Nm skPUC0h8m3yIBaJGVmLTAWaIqyUlDq64wTKBUXABI8MqRtHUguSC4qT0ImO94sTc4tK8dL3k /NxNjMAAPf3vWf8OxrsHrA8xJgONm8gsJZqcDwzwvJJ4Q2MzIwtTE1NjI3NLM9KElcR57z9M ChISSE8sSc1OTS1ILYovKs1JLT7EyMTBKdXAuE9xyuodhUfqHHdGJz7Q5zHZcUph4lbja49e n/TyzGy6ySPx/sirE+zvQx7PC3Wxe3769gXPqwE71xt06fZVb7xxklUyapPFX0+DMu2XUbaa L3dMU2N8pbh22tdHISKGn/Vk1gR1lXH86efm5tPkMbc2iZugttniyAmxa+o6jAXHo2ynbGoq UWIpzkg01GIuKk4EAGZD6XlmAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrAIsWRmVeSWpSXmKPExsVy+t9jAd0auaxgg4/N6hZXvr5ns5h0fwKL xfddX9gtZpzfx2Sx8EW8xZRFh1kd2Dx2zrrL7nG/+ziTR9+WVYwenzfJBbBENTDaZKQmpqQW KaTmJeenZOal2yp5B8c7x5uaGRjqGlpamCsp5CXmptoqufgE6Lpl5gAtV1IoS8wpBQoFJBYX K+nbYZoQGuKmawHTGKHrGxIE12NkgAYS1jBm/L/+nKngLX/FytnNrA2Mi3i7GDk4JARMJK7u ku9i5AQyxSQu3FvP1sXIxSEksIhR4uvPCUwQTjuTxJWPq9hAqtgEdCVmH3zGCGKLCChL/J24 ihGkiFmgj1Hi063vzCAJYYFgiVcXf4I1sAioSqy/95oVxOYVcJfYuH4uE8RmBYk5k2wmMHIv YGRYxSiaWpBcUJyUnmukV5yYW1yal66XnJ+7iREc/s+kdzCuarA4xCjAwajEw2vxNiNYiDWx rLgy9xCjBAezkghvN39WsBBvSmJlVWpRfnxRaU5q8SHGZKDlE5mlRJPzgbGZVxJvaGxibmps amliYWJmSZqwkjjvwVbrQCGB9MSS1OzU1ILUIpgtTBycUg2MHnpxUo+WTru077zzjzJOqTu5 089tsvvf+d36xQmZaGujze1Gjdd/Kthy7Q7wmNFjkWDjbv1WxfCM1p9HTn91WSyediXISzx/ cuVt1f5rUrc2/5jKs6vQTKpx49PvQgpS6jwurOvj7oU9jZRzP+4ScV2CJftPW/EaYae1M42O WIswLP3w3uawEktxRqKhFnNRcSIAPqa4PsMCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-Mailman-Approved-At: Wed, 07 May 2014 05:29:55 -0700 Cc: linux-samsung-soc@vger.kernel.org, joshi@samsung.com, Rahul Sharma X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, 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 From: Rahul Sharma Allow to allocate non-contigous buffers when iommu is enabled. Currently, it tries to allocates contigous buffer which consistently fail for large buffers and then fall back to non contigous. Apart from being slow, this implementation is also very noisy and fills the screen with alloc fail logs. Change-Id: I523e95aa308122ed2edc55e065ae6eb8be996541 Signed-off-by: Rahul Sharma Reviewed-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 5d88924..7136945 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -624,22 +624,20 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, args->pitch = args->width * ((args->bpp + 7) / 8); args->size = args->pitch * args->height; - exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG | - EXYNOS_BO_WC, args->size); - /* - * If physically contiguous memory allocation fails and if IOMMU is - * supported then try to get buffer from non physically contiguous - * memory area. - */ - if (IS_ERR(exynos_gem_obj) && is_drm_iommu_supported(dev)) { - dev_warn(dev->dev, "contiguous FB allocation failed, falling back to non-contiguous\n"); + if (is_drm_iommu_supported(dev)) { + exynos_gem_obj = exynos_drm_gem_create(dev, + EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC, + args->size); + } else { exynos_gem_obj = exynos_drm_gem_create(dev, - EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC, - args->size); + EXYNOS_BO_CONTIG | EXYNOS_BO_WC, + args->size); } - if (IS_ERR(exynos_gem_obj)) + if (IS_ERR(exynos_gem_obj)) { + dev_warn(dev->dev, "FB allocation failed.\n"); return PTR_ERR(exynos_gem_obj); + } ret = exynos_drm_gem_handle_create(&exynos_gem_obj->base, file_priv, &args->handle);