From patchwork Mon Nov 30 13:53:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 57459 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1486655lbb; Mon, 30 Nov 2015 05:54:40 -0800 (PST) X-Received: by 10.98.75.83 with SMTP id y80mr69980210pfa.77.1448891659711; Mon, 30 Nov 2015 05:54:19 -0800 (PST) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTP id 8si2234630pfj.98.2015.11.30.05.54.19; Mon, 30 Nov 2015 05:54:19 -0800 (PST) Received-SPF: pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 736A96E5C3; Mon, 30 Nov 2015 05:54:18 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id DCB616E5C0 for ; Mon, 30 Nov 2015 05:53:55 -0800 (PST) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NYM00BX7RXUPRB0@mailout1.w1.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 30 Nov 2015 13:53:54 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-f2-565c54f1426f Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id F3.78.21385.1F45C565; Mon, 30 Nov 2015 13:53:53 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NYM007NRRXFE700@eusync2.samsung.com>; Mon, 30 Nov 2015 13:53:53 +0000 (GMT) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH v2 17/22] drm/exynos: gem: set default alignment for dumb GEM buffers Date: Mon, 30 Nov 2015 14:53:32 +0100 Message-id: <1448891617-18830-18-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1448891617-18830-1-git-send-email-m.szyprowski@samsung.com> References: <1448891617-18830-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJLMWRmVeSWpSXmKPExsVy+t/xK7ofQ2LCDM4/07e4te4cq8XGGetZ La58fc9msfPBLnaLSfcnsFi8ebuGyeLFvYssFq9fGFrMOL+PyWLtkbvsFjMmv2SzaFv9gdVi 1a4/jA68Hjtn3WX3uN99nMnj3zF2jy39QN7OSXuZPPq2rGL0+LxJLoA9issmJTUnsyy1SN8u gStj1dcOtoL73BVHO7ayNDB2cnUxcnJICJhIrLpzlw3CFpO4cG89kM3FISSwlFHizOH5TBBO E5PEt66/rCBVbAKGEl1vu8A6RATcJJoOzwSLMwscZpY4PLUOxBYWCJc4fe45UJyDg0VAVeLs XymQMK+Ap8SdBQ9YIZbJSfx/uYIJxOYEij85e5odxBYS8JDYMOMY0wRG3gWMDKsYRVNLkwuK k9JzjfSKE3OLS/PS9ZLzczcxQgL06w7GpcesDjEKcDAq8fBKmEWHCbEmlhVX5h5ilOBgVhLh DTSNCRPiTUmsrEotyo8vKs1JLT7EKM3BoiTOO3PX+xAhgfTEktTs1NSC1CKYLBMHp1QDo9dk eRFmjnlazTF35D7o9f+bneET//57Vbjt1IXtfBJzmNZc3Op2cfqBR+4W7w7s3KrVofrfVDXi ikobx4mO8yIrJp80ENZjSpjVdU1/Y2PPWolTZ23cOtcJHapNOtYfXR1e8M347R2HK7c819i0 cx97fj9pj1Ro975PkxduLm9tMb0fuur3HyWW4oxEQy3mouJEALEMRyBMAgAA Cc: Javier Martinez Canillas , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Andrzej Hajda , Tobias Jakobi , Marek Szyprowski 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" This patch forces all GEM buffers to have pitch aligned at least to 8 pixels. This is a common requirement for various Exynos IPP blocks, which otherwise won't be able to operate on buffers of random size. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 ++ drivers/gpu/drm/exynos/exynos_drm_gem.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index bb2e449a20c3..670f6d06a2a9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -24,6 +24,8 @@ #define DEFAULT_WIN 0 +#define EXYNOS_DRM_PITCH_ALIGN 8 + #define to_exynos_crtc(x) container_of(x, struct exynos_drm_crtc, base) #define to_exynos_plane(x) container_of(x, struct exynos_drm_plane, base) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index 252eb301470c..b5db6e6cc043 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -417,7 +417,7 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, * with DRM_IOCTL_MODE_CREATE_DUMB command. */ - args->pitch = args->width * ((args->bpp + 7) / 8); + args->pitch = roundup(args->width, EXYNOS_DRM_PITCH_ALIGN) * ((args->bpp + 7) / 8); args->size = args->pitch * args->height; if (is_drm_iommu_supported(dev))