From patchwork Thu Aug 1 11:19:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikas C Sajjan X-Patchwork-Id: 2837523 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 341399F3B8 for ; Fri, 2 Aug 2013 05:54:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 38625201B4 for ; Fri, 2 Aug 2013 05:54:39 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id F2EF720171 for ; Fri, 2 Aug 2013 05:54:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C34F7E646F for ; Thu, 1 Aug 2013 22:54:37 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E4BEE5D0D for ; Thu, 1 Aug 2013 04:19:43 -0700 (PDT) Received: by mail-pd0-f170.google.com with SMTP id x10so1909170pdj.29 for ; Thu, 01 Aug 2013 04:19:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=185x51dJslGVRsw4slrn0FL62nlB4RZwHhFlMWp4XzY=; b=STMl7YZMB0esyWw4WyJmvviXWzEqddtHN6VIPvw3rG35IGTNGvqq6w9lyVdn5Lg+Uy jCAKUOOD5cPUSOcAXAslmPmuaAQYA98NVF7eFr2e8QI/jc7xq+dhEM6XUiFTK+JC7w6g pp8TUZfp0Z8n6fzYCE0zntmFS7iaazlIza4E0VWwVl28EBK3nrsiq2iqy9KT7aHSKH7s 9sV6BdRTR8qCnXOsBwCLbpIO6OcEvcNpXoBGhsnNWmq9NKfUQo2FnxbQSLfwx+6Mo4a9 IW3q8E3vuVqU/U9CwGjNapCoi/WCcJ+QdMcGvIpG3jwSr01kSYba1phLm8ay7Gr/GJdp hlZQ== X-Received: by 10.66.120.145 with SMTP id lc17mr3315937pab.182.1375355982989; Thu, 01 Aug 2013 04:19:42 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id eq5sm3502220pbc.15.2013.08.01.04.19.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 01 Aug 2013 04:19:41 -0700 (PDT) From: Vikas Sajjan To: linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/exynos: Add check for IOMMU while passing physically continous memory flag Date: Thu, 1 Aug 2013 16:49:32 +0530 Message-Id: <1375355972-25276-1-git-send-email-vikas.sajjan@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQnX2Wdj81NwenYunwBwn6z4vMrJW8szgAhucKUZQmU3Zwuxmz2urExAPD1rJo8/PWwNcpC1 X-Mailman-Approved-At: Thu, 01 Aug 2013 22:42:52 -0700 Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, kgene.kim@samsung.com, arun.kk@samsung.com, linux-media@vger.kernel.org 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 X-Spam-Status: No, score=-5.7 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 While trying to get boot-logo up on exynos5420 SMDK which has eDP panel connected with resolution 2560x1600, following error occured even with IOMMU enabled: [0.880000] [drm:lowlevel_buffer_allocate] *ERROR* failed to allocate buffer. [0.890000] [drm] Initialized exynos 1.0.0 20110530 on minor 0 This patch fixes the issue by adding a check for IOMMU. Signed-off-by: Vikas Sajjan Signed-off-by: Arun Kumar --- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 8e60bd6..2a86666 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "exynos_drm_drv.h" #include "exynos_drm_fb.h" @@ -143,6 +144,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, struct platform_device *pdev = dev->platformdev; unsigned long size; int ret; + unsigned int flag; DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d\n", sizes->surface_width, sizes->surface_height, @@ -166,7 +168,12 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, size = mode_cmd.pitches[0] * mode_cmd.height; /* 0 means to allocate physically continuous memory */ - exynos_gem_obj = exynos_drm_gem_create(dev, 0, size); + if (!is_drm_iommu_supported(dev)) + flag = 0; + else + flag = EXYNOS_BO_NONCONTIG; + + exynos_gem_obj = exynos_drm_gem_create(dev, flag, size); if (IS_ERR(exynos_gem_obj)) { ret = PTR_ERR(exynos_gem_obj); goto err_release_framebuffer;