From patchwork Tue Nov 10 13:23:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 56322 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp771911lbb; Tue, 10 Nov 2015 05:31:52 -0800 (PST) X-Received: by 10.68.129.40 with SMTP id nt8mr5701507pbb.118.1447161905581; Tue, 10 Nov 2015 05:25:05 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xv7si5137777pab.155.2015.11.10.05.25.05; Tue, 10 Nov 2015 05:25:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753134AbbKJNZE (ORCPT + 4 others); Tue, 10 Nov 2015 08:25:04 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:55191 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753105AbbKJNY7 (ORCPT ); Tue, 10 Nov 2015 08:24:59 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NXL007KOP9LNFA0@mailout2.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Tue, 10 Nov 2015 13:24:57 +0000 (GMT) X-AuditID: cbfec7f4-f79c56d0000012ee-7c-5641f029bfbc Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id FF.23.04846.920F1465; Tue, 10 Nov 2015 13:24:57 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NXL00L9RP94NP10@eusync1.samsung.com>; Tue, 10 Nov 2015 13:24:57 +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 20/25] drm/exynos: gem: set default alignment for dumb GEM buffers Date: Tue, 10 Nov 2015 14:23:36 +0100 Message-id: <1447161821-1877-21-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1447161821-1877-1-git-send-email-m.szyprowski@samsung.com> References: <1447161821-1877-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrJLMWRmVeSWpSXmKPExsVy+t/xy7qaHxzDDNoX6ljcWneO1WLjjPWs Fle+vmez2PlgF7vFpPsTWCzevF3DZPHi3kUWi9cvDC1mnN/HZLH2yF12ixmTX7JZtK3+wGqx atcfRgdej52z7rJ73O8+zuTx7xi7x5Z+IG/npL1MHn1bVjF6fN4kF8AexWWTkpqTWZZapG+X wJXxrXMFe8FB7oofFyMbGN9xdjFyckgImEjc2XCFDcIWk7hwbz2QzcUhJLCUUeLY1O1QThOT xMdfr1hBqtgEDCW63naBdYgIuEk0HZ4JFmcWOMwscXhqHYgtLBAice//NbA4i4CqxNxrXSwg Nq+Ah8TPzoXMENvkJP6/XMEEYnMCxbd+/AwWFxJwl7jZdJFlAiPvAkaGVYyiqaXJBcVJ6bmG esWJucWleel6yfm5mxghAfplB+PiY1aHGAU4GJV4eCd8cwgTYk0sK67MPcQowcGsJMLL+Nox TIg3JbGyKrUoP76oNCe1+BCjNAeLkjjv3F3vQ4QE0hNLUrNTUwtSi2CyTBycUg2Mzr37Jxm2 N37+nHL4lUn/oscX+Wfbz5ox248na+f7/lbdPSxlrhW/N1xbG1i2O2PW3Sa9E/rOGQcLjlv8 X+J8T6OgtOVsfKXXtVmfT3K2vCu6Itnx2Hbp+Ta1oHkL7p/3SRU6/+7CNqWJsZP/Lbuy/dJ1 cR6xCes1N4XYPtgaLHeqSkjz+n5DFiWW4oxEQy3mouJEAFA5MIBMAgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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(-) -- 1.9.2 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 9ed52b04c0ba..0890e6709f10 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 EXYNOS_BAD_PIXEL_FORMAT 0xffffffffu #define to_exynos_crtc(x) container_of(x, struct exynos_drm_crtc, 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))