From patchwork Thu Jun 7 11:06:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10451703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F0FA660467 for ; Thu, 7 Jun 2018 11:06:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0A3A29C57 for ; Thu, 7 Jun 2018 11:06:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D48FE29C88; Thu, 7 Jun 2018 11:06:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7927529C57 for ; Thu, 7 Jun 2018 11:06:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 450106F238; Thu, 7 Jun 2018 11:06:29 +0000 (UTC) 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 DFD956F231 for ; Thu, 7 Jun 2018 11:06:24 +0000 (UTC) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180607110623euoutp01025a31b3f92a2a6b5c4680d0d267900a~13AnMMJCT1848218482euoutp01Q; Thu, 7 Jun 2018 11:06:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180607110623euoutp01025a31b3f92a2a6b5c4680d0d267900a~13AnMMJCT1848218482euoutp01Q Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110622eucas1p120670fb449dc76229302517654b7f30a~13AmajbOq2078420784eucas1p18; Thu, 7 Jun 2018 11:06:22 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id AE.43.10409.DA1191B5; Thu, 7 Jun 2018 12:06:22 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110621eucas1p1e193753ad51a65dfe303cae44577bd8f~13AluRaZO2078420784eucas1p16; Thu, 7 Jun 2018 11:06:21 +0000 (GMT) X-AuditID: cbfec7f5-f95739c0000028a9-81-5b1911addfaf Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E0.CB.04183.DA1191B5; Thu, 7 Jun 2018 12:06:21 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P9Y0097E9IGLAA0@eusync1.samsung.com>; Thu, 07 Jun 2018 12:06:21 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Subject: [PATCH 5/9] drm/exynos: gsc: Use real buffer width for configuring the hardware Date: Thu, 07 Jun 2018 13:06:10 +0200 Message-id: <20180607110614.335-6-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20180607110614.335-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIA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Yck+ 9i5GTg42AUOJrrddbCC2iICbRNPhmawgRcwCjxklPm47xQqSEBaIkji5eD8ziM0ioCrRuH4N I4jNK2At8b/pPliNhIC8xOoNB8BqOAVsJM4v28QEYgsB1bx9cJp9AiPPAkaGVYwiqaXFuem5 xUZ6xYm5xaV56XrJ+bmbGIFBsu3Yzy07GLveBR9iFOBgVOLhvfFQPFqINbGsuDL3EKMEB7OS CG/iJbFoId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rznDSqjhATSE0tSs1NTC1KLYLJMHJxSDYyi +z8EhVgJHN42I0f5c5N1qwOTdvKfhd+zmaSnZ8292XYs50TlEt8A08Y8sbO7LinKPZvy+8VN pve1Gbp/t3m//15vtbYy5diO9SYZ+i53Ms4cDJnXWdJ96aTc6onMbCuNba8umTm9p05V9UWO 5rLyLP3Xhzqe+71Y8pCHI9vm6P1w3oav+QVKLMUZiYZazEXFiQCXNNZIDgIAAA== X-CMS-MailID: 20180607110621eucas1p1e193753ad51a65dfe303cae44577bd8f X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180607110621eucas1p1e193753ad51a65dfe303cae44577bd8f References: <20180607110614.335-1-m.szyprowski@samsung.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrzej Pietrasiewicz , Bartlomiej Zolnierkiewicz , Seung-Woo Kim , Marek Szyprowski MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP DMA hardware should respect buffer pitch, so use the width calculated from the buffer pitch instead of the virtual one. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index e99dd1e4ba65..ee27f7fdc7ab 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -577,7 +577,7 @@ static void gsc_src_set_size(struct gsc_context *ctx, cfg &= ~(GSC_SRCIMG_HEIGHT_MASK | GSC_SRCIMG_WIDTH_MASK); - cfg |= (GSC_SRCIMG_WIDTH(buf->buf.width) | + cfg |= (GSC_SRCIMG_WIDTH(buf->buf.pitch[0] / buf->format->cpp[0]) | GSC_SRCIMG_HEIGHT(buf->buf.height)); gsc_write(cfg, GSC_SRCIMG_SIZE); @@ -868,7 +868,7 @@ static void gsc_dst_set_size(struct gsc_context *ctx, /* original size */ cfg = gsc_read(GSC_DSTIMG_SIZE); cfg &= ~(GSC_DSTIMG_HEIGHT_MASK | GSC_DSTIMG_WIDTH_MASK); - cfg |= GSC_DSTIMG_WIDTH(buf->buf.width) | + cfg |= GSC_DSTIMG_WIDTH(buf->buf.pitch[0] / buf->format->cpp[0]) | GSC_DSTIMG_HEIGHT(buf->buf.height); gsc_write(cfg, GSC_DSTIMG_SIZE);