From patchwork Thu Jun 7 11:06:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 137871 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1948530lji; Thu, 7 Jun 2018 04:06:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKS0gKP5NRYIr/oBdxRKRoyucjv+gwcGwXRE48snYqOWmyvz82to80iApcspxBjTrq8cVPk X-Received: by 2002:a17:902:26a:: with SMTP id 97-v6mr1539056plc.367.1528369591729; Thu, 07 Jun 2018 04:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369591; cv=none; d=google.com; s=arc-20160816; b=F5HL0a/YOL2sN4PhTBaWUp3wkzLGht/I+/qKfxz00bzh/5C9e5tcx06NjcXnbLpMEz e7F9kuqxXXB9L1vbQM4toBg6kBkJvnhUAos6/S2iWCUYDg1Jf5fSPR1p4YxKscbTjIsX dXTisbq23OHeB7M62dDXcNADgRQd8tK+2+sAmBPd6qk/8xWT9i5EdflwTFuD9h8maW/T GBLfyKux7AQ+qGMEENFzYKbFPUOIf835V99IuI7XiaK2kbQ7KKN9HC21wrUbVTzeUR1Y ZjWg/uX05dbSIpzTlTRGaeSkkCm5eof6xJ16WV6hNTuee+4q0QcuoHB7fRPSG+vNgxoz 9MgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=5m8Vca8i92RqeEQvjeF1HbHNfJTPYucCk53AYHdxKwo=; b=ltkdUC4hyGy/wyQWbBZRgDcu5SbW75YSGNo8rna/9GTn/UTy9YZeczNit+TfUCbnp2 rLRhcYtgw62RBo7Ok1v5/n8iJqAwRFlbrFQUo83CtfpXeDXAacPMjxgerzlsk/MXQDCj H0wdgvvtGkp84yVDy6T+n91+gFcx31dEFSAY8eZE3IK5E1bNk5o8Q6dZplMGXFYXLNiL Dt2lBErIxdZVfhsFjNLgSMZYvEYNQLeQQZ8WbDjTpvL6RqLM5r7twp8pHHXo5FU9Vtdr VFgWjSK43oXyHqhAl0U6UljV+Lec/JDtOrbPKXO7Zi1/WPXa6k3UcSN3d1uoLugMYu0r +eRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=PJHB7wXK; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8-v6si15144102pgd.96.2018.06.07.04.06.31; Thu, 07 Jun 2018 04:06:31 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=PJHB7wXK; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753357AbeFGLGa (ORCPT + 3 others); Thu, 7 Jun 2018 07:06:30 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:33831 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753394AbeFGLG0 (ORCPT ); Thu, 7 Jun 2018 07:06:26 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180607110624euoutp028fb4d192bb31da802995467371d84124~13Aoqg_N-2893328933euoutp02E; Thu, 7 Jun 2018 11:06:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180607110624euoutp028fb4d192bb31da802995467371d84124~13Aoqg_N-2893328933euoutp02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528369584; bh=7AQuqRlrj0wUIakMmE1KyDNq62iiuWTFRrd9R7m4AjM=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=PJHB7wXKSNTgHziPglKAdNIE1qs75DebjH0kYkBtfIzP4iVpp27ZFJI6esEJSCQzz zMMHxxLa87n/mHiv9frAReGa8/Pe5LkQGM58l5UQLS0nvTnCL9CEq/iwwbPQQNO0V3 suWBWl/ATh+ZHlSVDNlZqzRVhbwm9yXj3wX3oJxU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180607110623eucas1p224631cccc47d7ff929af0de3b2ccb29c~13An4onIL1393813938eucas1p26; Thu, 7 Jun 2018 11:06:23 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id FF.43.10409.FA1191B5; Thu, 7 Jun 2018 12:06:23 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110623eucas1p1073cda1edbfd8281d2bfc5274dc2d57f~13AnBxqs80960909609eucas1p1e; Thu, 7 Jun 2018 11:06:23 +0000 (GMT) X-AuditID: cbfec7f5-b5fff700000028a9-86-5b1911af5ff3 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id A1.CB.04183.EA1191B5; Thu, 7 Jun 2018 12:06:23 +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:22 +0100 (BST) From: Marek Szyprowski To: dri-devel@lists.freedesktop.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Andrzej Pietrasiewicz Subject: [PATCH 9/9] drm/exynos: fimc: Use real buffer width for configuring the hardware Date: Thu, 07 Jun 2018 13:06:14 +0200 Message-id: <20180607110614.335-10-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: H4sIAAAAAAAAA+NgFprPIsWRmVeSWpSXmKPExsWy7djPc7rrBSWjDWafVLeY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr48OOqoKr4hVzG96xNzD+F+5i5OSQEDCROPF2AQuILSSwglHi+jHXLkYuIPszo0Tn +8vsMEWN6w+yQRQtY5SY3BMKUdTAJLFp7lcmkASbgKFE19susCIRATeJpsMzWUGKmAUeM0qs 3b0ZbJKwQLTE01/vWEFsFgFVif9rVoLZvAI2En9PLGaC2CYvsXrDAWYQmxMofn7ZJiaQQRIC H1klDr+5zQZR5CLx88hDZghbWOLV8S1Qp8pIXJ7czQLR0Mwo0T5jFjuE08MosXXODqhua4nD xy+CrWYW4JOYtG060CQOoDivREebEESJh8STW6+YIf7sZ5TYvLuZdQKj5AJGhlWM4qmlxbnp qcXGeanlesWJucWleel6yfm5mxiB0Xb63/GvOxj3/Uk6xCjAwajEw9twXzxaiDWxrLgy9xCj BAezkghv4iWxaCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8cRp1UUIC6YklqdmpqQWpRTBZJg5O qQbGpac3Gf1x72venqvjYb/IPSok9u9ltdUFjzek3Xiu/qayJHZx6rLptS82TP90aI2HTZvE Tge3phWtTyYtv1eft/5A+x6Gfa9Fv6S45G5eq65VefPDHrn4/VFhzy5+Wql6ZHdJyifOJ9we GiWNPk1XvDoEjeVCyhp2Wr+cpbT3zB3reyoX/1tOV2Ipzkg01GIuKk4EABzon8ayAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDJMWRmVeSWpSXmKPExsVy+t/xy7rrBSWjDeYZWMx62c5isXHGelaL K1/fs1lMuj+BxWLG+X1MFmuP3GW3mDH5JZsDu8f97uNMHn1bVjF6fN4kF8AcxWWTkpqTWZZa pG+XwJXxYUdVwVXxirkN79gbGP8LdzFyckgImEg0rj/I1sXIxSEksIRRYsXSK1BOE5PEiwUf 2UGq2AQMJbredrGB2CICbhJNh2eyghQxCzxmlPi47RQrSEJYIFri6a93YDaLgKrE/zUrwWxe ARuJvycWM0Gsk5dYveEAM4jNCRQ/v2wTWFxIwFri7YPT7BMYeRYwMqxiFEktLc5Nzy020itO zC0uzUvXS87P3cQIDJNtx35u2cHY9S74EKMAB6MSD++Nh+LRQqyJZcWVuYcYJTiYlUR4Ey+J RQvxpiRWVqUW5ccXleakFh9ilOZgURLnPW9QGSUkkJ5YkpqdmlqQWgSTZeLglGpgzM3VS37N 8lnrWW/IN4tlj3vUOXZ+q1oT+OLsXOF8dcuJlr+L1X1iJxRZbNh/qplhtf2Bk791Ju0wmpRp ePte95IXnA9iFjI8nLvdptfCqDR7zvSwVPO5DzsPiDRwd9R9nshjOcuT3/C20rHSR0++VHMx Bc0s3SoY1eyxKnO98j+ttZI7EnQmKrEUZyQaajEXFScCAClG0h8PAgAA X-CMS-MailID: 20180607110623eucas1p1073cda1edbfd8281d2bfc5274dc2d57f X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180607110623eucas1p1073cda1edbfd8281d2bfc5274dc2d57f References: <20180607110614.335-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org 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_fimc.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) -- 2.17.1 -- 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_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 5ce84025d1cb..2edd22c87597 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c @@ -470,17 +470,18 @@ static void fimc_src_set_transf(struct fimc_context *ctx, unsigned int rotation) static void fimc_set_window(struct fimc_context *ctx, struct exynos_drm_ipp_buffer *buf) { + unsigned int real_width = buf->buf.pitch[0] / buf->format->cpp[0]; u32 cfg, h1, h2, v1, v2; /* cropped image */ h1 = buf->rect.x; - h2 = buf->buf.width - buf->rect.w - buf->rect.x; + h2 = real_width - buf->rect.w - buf->rect.x; v1 = buf->rect.y; v2 = buf->buf.height - buf->rect.h - buf->rect.y; DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n", buf->rect.x, buf->rect.y, buf->rect.w, buf->rect.h, - buf->buf.width, buf->buf.height); + real_width, buf->buf.height); DRM_DEBUG_KMS("h1[%d]h2[%d]v1[%d]v2[%d]\n", h1, h2, v1, v2); /* @@ -503,12 +504,13 @@ static void fimc_set_window(struct fimc_context *ctx, static void fimc_src_set_size(struct fimc_context *ctx, struct exynos_drm_ipp_buffer *buf) { + unsigned int real_width = buf->buf.pitch[0] / buf->format->cpp[0]; u32 cfg; - DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", buf->buf.width, buf->buf.height); + DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", real_width, buf->buf.height); /* original size */ - cfg = (EXYNOS_ORGISIZE_HORIZONTAL(buf->buf.width) | + cfg = (EXYNOS_ORGISIZE_HORIZONTAL(real_width) | EXYNOS_ORGISIZE_VERTICAL(buf->buf.height)); fimc_write(ctx, cfg, EXYNOS_ORGISIZE); @@ -529,7 +531,7 @@ static void fimc_src_set_size(struct fimc_context *ctx, * for now, we support only ITU601 8 bit mode */ cfg = (EXYNOS_CISRCFMT_ITU601_8BIT | - EXYNOS_CISRCFMT_SOURCEHSIZE(buf->buf.width) | + EXYNOS_CISRCFMT_SOURCEHSIZE(real_width) | EXYNOS_CISRCFMT_SOURCEVSIZE(buf->buf.height)); fimc_write(ctx, cfg, EXYNOS_CISRCFMT); @@ -842,12 +844,13 @@ static void fimc_set_scaler(struct fimc_context *ctx, struct fimc_scaler *sc) static void fimc_dst_set_size(struct fimc_context *ctx, struct exynos_drm_ipp_buffer *buf) { + unsigned int real_width = buf->buf.pitch[0] / buf->format->cpp[0]; u32 cfg, cfg_ext; - DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", buf->buf.width, buf->buf.height); + DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", real_width, buf->buf.height); /* original size */ - cfg = (EXYNOS_ORGOSIZE_HORIZONTAL(buf->buf.width) | + cfg = (EXYNOS_ORGOSIZE_HORIZONTAL(real_width) | EXYNOS_ORGOSIZE_VERTICAL(buf->buf.height)); fimc_write(ctx, cfg, EXYNOS_ORGOSIZE);