From patchwork Mon Aug 5 09:44:42 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: 18771 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f71.google.com (mail-qa0-f71.google.com [209.85.216.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D6A4D2486D for ; Mon, 5 Aug 2013 09:45:01 +0000 (UTC) Received: by mail-qa0-f71.google.com with SMTP id bq6sf2504951qab.2 for ; Mon, 05 Aug 2013 02:45:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state:x-removed-original-auth:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=B0MdbltWETHU8XDSiuZRg4SzopXsDAKKyX/v0SYDYqk=; b=ilH4ebGLucBa2pNapQx0DwImCN+uGKpVlcKEdT4vgkwGakN4P+o/Xlgqg2nAiR8tlw DzTFwkBGkUagjkCIohENw/YcbI+/Tli7YTl71RzswX3+yIV6ScMQKyGE5SErPNsa0ejV XSM4I5M5MWBenE72PwNS0FtrGn8GCn+UKJiQIT239RXHQz+KVHN86gVcizkP3WjHnoKB BICUNEaURCDgDJpDdFIyoU6FHvnTZp1vmcty2R983m0wsCgUjU09Y2wPQNDp4uOtrx/s BnqGSuKB/+KwBzSrMJiEVGCHBYqZX+BR+EzZ2lfHbAH/ugfB+YzWwcgvTWsqna5CTC7B xJew== X-Received: by 10.236.198.240 with SMTP id v76mr7610046yhn.10.1375695901297; Mon, 05 Aug 2013 02:45:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.52.40 with SMTP id q8ls2583780qeo.1.gmail; Mon, 05 Aug 2013 02:45:01 -0700 (PDT) X-Received: by 10.221.67.9 with SMTP id xs9mr5527394vcb.12.1375695901146; Mon, 05 Aug 2013 02:45:01 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id sy7si1608073vdc.66.2013.08.05.02.45.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 Aug 2013 02:45:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.172; Received: by mail-ve0-f172.google.com with SMTP id oz10so2825089veb.31 for ; Mon, 05 Aug 2013 02:45:01 -0700 (PDT) X-Received: by 10.221.43.70 with SMTP id ub6mr5349012vcb.86.1375695900959; Mon, 05 Aug 2013 02:45:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.11.8 with SMTP id pc8csp78816vcb; Mon, 5 Aug 2013 02:45:00 -0700 (PDT) X-Received: by 10.67.10.45 with SMTP id dx13mr9383678pad.31.1375695899936; Mon, 05 Aug 2013 02:44:59 -0700 (PDT) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by mx.google.com with ESMTPS id bv1si16421727pbb.324.2013.08.05.02.44.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 Aug 2013 02:44:59 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.44 is neither permitted nor denied by best guess record for domain of vikas.sajjan@linaro.org) client-ip=209.85.220.44; Received: by mail-pa0-f44.google.com with SMTP id jh10so3067911pab.31 for ; Mon, 05 Aug 2013 02:44:59 -0700 (PDT) X-Received: by 10.68.143.131 with SMTP id se3mr17113993pbb.39.1375695899446; Mon, 05 Aug 2013 02:44:59 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id tr10sm26437241pbc.22.2013.08.05.02.44.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 Aug 2013 02:44:58 -0700 (PDT) From: Vikas Sajjan To: linux-samsung-soc@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: linux-media@vger.kernel.org, kgene.kim@samsung.com, inki.dae@samsung.com, s.nawrocki@samsung.com, m.szyprowski@samsung.com, tomasz.figa@gmail.com, robdclark@gmail.com, arun.kk@samsung.com, patches@linaro.org, linaro-kernel@lists.linaro.org Subject: [PATCH V2] drm/exynos: Add fallback option to get non physically continous memory for fb Date: Mon, 5 Aug 2013 15:14:42 +0530 Message-Id: <1375695882-16004-1-git-send-email-vikas.sajjan@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQkDkNavdzdt4Nyh88H/97f+pApF8CqvhGW7/SQE9u/88tcfTW7ttFeyTuRNj40otT5DFyRQ X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vikas.sajjan@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.172 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 To address the case where physically continous memory MAY NOT be a mandatory requirement for fb, the patch adds a feature to get non physically continous memory for fb if IOMMU is supported and if CONTIG memory allocation fails. Signed-off-by: Vikas Sajjan Signed-off-by: Arun Kumar Reviewed-by: Rob Clark --- changes since v1: - Modified to add the fallback patch if CONTIG alloc fails as suggested by Rob Clark robdclark@gmail.com and Tomasz Figa . - changed the commit message. --- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 8e60bd6..9a4b886 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" @@ -165,11 +166,21 @@ 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); + exynos_gem_obj = exynos_drm_gem_create(dev, EXYNOS_BO_CONTIG, size); if (IS_ERR(exynos_gem_obj)) { - ret = PTR_ERR(exynos_gem_obj); - goto err_release_framebuffer; + /* + * If IOMMU is supported then try to get buffer from + * non-continous memory area + */ + if (is_drm_iommu_supported(dev)) + exynos_gem_obj = exynos_drm_gem_create(dev, + EXYNOS_BO_NONCONTIG, size); + if (IS_ERR(exynos_gem_obj)) { + ret = PTR_ERR(exynos_gem_obj); + goto err_release_framebuffer; + } + dev_warn(&pdev->dev, "exynos_gem_obj for FB is allocated with\n" + "non physically continuous memory\n"); } exynos_fbdev->exynos_gem_obj = exynos_gem_obj;