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: 7725741 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E17E99F39B for ; Mon, 30 Nov 2015 13:54:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1219A2042B for ; Mon, 30 Nov 2015 13:54:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 13A7E20495 for ; Mon, 30 Nov 2015 13:54:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754257AbbK3NyB (ORCPT ); Mon, 30 Nov 2015 08:54:01 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:53289 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754245AbbK3Nx6 (ORCPT ); Mon, 30 Nov 2015 08:53:58 -0500 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 linux-samsung-soc@vger.kernel.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 Cc: Marek Szyprowski , Inki Dae , Joonyoung Shim , Seung-Woo Kim , Andrzej Hajda , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tobias Jakobi , Gustavo Padovan , Javier Martinez Canillas 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 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))