From patchwork Thu Jun 7 11:06:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 137864 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1948426lji; Thu, 7 Jun 2018 04:06:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKxK1A4T2YfR2g8MbykxX9ar16lCJP7sVMdmKM31BTnNYRi6mygSqbZlEmw12Mw7l8zpZou X-Received: by 2002:a63:7a11:: with SMTP id v17-v6mr1182735pgc.97.1528369586875; Thu, 07 Jun 2018 04:06:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369586; cv=none; d=google.com; s=arc-20160816; b=zPKJ7Hw5jvil5wjpMJ/fT7LJZGXD4yBu730eFcpN1jUWUA2KLnUZgk1nbtNDQtK1vA UICatrHiskaR80kHFxnJqrb2y7o5e+CJ67k0w8+n6IsqdX70hmDEOsE74+zRFZvsBGV8 lUpYZ2/4ikk5IBX/SVNGepoUr6wKlSjy46jd1CMBl3X2JnqAQ9OTYq11uvCa9OdCDGz5 OfxzXadiqrS0xMOqwl2LEGodFtJuMy/U72pmnzvSZ0gkr/0tckKXhGkBczKQNYvoRiHH Yl6QOm0u17Jwm5Tw7tTCKhg4W7taAZL4wKSxAmBzzculZnsdF+JbUfgOm61U1DXkBn60 iBNw== 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=deooa0RhzSEVF9KPW0gFXIXWeMd08rb49nz+u8GdpaQ=; b=oq6i8UW0O7nn6Pd/hCRKc6W6N5p0M7xZEJ7niMepZDeS2Z2XxYnY+6vZh1rbg2rMet LTVq69IK9gIObouhKGRLO5UHJueX0V7Nvu3rTx6LSixbuZF3ASuDqPWdbcxfUsjL1Czk w/OhUH5kIvGGSeuNgFKaDDIAXQ7aVe8AS8w7ALy+vOQzxKwT6XWMrUhxero8ZLb9DZP6 Yl9aIcO8c3bq2INUIe9ABO6hxuVmcusbfpGlFV5rjE4AmtPkDBjPl5Orxvq6rG7OKxXF miaa7IVjBp8XSSjs6vU3Me2B4JFXhoWpfpX7MHd6IQdYxUU8GQi/CxMIB040qxOUoFlF Y2KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=aQyVjZk1; 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.26; Thu, 07 Jun 2018 04:06:26 -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=aQyVjZk1; 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 S1753390AbeFGLGZ (ORCPT + 3 others); Thu, 7 Jun 2018 07:06:25 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:33802 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753149AbeFGLGX (ORCPT ); Thu, 7 Jun 2018 07:06:23 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180607110621euoutp02a971d44c3a94b8ec15de65084e9b401f~13Alsa-em2938129381euoutp02p; Thu, 7 Jun 2018 11:06:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180607110621euoutp02a971d44c3a94b8ec15de65084e9b401f~13Alsa-em2938129381euoutp02p DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528369581; bh=FmQgdqlcX4Sd0RiRlZWCL03ArVpSr2PewTISwk853o0=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=aQyVjZk1psUZgwkeTyA5dvkELphQkDHIb0G+p5uyFjLvQrwHUNVz5BAVkDqirY2cS NdCyQvFdcZbsa6K3iUIe1WCqWp6ttbIyLa7gq/j4CYP23gfgddM//qdgm08HBTOqYJ N+N1uts3JA2fMmSQT7Gs3v63L1AdXbmT2FZeJvLs= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110620eucas1p143cc2d83fa14e7032e3a2b75b06d393a~13Ak-mKlO2078420784eucas1p14; Thu, 7 Jun 2018 11:06:20 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id CB.43.10409.CA1191B5; Thu, 7 Jun 2018 12:06:20 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110620eucas1p1b0fb05cea340248e2facadbc876e2764~13AkSrgfD2078420784eucas1p13; Thu, 7 Jun 2018 11:06:20 +0000 (GMT) X-AuditID: cbfec7f5-b45ff700000028a9-79-5b1911ac5910 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id CD.BB.04183.CA1191B5; Thu, 7 Jun 2018 12:06:20 +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:20 +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 1/9] drm/exynos: ipp: Rework checking for the correct buffer formats Date: Thu, 07 Jun 2018 13:06:06 +0200 Message-id: <20180607110614.335-2-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+NgFlrAIsWRmVeSWpSXmKPExsWy7djPc7prBCWjDRqOKlvMetnOYrFxxnpW iytf37NZTLo/gcVixvl9TBZrj9xlt5gx+SWbA7vH/e7jTB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CV8XHTLsaC87oVB5sPMzYw7lHpYuTkkBAwkWg/85Kxi5GLQ0hgBaPElg8vmCGcz4wS 8+93s8NUbZ26nAUisYxR4ubkRiYIp4FJ4u7EuWBVbAKGEl1vu9hAbBEBN4mmwzNZQYqYBR4z SqzdvRmsSFggTOLdk6NgRSwCqhJNS1qZQWxeAWuJhcs2s0Ksk5dYveEAWJxTwEbi/LJNYNsk BH6ySvy6+BCqyEXidv9bqPuEJV4d3wJly0hcntzNAtHQzCjRPmMWO4TTwyixdc4ONogqa4nD xy+CTWIW4JOYtG060DoOoDivREebEITpIXFzrztIhZBAP6NE71XzCYySCxgZVjGKp5YW56an FhvnpZbrFSfmFpfmpesl5+duYgTG2+l/x7/uYNz3J+kQowAHoxIPb8N98Wgh1sSy4srcQ4wS HMxKIryJl8SihXhTEiurUovy44tKc1KLDzFKc7AoifPGadRFCQmkJ5akZqemFqQWwWSZODil GhhNijZcVtubaNcn+P7GLgUW7xCl0FfsN9RO/N34L7Dp/gu7OE3t2vgzZjMWdZXY8T45rl91 77zvsYZYqdDfXY/l+2VeLGZ8oL7BVfjhnhXBby9dm+JSqldtWuzlVqYgYvRq95wV/Q0XCmY8 4Fq85dyNOqkfs/+rr2o/NvVki8P8pgIpkdJKdQclluKMREMt5qLiRADMXzOCswIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xy7prBCWjDVYeYLaY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4+OmXYwF53UrDjYfZmxg3KPSxcjJISFgIrF16nKWLkYuDiGBJYwSC/bMYINwmpgk Hi44yApSxSZgKNH1tosNxBYRcJNoOjyTFaSIWeAxo8THbafAioQFwiTePTkKVsQioCrRtKSV GcTmFbCWWLhsMyvEOnmJ1RsOgMU5BWwkzi/bxARiCwHVvH1wmn0CI88CRoZVjCKppcW56bnF RnrFibnFpXnpesn5uZsYgaGy7djPLTsYu94FH2IU4GBU4uG98VA8Wog1say4MvcQowQHs5II b+IlsWgh3pTEyqrUovz4otKc1OJDjNIcLErivOcNKqOEBNITS1KzU1MLUotgskwcnFINjC5b dpp+K8icu7rtP6/PDJW7N5+x/1r09YH9AU3DR9/Ca/8+XnGNdZU2u3zvjGl7pgdIPtrK+bx7 yaMf2d/fLkqasHKvgJDw9GWy31epp08q9090//T2RaTVkv/tb4PvdVaYdm3O2Nl8qW7FpdU2 AaelQnW0VXZdT+hr/f1pulKaZMgC746EuVuVWIozEg21mIuKEwGwHzdgEQIAAA== X-CMS-MailID: 20180607110620eucas1p1b0fb05cea340248e2facadbc876e2764 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180607110620eucas1p1b0fb05cea340248e2facadbc876e2764 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 Prepare a common function for size and scale checks and call it for source and destination buffers. Then also move there the state-less checks from exynos_drm_ipp_task_setup_buffer, so the format information is already available in limits processing. Finally perform the IPP_LIMIT_BUFFER check on the real width of the buffer (the width calculated from the provided buffer pitch). Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_ipp.c | 108 +++++++++++++----------- 1 file changed, 57 insertions(+), 51 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_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 26374e58c557..8840e6ec8e43 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c @@ -345,27 +345,6 @@ static int exynos_drm_ipp_task_setup_buffer(struct exynos_drm_ipp_buffer *buf, int ret = 0; int i; - /* basic checks */ - if (buf->buf.width == 0 || buf->buf.height == 0) - return -EINVAL; - buf->format = drm_format_info(buf->buf.fourcc); - for (i = 0; i < buf->format->num_planes; i++) { - unsigned int width = (i == 0) ? buf->buf.width : - DIV_ROUND_UP(buf->buf.width, buf->format->hsub); - - if (buf->buf.pitch[i] == 0) - buf->buf.pitch[i] = width * buf->format->cpp[i]; - if (buf->buf.pitch[i] < width * buf->format->cpp[i]) - return -EINVAL; - if (!buf->buf.gem_id[i]) - return -ENOENT; - } - - /* pitch for additional planes must match */ - if (buf->format->num_planes > 2 && - buf->buf.pitch[1] != buf->buf.pitch[2]) - return -EINVAL; - /* get GEM buffers and check their size */ for (i = 0; i < buf->format->num_planes; i++) { unsigned int height = (i == 0) ? buf->buf.height : @@ -495,12 +474,13 @@ static int exynos_drm_ipp_check_size_limits(struct exynos_drm_ipp_buffer *buf, enum drm_ipp_size_id id = rotate ? IPP_LIMIT_ROTATED : IPP_LIMIT_AREA; struct drm_ipp_limit l; struct drm_exynos_ipp_limit_val *lh = &l.h, *lv = &l.v; + int real_width = buf->buf.pitch[0] / buf->format->cpp[0]; if (!limits) return 0; __get_size_limit(limits, num_limits, IPP_LIMIT_BUFFER, &l); - if (!__size_limit_check(buf->buf.width, &l.h) || + if (!__size_limit_check(real_width, &l.h) || !__size_limit_check(buf->buf.height, &l.v)) return -EINVAL; @@ -560,10 +540,62 @@ static int exynos_drm_ipp_check_scale_limits( return 0; } +static int exynos_drm_ipp_check_format(struct exynos_drm_ipp_task *task, + struct exynos_drm_ipp_buffer *buf, + struct exynos_drm_ipp_buffer *src, + struct exynos_drm_ipp_buffer *dst, + bool rotate, bool swap) +{ + const struct exynos_drm_ipp_formats *fmt; + int ret, i; + + fmt = __ipp_format_get(task->ipp, buf->buf.fourcc, buf->buf.modifier, + buf == src ? DRM_EXYNOS_IPP_FORMAT_SOURCE : + DRM_EXYNOS_IPP_FORMAT_DESTINATION); + if (!fmt) { + DRM_DEBUG_DRIVER("Task %pK: %s format not supported\n", task, + buf == src ? "src" : "dst"); + return -EINVAL; + } + + /* basic checks */ + if (buf->buf.width == 0 || buf->buf.height == 0) + return -EINVAL; + + buf->format = drm_format_info(buf->buf.fourcc); + for (i = 0; i < buf->format->num_planes; i++) { + unsigned int width = (i == 0) ? buf->buf.width : + DIV_ROUND_UP(buf->buf.width, buf->format->hsub); + + if (buf->buf.pitch[i] == 0) + buf->buf.pitch[i] = width * buf->format->cpp[i]; + if (buf->buf.pitch[i] < width * buf->format->cpp[i]) + return -EINVAL; + if (!buf->buf.gem_id[i]) + return -ENOENT; + } + + /* pitch for additional planes must match */ + if (buf->format->num_planes > 2 && + buf->buf.pitch[1] != buf->buf.pitch[2]) + return -EINVAL; + + /* check driver limits */ + ret = exynos_drm_ipp_check_size_limits(buf, fmt->limits, + fmt->num_limits, + rotate, + buf == dst ? swap : false); + if (ret) + return ret; + ret = exynos_drm_ipp_check_scale_limits(&src->rect, &dst->rect, + fmt->limits, + fmt->num_limits, swap); + return ret; +} + static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task) { struct exynos_drm_ipp *ipp = task->ipp; - const struct exynos_drm_ipp_formats *src_fmt, *dst_fmt; struct exynos_drm_ipp_buffer *src = &task->src, *dst = &task->dst; unsigned int rotation = task->transform.rotation; int ret = 0; @@ -607,37 +639,11 @@ static int exynos_drm_ipp_task_check(struct exynos_drm_ipp_task *task) return -EINVAL; } - src_fmt = __ipp_format_get(ipp, src->buf.fourcc, src->buf.modifier, - DRM_EXYNOS_IPP_FORMAT_SOURCE); - if (!src_fmt) { - DRM_DEBUG_DRIVER("Task %pK: src format not supported\n", task); - return -EINVAL; - } - ret = exynos_drm_ipp_check_size_limits(src, src_fmt->limits, - src_fmt->num_limits, - rotate, false); - if (ret) - return ret; - ret = exynos_drm_ipp_check_scale_limits(&src->rect, &dst->rect, - src_fmt->limits, - src_fmt->num_limits, swap); + ret = exynos_drm_ipp_check_format(task, src, src, dst, rotate, swap); if (ret) return ret; - dst_fmt = __ipp_format_get(ipp, dst->buf.fourcc, dst->buf.modifier, - DRM_EXYNOS_IPP_FORMAT_DESTINATION); - if (!dst_fmt) { - DRM_DEBUG_DRIVER("Task %pK: dst format not supported\n", task); - return -EINVAL; - } - ret = exynos_drm_ipp_check_size_limits(dst, dst_fmt->limits, - dst_fmt->num_limits, - false, swap); - if (ret) - return ret; - ret = exynos_drm_ipp_check_scale_limits(&src->rect, &dst->rect, - dst_fmt->limits, - dst_fmt->num_limits, swap); + ret = exynos_drm_ipp_check_format(task, dst, src, dst, false, swap); if (ret) return ret; From patchwork Thu Jun 7 11:06:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 137862 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1948387lji; Thu, 7 Jun 2018 04:06:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ7CFembShDkOsRArHLv2OJgormePZMiTPT5cUGTWk4ZZesy+/OQ0rOrXY3asf2fu67HgPh X-Received: by 2002:a17:902:bd8f:: with SMTP id q15-v6mr1498611pls.161.1528369585347; Thu, 07 Jun 2018 04:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369585; cv=none; d=google.com; s=arc-20160816; b=C00c5xwz4/ft4yn8Kq9qtxQRDg1WnqbffPwuaiV9eW9Zd5GYwWrx1x4RzG9lGSmAsC X0Ww91V9B/fEbECqYPG5C/TAtOJJKPacz+Hc1fEiuO7oNWs+BxVdTdDJ5KykgYbXINVe EFFAo8jOu7EkJQOZKPpHbRYb7hzWNK3MfaDExj2K3sewERcsFIXQYrPCKoOxgxcJUHj/ kM1qr2cUZxCoZmTCfJYNLqZk1H5yztIEqfZrf8TLfiVQQ6qZFJw5828oVxFwadKF8J6q R/zsgUZJF7pWItXqW0JBNCRL6MhTviUzCkQlr0VrJ6ybnBGGzuhw3O5PlfFaCmGYDsE9 zjnQ== 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=Iaact/gYqsZo4P9qApTtTjc9uQBaa2MvN9nBrMNx4WI=; b=ZHXNi/JrGJ2S1G0Mp5QX11NIzecxAyIZ01BRNOWo/NQhM6kGjoK3dHloQ/7Tohe7Ak RUxl/mRMOE3+7j5AeghjAMz5CM1A7rjxZzUhVzYUQpaHgHHewNsavuCbx1F9f8jkIQV/ 2+LeShNhn8o6hyuWgpvWQ1HmgDJ+ybQlzajjFoGANhjpnNAzJQL3zsYV7xV18qD5ZcxT WGyU1Yyr7+LFx5fPqgjrlhKWH3e10AY1TxIPdIFiD/LqNKITg1OS2mIh7+rFhALesTMv THJpd26Glc0l7irpspUhGLtTVjxHhT1VCRC/6ZT1N7LTQEawavjJJFG1MEuLXsQ754oI GjHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=s1yNaEu2; 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.25; Thu, 07 Jun 2018 04:06:25 -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=s1yNaEu2; 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 S1753324AbeFGLGY (ORCPT + 3 others); Thu, 7 Jun 2018 07:06:24 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:33804 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753169AbeFGLGX (ORCPT ); Thu, 7 Jun 2018 07:06:23 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180607110621euoutp0282c6f1ebddd0629536c0d9c6bcf5bb9f~13Al6XUiy2943629436euoutp02e; Thu, 7 Jun 2018 11:06:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180607110621euoutp0282c6f1ebddd0629536c0d9c6bcf5bb9f~13Al6XUiy2943629436euoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528369581; bh=bBNZo6MOYTz7gricZRAKnzAyGKAT3xFkljLldm/ITqE=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=s1yNaEu2zfp9JbfAYUKxM+FepuQJBROs0lcZcOLNkgDWr6tPxhNzCvBfj1B1+Zo/W jEmsKTFDvVMmRWSztXCf/VucwhihAzMh147YBrGOZ++2BQlw7ko3YyfJAjNSmLDAmT dz4XL1llc85z9O4eD5ioFmSuYg0XEftXPWC+dVys= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110621eucas1p11c10a2659e138887c0ad8858a87cc4ed~13AlcoXGE2075920759eucas1p1z; Thu, 7 Jun 2018 11:06:21 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id E0.A6.17380.CA1191B5; Thu, 7 Jun 2018 12:06:21 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110620eucas1p1b43ac889bab07152bc20b97116b7ade4~13AksvbTX0961309613eucas1p1S; Thu, 7 Jun 2018 11:06:20 +0000 (GMT) X-AuditID: cbfec7f4-6f9ff700000043e4-75-5b1911ac65ee Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id AF.BB.04183.CA1191B5; Thu, 7 Jun 2018 12:06:20 +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:20 +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 2/9] drm/exynos: rotator: Fix DRM_MODE_REFLECT_{X,Y} interpretation Date: Thu, 07 Jun 2018 13:06:07 +0200 Message-id: <20180607110614.335-3-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+NgFlrIIsWRmVeSWpSXmKPExsWy7djP87prBSWjDRYdZLKY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4+XXRSwFV9grJs1Zx9rAeJKti5GTQ0LARGLH0/NMXYxcHEICKxgl1r75wgzhfGaU 2P3lEzNM1fQH11hAbCGBZYwSPZOKIYoamCTuTpzLDpJgEzCU6HrbBTZWRMBNounwTFaQImaB x0Bjd28GKxIWCJW4fuIGWBGLgKrExVfNYDavgLXE9LVLmCC2yUus3nAAbDOngI3E+WWbwO6T EPjKKjHn/DeoIheJrXM/Q50nLPHq+BZ2CFtG4vLkbhaIhmZGifYZs9ghnB5Gia1zdkC9bS1x +PhFVhCbWYBPYtK26UCTOIDivBIdbUIQJR4SWx7fgoZMP6NE47WfTBMYJRcwMqxiFE8tLc5N Ty02ykst1ytOzC0uzUvXS87P3cQIjLjT/45/2cG460/SIUYBDkYlHt6G++LRQqyJZcWVuYcY JTiYlUR4Ey+JRQvxpiRWVqUW5ccXleakFh9ilOZgURLnjdOoixISSE8sSc1OTS1ILYLJMnFw SjUwTvKZlrGeTyGpeeakzfO7Q9tzLn/2j/jjk//D67GbaotYyeXSVp5XPV8l1tyzn2mZfOXU 1f3nfA4XMx/lt97omfCHT+vN5WelVzclmk7n1/u4Jv4625Lcicd2pwmvcamxvOPUOfmYYEqr 7f17h4sZdwmnFTOJWM/3eX1eef50xf283/x5mf/uVWIpzkg01GIuKk4EAOGat2y0AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xy7prBCWjDTadlbKY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4+XXRSwFV9grJs1Zx9rAeJKti5GTQ0LARGL6g2ssXYxcHEICSxglpi07xQrhNDFJ PFxwkBWkik3AUKLrbRdYh4iAm0TT4ZlgRcwCjxklPm47BVYkLBAqcf3EDbAiFgFViYuvmsFs XgFrielrlzBBrJOXWL3hADOIzSlgI3F+2SawuBBQzdsHp9knMPIsYGRYxSiSWlqcm55bbKRX nJhbXJqXrpecn7uJERgq24793LKDsetd8CFGAQ5GJR7eGw/Fo4VYE8uKK3MPMUpwMCuJ8CZe EosW4k1JrKxKLcqPLyrNSS0+xCjNwaIkznveoDJKSCA9sSQ1OzW1ILUIJsvEwSnVwCi4ZBmH wozY/BNMPieWf9aKUp3/K3zS3yNvTNMXW6coGCVlBXDE/MxaaNzXoVL1+etiO+/5r27Jvv7q e3hB5gZflVUHI89MSFFn0V3flHpvQaEaQ+D3uCnGqTOZFvHd7/k1IYTxbYiiyuSg0JbgQ6sX awv+2G9R9+1y9K/5Qa53Aoxf/6qSKlRiKc5INNRiLipOBADYqLKYEQIAAA== X-CMS-MailID: 20180607110620eucas1p1b43ac889bab07152bc20b97116b7ade4 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180607110620eucas1p1b43ac889bab07152bc20b97116b7ade4 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 Horizontal (DRM_MODE_REFLECT_Y) and vertical (DMR_MODE_REFLECT_Y) flip were swapped in Rotator driver. Fix this by swapping code for interpreting them. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_rotator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 1a76dd3d52e1..a820a68429b9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c @@ -168,9 +168,9 @@ static void rotator_dst_set_transf(struct rot_context *rot, val &= ~ROT_CONTROL_FLIP_MASK; if (rotation & DRM_MODE_REFLECT_X) - val |= ROT_CONTROL_FLIP_HORIZONTAL; - if (rotation & DRM_MODE_REFLECT_Y) val |= ROT_CONTROL_FLIP_VERTICAL; + if (rotation & DRM_MODE_REFLECT_Y) + val |= ROT_CONTROL_FLIP_HORIZONTAL; val &= ~ROT_CONTROL_ROT_MASK; From patchwork Thu Jun 7 11:06:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 137866 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1948445lji; Thu, 7 Jun 2018 04:06:28 -0700 (PDT) X-Google-Smtp-Source: ADUXVKInAyA5yr3OI7dNMSJawavO4YtojJXtV5zdfFv+v24RmsfdATz+dMKKxlrwm73PDEcw1jIC X-Received: by 2002:a17:902:b7c4:: with SMTP id v4-v6mr1573765plz.188.1528369588194; Thu, 07 Jun 2018 04:06:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369588; cv=none; d=google.com; s=arc-20160816; b=gLuU2tYh1TbQovQqv6h9UsQTonPVIVUY8SmuwwuGos79qHilbvG8vCmxxvg0wdAIiX 7adjb3qW+ivhA4ZbQ5siQRWTFqJOlK/wXWD0aqH4Lx9B9J0Geb77bsqhCeMtH1ftD1YU 4rXVufRzhtNTFfvNHypnn6v27E4MYpses8Df4KeNeQi94bElVyVqXIcm3vORGQQTnEBu Rp7t8CPu8oa572O6h2mWSkOPWZqT7I5tb4CKc3RNdgidozfLQb85oQy0SC0dsx/hRH1h FCfe5KKFz14lj3gphKm+vqGsNkPx3rL2OWf+NXpokAPiA5iwvNS2V27ClJklcc5VG0o9 TujA== 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=a5h1btInhInaM7hq+iKiAihkfGUwsyOAV9vhXUtObFg=; b=OLrhADtd+ANjuBANm5vX5iTx4eKS9fpxRvWs2SOLiC41fj7H1aweBJKLgnZ1mK1n5k eAn7vIXuR1PMfGSEuNIHfdZqRk0egiO7gd9ihr2YxgNoYOZV/i6WQ1lwMyZ957YaA5VD xGiHJNM15gyIO5IjrDIj7pyc9AvInkabGviG8Q2UWRt7RCjlYKZxO/4jMUCFWAyPIjdd 5AwTUA8Vz64AcRxQ42DbT36vIaPT2uQqJ5JzqKi2WUxJnowrhSTz3h8yDfd2kap7sOw0 ZTiUZscJkj/92uX4mAxhZL1G8M446sYbrQZdeUfKpiFyPtTjWEira4ui7vITjzBs+WUY jY0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=LAhs5R6N; 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.27; Thu, 07 Jun 2018 04:06:28 -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=LAhs5R6N; 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 S1753187AbeFGLG1 (ORCPT + 3 others); Thu, 7 Jun 2018 07:06:27 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:44682 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753248AbeFGLGY (ORCPT ); Thu, 7 Jun 2018 07:06:24 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180607110622euoutp01007a98abf08c067b2f5b5a76d28e96be~13AmtyKbd1891918919euoutp01u; Thu, 7 Jun 2018 11:06:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180607110622euoutp01007a98abf08c067b2f5b5a76d28e96be~13AmtyKbd1891918919euoutp01u DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528369582; bh=5r7BEaAxe955uiDdFHdPf7B/9BuUIKAvA++ZQGQceRo=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=LAhs5R6Nm+uOT0GYXErRexWIA2ce/iB37ClkyTLWshBSEn4vuDJ3I4n1mlgMchCoA mZu/2Eo3ABMlEGIbG3HE9gDwOfsNWvuGauDra8jyJ+hL7frVcj3Bw2cA8FmX1tmFQx 5mo8j/zz9tx4uyteyEDUzAK8XpO0sTzrKv2hmY3Y= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180607110621eucas1p2780919074a71737f9f058a3c229b979f~13Al8SyZw1744217442eucas1p20; Thu, 7 Jun 2018 11:06:21 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id CD.43.10409.DA1191B5; Thu, 7 Jun 2018 12:06:21 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180607110620eucas1p232e27feadc19554ba0b344b8059ce337~13AlD9i892643926439eucas1p2k; Thu, 7 Jun 2018 11:06:20 +0000 (GMT) X-AuditID: cbfec7f5-b5fff700000028a9-7c-5b1911ad1f97 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 19.AD.04178.CA1191B5; Thu, 7 Jun 2018 12:06:20 +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:20 +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 3/9] drm/exynos: scaler: Reset hardware before starting the operation Date: Thu, 07 Jun 2018 13:06:08 +0200 Message-id: <20180607110614.335-4-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+NgFlrEIsWRmVeSWpSXmKPExsWy7djPc7prBSWjDU5+FLOY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr48DtjawFx4Uq9p1eyNLAeIG/i5GTQ0LAROLI1FXsXYxcHEICKxglFp17yQThfGaU 6F44hRmm6tTLnWwQiWWMEk3vHkK1NDBJ3J04lx2kik3AUKLrbRcbiC0i4CbRdHgmK0gRs8Bj Rom1uzeDFQkLhEv8/9ECNpZFQFXix9PtYHFeAWuJo8+uskCsk5dYveEAWA2ngI3E+WWbwG6S EPjJKrHt+Tqom1wk3h58yg5hC0u8Or4FypaR6Ow4CNXQzCjRPmMWO4TTwyixdc4ONogqa4nD xy+ygtjMAnwSk7ZNB5rKARTnlehoE4Io8ZC4veEB1NP9jBJHXh1nnsAouYCRYRWjeGppcW56 arFxXmq5XnFibnFpXrpecn7uJkZgzJ3+d/zrDsZ9f5IOMQpwMCrx8DbcF48WYk0sK67MPcQo wcGsJMKbeEksWog3JbGyKrUoP76oNCe1+BCjNAeLkjhvnEZdlJBAemJJanZqakFqEUyWiYNT qoExzinSWWjlvg92NyU2N7ncmdjKpBi/0GPdSp0rWQdKRaSWaE9fcndR1M2nM55Wzf7xIl19 1uWtpopr3fwPLed9yyCg1OX557OYcl9VtX/rKb9I5sdrufzfrkt4bReRXui58ZzE6mPbS87c 7a41P779d3G4RujpsK3sNsd3vVWZe6r5a3nTpWhtJZbijERDLeai4kQAnweqi7UCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xy7prBCWjDW7NMbSY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr48DtjawFx4Uq9p1eyNLAeIG/i5GTQ0LAROLUy51sXYxcHEICSxglGpavY4dwmpgk Hi44yApSxSZgKNH1tosNxBYRcJNoOjyTFaSIWeAxo8THbafAioQFwiX+/2hhBrFZBFQlfjzd zg5i8wpYSxx9dpUFYp28xOoNB8BqOAVsJM4v28QEYgsB1bx9cJp9AiPPAkaGVYwiqaXFuem5 xYZ6xYm5xaV56XrJ+bmbGIGhsu3Yz807GC9tDD7EKMDBqMTD23BfPFqINbGsuDL3EKMEB7OS CG/iJbFoId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rznDSqjhATSE0tSs1NTC1KLYLJMHJxSDYxT NPbG3l6TFhdz9vlhXombu2Lj0ieqNmu4Oqw7fIf1xYZ98n7rgg6w9J95pXRgzS4Hn3m8nhfk U63cJ1e/mqzHo1DAHfRCacmFyYxh85pMfp6aLZnj1Wrcz+Glk3+Ocd5uN+FcPsGLurEJaSaX eAv3ymfdf9SmVtn09u1SMYedUranLA7vP67EUpyRaKjFXFScCAA3ryMyEQIAAA== X-CMS-MailID: 20180607110620eucas1p232e27feadc19554ba0b344b8059ce337 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180607110620eucas1p232e27feadc19554ba0b344b8059ce337 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 From: Andrzej Pietrasiewicz Ensure that Scaler hardware is properly reset and interrupts are cleared before processing next image. Signed-off-by: Andrzej Pietrasiewicz Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_scaler.c | 32 ++++++++++++++++++++-- 1 file changed, 29 insertions(+), 3 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_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index 91d4382343d0..d25069e88186 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c @@ -30,6 +30,7 @@ #define scaler_write(cfg, offset) writel(cfg, scaler->regs + (offset)) #define SCALER_MAX_CLK 4 #define SCALER_AUTOSUSPEND_DELAY 2000 +#define SCALER_RESET_WAIT_RETRIES 100 struct scaler_data { const char *clk_name[SCALER_MAX_CLK]; @@ -100,6 +101,23 @@ static u32 scaler_get_format(u32 drm_fmt) return 0; } +static inline int scaler_reset(struct scaler_context *scaler) +{ + int retry = SCALER_RESET_WAIT_RETRIES; + + scaler_write(SCALER_CFG_SOFT_RESET, SCALER_CFG); + do { + cpu_relax(); + } while (retry > 1 && + scaler_read(SCALER_CFG) & SCALER_CFG_SOFT_RESET); + do { + cpu_relax(); + scaler_write(1, SCALER_INT_EN); + } while (retry > 0 && scaler_read(SCALER_INT_EN) != 1); + + return retry ? 0 : -EIO; +} + static inline void scaler_enable_int(struct scaler_context *scaler) { u32 val; @@ -354,9 +372,13 @@ static int scaler_commit(struct exynos_drm_ipp *ipp, u32 dst_fmt = scaler_get_format(task->dst.buf.fourcc); struct drm_exynos_ipp_task_rect *dst_pos = &task->dst.rect; - scaler->task = task; - pm_runtime_get_sync(scaler->dev); + if (scaler_reset(scaler)) { + pm_runtime_put(scaler->dev); + return -EIO; + } + + scaler->task = task; scaler_set_src_fmt(scaler, src_fmt); scaler_set_src_base(scaler, &task->src); @@ -394,7 +416,11 @@ static inline void scaler_disable_int(struct scaler_context *scaler) static inline u32 scaler_get_int_status(struct scaler_context *scaler) { - return scaler_read(SCALER_INT_STATUS); + u32 val = scaler_read(SCALER_INT_STATUS); + + scaler_write(val, SCALER_INT_STATUS); + + return val; } static inline int scaler_task_done(u32 val) From patchwork Thu Jun 7 11:06:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 137865 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1948438lji; Thu, 7 Jun 2018 04:06:27 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIAlQohGNnOGq9/lQ+bhlxPg7CkfkRDZx0LaCFTGi7BbjHigm2kD+RzplmPouH1P/WYbyxh X-Received: by 2002:a62:67c5:: with SMTP id t66-v6mr1403873pfj.20.1528369587718; Thu, 07 Jun 2018 04:06:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369587; cv=none; d=google.com; s=arc-20160816; b=WyERfKgrTDHs9sTvV0cVIteAUqj+W8I78zebtufQDCB0Ia81sk9X5D5DJG2LckX0Ln D9AsrJfllBeUdQ/6t9NniIs/TWWhp/ICexKUBXR9EBvM+RM4KskU9M16GV3HsdbRIdsC KGK7vb2SLXbIx7lFphSqMQrUdwE8p7SZK9EVP5F0pNXAf1Xs7JQbVuskmz0LHEySJKeQ jsJV6cYg2Am95E4UFFYBBP3G9DMZDJkG40UwUl7kWWdv+y24dsGwkhFhQKkyyxRcWJRP 69MYzRs53ieZAyVmw4amAWFauTrBHah7MMK/qFasYMFvUlnoMvftK44uFD3N+v9xY58z pUwg== 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=pztakAlwKkFx35U2cQvW5Cd5vT1IMPK8OpF20yLlceM=; b=eIKpPIe5t1hoCEjsLaO4472RzpEfmg8n7amkZN/4CEEHpwVUIjb03+iAy1OgtPwM6w 7S64CPlgdNJqHTz/PNHWyXlSxj3WXu3Y1YELpoZa2ONgQa8QJrawZofqcXe7hnoCeJ+6 Qz1AoP4ztNvJTh5GEqryweCkQcJY1lvXPJd++AYQReOgnuUj4V1cZ93fn4gVZ/7+RAqA 4SZ73aZdrmT2egi7WBiXvRjsPBSxwlRSHvdM1pEkQgoQn5TXTCY2/YN0faTIn2UvnarB JUGMmUpznmN04LO+W+kSz2imdQL5UhYDSeg9S3DvxVFQG6LKU5X8ALnJsZD5lAL9pvAr GS7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=Zf7yV87H; 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.27; Thu, 07 Jun 2018 04:06:27 -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=Zf7yV87H; 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 S1753149AbeFGLG0 (ORCPT + 3 others); Thu, 7 Jun 2018 07:06:26 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:33815 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753187AbeFGLGY (ORCPT ); Thu, 7 Jun 2018 07:06:24 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180607110622euoutp0258163a0d844657ff666171593e25b3d8~13Am9bVHA2986729867euoutp02B; Thu, 7 Jun 2018 11:06:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180607110622euoutp0258163a0d844657ff666171593e25b3d8~13Am9bVHA2986729867euoutp02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528369582; bh=su+u0s+LhfjC4aCVrfmAL23qFgMkkexjgBb59P0WpOU=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Zf7yV87HjfH6NxAgNoQgAbAWUG/3p6RSrXtYk3x1ROqBf/TMiEtLLIz1PLmBP73Lp Q0aE5ToeVCNWQi99kA7VMpdsjy1r4tgUHJWrT3d8Raq5W3iAgThnx0OTq+3h7ke9Bl 3IOaIGBRrNAOusAnpZTdZgU9gAqZhVGRwPA6n+cI= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110622eucas1p171172d0bd6a4acd3c44ec909514bdc46~13AmHpoiL0961309613eucas1p1U; Thu, 7 Jun 2018 11:06:22 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id FD.B8.05700.DA1191B5; Thu, 7 Jun 2018 12:06:21 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110621eucas1p1ae6f19b0b2fcd47f89f088ff81e36155~13AlWUzlq2075820758eucas1p13; Thu, 7 Jun 2018 11:06:21 +0000 (GMT) X-AuditID: cbfec7f2-1c1ff70000011644-bb-5b1911ad9a8a Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 20.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 Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Andrzej Pietrasiewicz Subject: [PATCH 4/9] drm/exynos: scaler: Fix support for YUV420, YUV422 and YUV444 modes Date: Thu, 07 Jun 2018 13:06:09 +0200 Message-id: <20180607110614.335-5-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+NgFlrAIsWRmVeSWpSXmKPExsWy7djP87prBSWjDRaf07OY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4+K5EywFO7krWu98ZWtgvMLZxcjJISFgIvFi9n2mLkYuDiGBFYwSNzYvYIVwPjNK XF0/mxWmave8FywQiWWMEt96VzFDOA1MEsv/bWcDqWITMJToetsFZosIuEk0HZ4JNopZ4DGj xNrdm9lBEsICURI35i9i7GLk4GARUJVo6mUECfMKWEvs7V7HCLFNXmL1hgPMIDangI3E+WWb mCDiP1klrlwVhbBdJOZ92wl1nbDEq+Nb2CFsGYnLk7vBLpUQaGaUaJ8xix3C6WGU2DpnBxtE lbXE4eMXwbqZBfgkJm2bzgxykIQAr0RHmxBEiYfEiTVrob7sZ5Q4MPkG8wRGyQWMDKsYxVNL i3PTU4sN81LL9YoTc4tL89L1kvNzNzEC4+30v+OfdjB+vZR0iFGAg1GJh/fGQ/FoIdbEsuLK 3EOMEhzMSiK8iZfEooV4UxIrq1KL8uOLSnNSiw8xSnOwKInzxmnURQkJpCeWpGanphakFsFk mTg4pRoYN1XxLVgtOP2KOWNxaKy4rHDfYlv5htmvyibwzXW6E+e9LlVf6ldpQwbPiXn7Jj75 V2U44VNpzJkYnsuiV9IYCjaZ8Kg8qQ5J4Jt4ZsWLl4dyRA95fLNffFCBe770n/VzfyyXW++3 TEq1b14M1/rpG/isJXwl2Q7ZKfpEuMiKOOTN/pAg3zhViaU4I9FQi7moOBEARgG2VbMCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLJMWRmVeSWpSXmKPExsVy+t/xy7prBSWjDZZM5LKY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4+K5EywFO7krWu98ZWtgvMLZxcjJISFgIrF73guWLkYuDiGBJYwSk7bsZYVwmpgk LizZxw5SxSZgKNH1tosNxBYRcJNoOjwTrIhZ4DGjxMdtp1hBEsICURIrdrQAjeLgYBFQlWjq ZQQJ8wpYS+ztXscIsU1eYvWGA8wgNqeAjcT5ZZuYQGwhoJq3D06zT2DkWcDIsIpRJLW0ODc9 t9hIrzgxt7g0L10vOT93EyMwULYd+7llB2PXu+BDjAIcjEo8vDceikcLsSaWFVfmHmKU4GBW EuFNvCQWLcSbklhZlVqUH19UmpNafIhRmoNFSZz3vEFllJBAemJJanZqakFqEUyWiYNTqoFx /4431vutiiSvdXx8u01xmrDjy427TNX7/9YKbDwSK8YlYRuTf2LJ7EsdJvHVl6I+fdFicfY6 cfzuiQ252jyTGmsW2B4qOtGRUGD/5sYe1v2t/S039kcxPt7IeflG6MrD4d/vRjw5lz1p3bGN d9vEmjPfyGcc32XvIvS/+XkJ+4zVJkeLxD8WKbEUZyQaajEXFScCAOmDQB4QAgAA X-CMS-MailID: 20180607110621eucas1p1ae6f19b0b2fcd47f89f088ff81e36155 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180607110621eucas1p1ae6f19b0b2fcd47f89f088ff81e36155 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 Fix Cb/CR components order in two-planar YUV420, YUV422 and YUV444 modes. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_scaler.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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_scaler.c b/drivers/gpu/drm/exynos/exynos_drm_scaler.c index d25069e88186..0ddb6eec7b11 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_scaler.c +++ b/drivers/gpu/drm/exynos/exynos_drm_scaler.c @@ -52,9 +52,9 @@ struct scaler_context { static u32 scaler_get_format(u32 drm_fmt) { switch (drm_fmt) { - case DRM_FORMAT_NV21: - return SCALER_YUV420_2P_UV; case DRM_FORMAT_NV12: + return SCALER_YUV420_2P_UV; + case DRM_FORMAT_NV21: return SCALER_YUV420_2P_VU; case DRM_FORMAT_YUV420: return SCALER_YUV420_3P; @@ -64,15 +64,15 @@ static u32 scaler_get_format(u32 drm_fmt) return SCALER_YUV422_1P_UYVY; case DRM_FORMAT_YVYU: return SCALER_YUV422_1P_YVYU; - case DRM_FORMAT_NV61: - return SCALER_YUV422_2P_UV; case DRM_FORMAT_NV16: + return SCALER_YUV422_2P_UV; + case DRM_FORMAT_NV61: return SCALER_YUV422_2P_VU; case DRM_FORMAT_YUV422: return SCALER_YUV422_3P; - case DRM_FORMAT_NV42: - return SCALER_YUV444_2P_UV; case DRM_FORMAT_NV24: + return SCALER_YUV444_2P_UV; + case DRM_FORMAT_NV42: return SCALER_YUV444_2P_VU; case DRM_FORMAT_YUV444: return SCALER_YUV444_3P; 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: 137867 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1948468lji; Thu, 7 Jun 2018 04:06:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ2rWPYP7KvjGGVJnhPHZ5AG7Xdly4eJb6sQBpblrIG14HX40pnPKwF1k3e/xb4Pa0uQztx X-Received: by 2002:a62:3a59:: with SMTP id h86-v6mr1357636pfa.209.1528369589102; Thu, 07 Jun 2018 04:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369589; cv=none; d=google.com; s=arc-20160816; b=VkcxmRxdCxpv2b39DwApI7qCZ0uCgkw0f7p+u5UGgyQUdCOIdhnpT1VGxU5X67vVpW sizM4Bx5rpZAXdZ7X/A6Bo+eAlPDvZ/Fzq2L27MI5COqKsjv8+y8pRmkjcmyyEfckQro 1O369CcBNWu23MhdN85mZN2xopkAm1l8odvCE0ovOifrLZi6pDBrb1h1dWbSAxkgfkUn eAiYN+Ogqziu77MHmPXlY/gxODyX2fGAb6mxegnh2DvcoMMWXHUDka18CiB4VxxMuJmE 928B0I1VKdwbFIz+gRqmJ9DjCQcFwvrYRduYXiS4E3IupI3a2MFT5YMHyBz6PrVNpTnJ vw9w== 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=LtNshPPAPPEe3h7c0YMBi6/H+cMYe84KwVpvccZdlyU=; b=w8fOeo9gWe8VVcdHx1scJaJ5pUoVXUkNCHadexyKIxIpoNc0PY8Xol3oT6RaJ6yHRr unHOiTFrwp+kfwdBC564I0RfgvuI9AwliRdfWl54aO2hPaKl/7ajpUzuPvnSEDhop80B 7CFutvwYoI/BkEc7HUKSk9+CEKqS0ju8OshEqH8jmSoVI6zeOUyME8ilJ8f3aIf/+xJj 2cTZQgL743W1moCWPUH18cUHDd25m4jgdAme/UIkfgLfr+6QLFDHNm40EuTvyQ5SsR6u k2r556LKxP0b9WKbHaZhLSDAr6areeTrAWlzWvyGFhQQGRFenKHZFY9qYavJqVLQrLzW Moow== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=tKavnv5J; 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.28; Thu, 07 Jun 2018 04:06:29 -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=tKavnv5J; 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 S1753410AbeFGLG2 (ORCPT + 3 others); Thu, 7 Jun 2018 07:06:28 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:44688 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753319AbeFGLGZ (ORCPT ); Thu, 7 Jun 2018 07:06:25 -0400 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528369583; bh=mMnAnhDIqnqAnRDLD8VjTEwjoXGkAUdTro+aXoq5CKM=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=tKavnv5JYmdcUgkIaGQJoLShJupnaKbrzLUIfzD8hnigmICUjpDj0ZcNfKeqQRySK YepxaAaDvahkVhi9FqDLb1WZx0z53s63//bJeoFjtiEuMFAHy2YKnJExXZ7P+V8fvP /NsBWg3t/XeiHEZqzUrjVlfgr5zb6T3EC7Zfz4bk= 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 Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Andrzej Pietrasiewicz 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: H4sIAAAAAAAAA+NgFprHIsWRmVeSWpSXmKPExsWy7djPc7rrBCWjDe63MFnMetnOYrFxxnpW iytf37NZTLo/gcVixvl9TBZrj9xlt5gx+SWbA7vH/e7jTB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CVseF8YMFPzoqmtS3sDYz7OboYOTgkBEwkplwp6GLk4hASWMEocfvcWiYI5zOjxNK2 O+xdjOxgRRdNIcLLGCWWdy9mhnAamCSW/9vO1sXIycEmYCjR9bYLzBYRcJNoOjyTFaSIWeAx o8Ta3ZvZQRLCAlESl/62gxWxCKhKNK5fwwhi8wpYS/xvus8KYksIyEus3nCAGcTmFLCROL9s E9hFEgI/WSUOzp7HDFHkIjH73GoWCFtY4tXxLewQtozE5cndLBANzYwS7TNmsUM4PYwSW+fs YIOospY4fPwi2DpmAT6JSdumM0MCg1eio00IosRDYvL0g+wQf/YzSjSfWcc0gVFyASPDKkbx 1NLi3PTUYuO81HK94sTc4tK8dL3k/NxNjMBYO/3v+NcdjPv+JB1iFOBgVOLhbbgvHi3EmlhW XJl7iFGCg1lJhDfxkli0EG9KYmVValF+fFFpTmrxIUZpDhYlcd44jbooIYH0xJLU7NTUgtQi mCwTB6dUA6PcuV3LtwlrMwa498251WrCbVW/r+Hk2V9K28qXXpbfsOiwRB6bijuD04dQndwb JtldNft/rXyR9PbC9ZmJ54PTjvEuiCiZwDvbjkGb44+ZlE/K77yTt4Lq6xM1nDuaDrmICi6p nWKqtf5nT/lC28oZi1gju2/oX/5m2VVh49UmkG11+EdSjxJLcUaioRZzUXEiAKnrq82xAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNJMWRmVeSWpSXmKPExsVy+t/xy7prBSWjDd6uVLSY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoErY8P5wIKfnBVNa1vYGxj3c3QxsnNICJhIXDTtYuTiEBJYwijxquk7E4TTxCRxYck+ 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> 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_gsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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_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); From patchwork Thu Jun 7 11:06:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 137868 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1948493lji; Thu, 7 Jun 2018 04:06:29 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIgFH7fYrdSiUgbaNl+g8aBwFJElJYOjz9FH4Ay6fLefcayuzSRmp3a7sYQ7MsUSQnOGleo X-Received: by 2002:a62:f5da:: with SMTP id b87-v6mr1364262pfm.113.1528369589792; Thu, 07 Jun 2018 04:06:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369589; cv=none; d=google.com; s=arc-20160816; b=MG5ohoUWHBri/O9cb+YnyCBFeuhBpZjj8vKgep+PIWQJlHCDz9v6iIhcBbiz3O8zFR 6RlB46piQUcL4F4OPGhUJhhw8XG8A89b8yyZzPXKRFVyxFmnb8uzEUgvMIG1oHqiWV29 ZG19ED8GpUjWW2dnKg3uOzQiQFrnlW9y53+I29iuz+9Zie9XGdZyNSZQXAF0e+Md2atX 5YSkeS+5xprfMU9zc46n6RCaQxikhj9CIWpfFs7bQN0RpnJl+GXl+UYZavSK9zKjcY1C +seiqqUHSr2J1zOLGE8Sod4bjCaU/jidItqlbvrozgHOBOo/M8eF9VYJZm2QuuzSIyCz KHQw== 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=Vk3oTxR2VZlrM4aTROZ3szmjaeJuHH0KklL/IH9QO90=; b=kzOVU0jb/MwzSQxMfwyr2UstIFT07JeIWI9NUcKyWOTfhAb1PnvbGlbFdqQJsT+7Q2 0UxEG3f17VdzxfWHNjbbioscUHt9cx47svXoU3+IdoyKSYYY6JbP56ENMnXYfPCxStsO rrBoCMnpbSrQMtxv2vZKx5cjTsDyP5zg8AVl3sypbz/KG7h3Lo8pe5i33QhCZ+o7Ib8+ kNd5hPiEDGJdeJ5idNNwUkhuYPDODon5MH9thPHgEdQ+3ncHEBYYhF5iM8zN58/podb2 zqYCCczzFnSHPFOR1AM53MPFad/ekMYwilnuXo/TlOkXZecuUhxoihLSkaqpv7Cv2GSS 0O1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=Aga0xesE; 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.29; Thu, 07 Jun 2018 04:06:29 -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=Aga0xesE; 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 S1753319AbeFGLG2 (ORCPT + 3 others); Thu, 7 Jun 2018 07:06:28 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:33820 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753280AbeFGLGZ (ORCPT ); Thu, 7 Jun 2018 07:06:25 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180607110624euoutp0284a9183b9a0c31850f12060c01894706~13AoCb9tN2986729867euoutp02C; Thu, 7 Jun 2018 11:06:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180607110624euoutp0284a9183b9a0c31850f12060c01894706~13AoCb9tN2986729867euoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528369584; bh=LMFv56FPvs+8QNal/Ji43Udj1y1hFph2zTOGcfBjUKU=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Aga0xesEjJkm0ffTgsj7sx0ZCNHKHq42NXdoHjiknFR8mYXil+jNSkMljSFjmmjXv NZR6yHsm2Ofg7OiEAe7pPKFAqpiTULWi7ToxXbOAOw4SaM7k3kn9VZ4Lmb2//Va2pY +KFiFKtq3s0Q95yUPh+IcEWkSH9yz3pp6Q2NpHho= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110623eucas1p1190caebdf24e8d842c68e21b44bb9ae5~13AnTuiXu0967009670eucas1p1O; Thu, 7 Jun 2018 11:06:23 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id B1.A6.17380.EA1191B5; Thu, 7 Jun 2018 12:06:23 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180607110622eucas1p279bc9784770d10df8c7d5330bac154ad~13Amm4pTq1744617446eucas1p2z; Thu, 7 Jun 2018 11:06:22 +0000 (GMT) X-AuditID: cbfec7f4-713ff700000043e4-7a-5b1911aee6af Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2A.AD.04178.EA1191B5; Thu, 7 Jun 2018 12:06:22 +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 Cc: Marek Szyprowski , Inki Dae , Seung-Woo Kim , Bartlomiej Zolnierkiewicz , Andrzej Pietrasiewicz Subject: [PATCH 6/9] drm/exynos: gsc: Increase Exynos5433 buffer width alignment to 16 pixels Date: Thu, 07 Jun 2018 13:06:11 +0200 Message-id: <20180607110614.335-7-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+NgFprPIsWRmVeSWpSXmKPExsWy7djP87rrBSWjDdatYLSY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEro+VlF3NBH0fFrsuLWRsYL7F1MXJySAiYSPzrm84EYgsJrGCUeD49tIuRC8j+zCix eNF+VpiiNw9fQhUtY5S4fEoRoqiBSWL5v+1gk9gEDCW63naB2SICbhJNh2eyghQxCzxmlFi7 ezM7SEJYIF7iypn9zCA2i4CqxLaWX2AbeAWsJZZ+XsoIsU1eYvWGA2A1nAI2EueXbWICGSQh 8JVVon/TdmaIIheJNZMXQ50nLPHq+BZ2CFtGorPjIFRDM6NE+4xZ7BBOD6PE1jk7oL62ljh8 /CJYN7MAn8SkbdOBpnIAxXklOtqEIEwPiZ3/iyDe7GeUmL1mHvsERskFjAyrGMVTS4tz01OL jfJSy/WKE3OLS/PS9ZLzczcxAqPt9L/jX3Yw7vqTdIhRgINRiYe34b54tBBrYllxZe4hRgkO ZiUR3sRLYtFCvCmJlVWpRfnxRaU5qcWHGKU5WJTEeeM06qKEBNITS1KzU1MLUotgskwcnFIN jFwXu//VOE8xWSx88ZH9ghXdK6J1opav8GNe83XKYinTO00cPIsEo/Y94s/keNcoUC6iEa6r 95+R1dSp69arvffmMxX2pP/707H09tQ4a4fz2imvl6gdEskOL1065Xkqd/G/Ggft6Qcn1zLO MJ2wMXIWa2Jzrt2ajjAG4SarZ+9fHblz7Sf/WiWW4oxEQy3mouJEAMsM1xeyAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xy7rrBCWjDfr+KFrMetnOYrFxxnpW iytf37NZTLo/gcVixvl9TBZrj9xlt5gx+SWbA7vH/e7jTB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CV0fKyi7mgj6Ni1+XFrA2Ml9i6GDk5JARMJN48fMnUxcjFISSwhFGi+fVXKKeJSeLC kn3sIFVsAoYSXW+7wDpEBNwkmg7PZAUpYhZ4zCjxcdspVpCEsEC8xJUz+5lBbBYBVYltLb/A 4rwC1hJLPy9lhFgnL7F6wwGwGk4BG4nzyzYxgdhCQDVvH5xmn8DIs4CRYRWjSGppcW56brGh XnFibnFpXrpecn7uJkZgqGw79nPzDsZLG4MPMQpwMCrx8DbcF48WYk0sK67MPcQowcGsJMKb eEksWog3JbGyKrUoP76oNCe1+BCjNAeLkjjveYPKKCGB9MSS1OzU1ILUIpgsEwenVANjkodU 6AEV9XO6m4zmtnycvjJ48w8ddcmZ7Rbd7m5766c2y4lmHjthsT06rLFTVyia4dmTF/Ll3GxF GVzHArfsnXVb92r2M+1IlTzevFLHnvCpVfMuvTeJXmk6x22z5dNOzaCUiu8npPTWLdBLEXXr FpzKuW9ezVUpy6fLQpfPnPfCc57GwRNKLMUZiYZazEXFiQBW+JGoEQIAAA== X-CMS-MailID: 20180607110622eucas1p279bc9784770d10df8c7d5330bac154ad X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180607110622eucas1p279bc9784770d10df8c7d5330bac154ad 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 Investigation revealed that GScaler hardware requires the real buffer width (pitch) to be aligned to 16 pixels. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 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_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index ee27f7fdc7ab..988b391c886a 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -1340,7 +1340,7 @@ static const struct drm_exynos_ipp_limit gsc_5420_limits[] = { }; static const struct drm_exynos_ipp_limit gsc_5433_limits[] = { - { IPP_SIZE_LIMIT(BUFFER, .h = { 32, 8191, 2 }, .v = { 16, 8191, 2 }) }, + { IPP_SIZE_LIMIT(BUFFER, .h = { 32, 8191, 16 }, .v = { 16, 8191, 2 }) }, { IPP_SIZE_LIMIT(AREA, .h = { 16, 4800, 1 }, .v = { 8, 3344, 1 }) }, { IPP_SIZE_LIMIT(ROTATED, .h = { 32, 2047 }, .v = { 8, 8191 }) }, { IPP_SCALE_LIMIT(.h = { (1 << 16) / 16, (1 << 16) * 8 }, From patchwork Thu Jun 7 11:06:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 137869 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1948505lji; Thu, 7 Jun 2018 04:06:30 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLxwjTwcE3d9RwVFu5X9vqHoKzsoB9jgK4C/LW7WxanVxTu0F19roPt1cs1eHcNrlkc1inH X-Received: by 2002:a65:550d:: with SMTP id f13-v6mr1201519pgr.324.1528369590507; Thu, 07 Jun 2018 04:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369590; cv=none; d=google.com; s=arc-20160816; b=Wt/Ww0SiT83r5EjzhujA5j3WCBV9dyOWAIpob/NzJpkDd63vif+PasxHNJRUP5HoMs d9DRNHflvYqPrj9KaKEwXGgYUgcAbfURFRV/+jzSJq4FzqyDVwYnqCOWKyYeyXftm56u z+tgEGOVWUXDNYDRsL8U7NnI9FcyDCl/DZMCo4McuaTh96zLYuxisJH4FEJchiqnSkEl /qBKqgvWdiZrLHM2+kHKM9ODrmf5mlpx5hd8yngci+ZG+S8daIAakHMcMLWZBelSZgXu oBZzkzg0XaNwidKABocTSZGGOUyjb8ttw3nfGUO2XGqXuhvskjfAjta20U6lhKim5HOK MZmw== 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=q3dtszU1fVNbXzP4hOcMpV9/SMTmorBEsSwwKRQ6xxk=; b=jzt2zak5wvSClJrfEmqUrTZwul5BBG/7bfyj+FiqyoDsTxuel2mwRzv38j7dBxuSY7 bnyoTmIGiV2Vbm8pPOZ6Lk9QywgLhsUqT2cHBSSexon5bIa8Mq2blLs5ipsLxKMPt7h3 wHxGY+NkrAr/ndO3wDB0Al1ppMMEoczTz9LHP6VbKBXMBCfBmlmQm/dgGfBBXH249xF3 P0vO3z7aXWUA0C/wgAlTyGj4hTXEYmVJs7own5kX6L536IuVOhMFUCSS1kghOzcdLnb7 Gl/XxLlVEEX4xQ7l/ZJmvamgtmLj3t3nYE1OJ0r9HKN5a/aOVfimxvC4+fa0iHjEfjHF Ve9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=FrCQa2H9; 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.30; Thu, 07 Jun 2018 04:06:30 -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=FrCQa2H9; 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 S1753280AbeFGLG3 (ORCPT + 3 others); Thu, 7 Jun 2018 07:06:29 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:44694 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752972AbeFGLGZ (ORCPT ); Thu, 7 Jun 2018 07:06:25 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180607110624euoutp010fb48e0f2c388bb8ee2ff46c19a3617b~13AoCZb9c1891918919euoutp01x; Thu, 7 Jun 2018 11:06:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180607110624euoutp010fb48e0f2c388bb8ee2ff46c19a3617b~13AoCZb9c1891918919euoutp01x DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528369584; bh=BNyQ6gEKF+e3e3qEBtXQWC92uBNL6hb0jec45jlWGIQ=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=FrCQa2H9Bfe8y1KRH8O83GNgDihw2eY62DOcTvGxCAlBL5eWNhXtR+DevgC9uc4jg pvm6dsBr6FfFyP5vkzwocfGzJu3nFfyDD1LOvkHqxnuxjIFptbt7LAPUk65dfJgqBV IwGUiCcded9oXDtd+Z3strtW8inbahLPjuqM6+7s= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110623eucas1p1e2172ad92fa08c3b03e77f3ace2384e8~13AnU4xne0960009600eucas1p1j; Thu, 7 Jun 2018 11:06:23 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 9E.B8.05700.FA1191B5; Thu, 7 Jun 2018 12:06:23 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180607110622eucas1p260439bb32091de7d6ca76337c97d2526~13AmpHFtg1566115661eucas1p22; Thu, 7 Jun 2018 11:06:22 +0000 (GMT) X-AuditID: cbfec7f2-1c1ff70000011644-bf-5b1911af0a68 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 3A.AD.04178.EA1191B5; Thu, 7 Jun 2018 12:06:22 +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 7/9] drm/exynos: gsc: Fix DRM_MODE_REFLECT_{X,Y} interpretation Date: Thu, 07 Jun 2018 13:06:12 +0200 Message-id: <20180607110614.335-8-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+NgFlrIIsWRmVeSWpSXmKPExsWy7djPc7rrBSWjDb6uZ7WY9bKdxWLjDCDr ytf3bBaT7k9gsZhxfh+Txdojd9ktZkx+yebA7nG/+ziTR9+WVYwenzfJBTBHcdmkpOZklqUW 6dslcGXc/XOSveAXb8Xr5/NZGhjXcncxcnJICJhIXJowj6mLkYtDSGAFo8TLWx8ZQRJCAp8Z JfY/NYQpat7/jAWiaBmjxJbNq6CcBiaJTXO/MoFUsQkYSnS97WIDsUUE3CSaDs9kBSliFnjM KLF292Z2kISwQKDE/bZfYDaLgKrE/7X/wdbxClhLdMy8zwaxTl5i9YYDzCA2p4CNxPllm8Du kxD4ySrx/vQ0dogiF4mXK09DNQhLvDq+BSouI9HZcRCqoZlRon3GLHYIp4dRYuucHVAd1hKH j19kBbGZBfgkJm2bDrSOAyjOK9HRJgRR4iHxaMMeaMj0M0osfLqZeQKj5AJGhlWM4qmlxbnp qcWGeanlesWJucWleel6yfm5mxiBEXf63/FPOxi/Xko6xCjAwajEw3vjoXi0EGtiWXFl7iFG CQ5mJRHexEti0UK8KYmVValF+fFFpTmpxYcYpTlYlMR54zTqooQE0hNLUrNTUwtSi2CyTByc Ug2M27eEMxy6eWRhW3t9irH06rt6Ofe83s5d5nVoEUftnRK2zrPtPNpl9Wdm3p/tzcf8VOr6 g8WrJRTzJ5Y0iIVuXd7DXdm7py7X4Fy286bXrc87ZNLkGfd/iV1t0xofaH5aZ3dX01eF+KdO FrtYA0u4w+bydMzdvjN0gYKXosDfrar/nq2oub5fiaU4I9FQi7moOBEAfVVzdrQCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xy7rrBCWjDZqnK1vMetnOYrFxxnpW iytf37NZTLo/gcVixvl9TBZrj9xlt5gx+SWbA7vH/e7jTB59W1YxenzeJBfAHMVlk5Kak1mW WqRvl8CVcffPSfaCX7wVr5/PZ2lgXMvdxcjJISFgItG8/xlLFyMXh5DAEkaJ2b/mM0M4TUwS LxZ8ZAepYhMwlOh628UGYosIuEk0HZ7JClLELPCYUeLjtlOsIAlhAX+J+w/esoDYLAKqEv/X /mcEsXkFrCU6Zt5ng1gnL7F6wwFmEJtTwEbi/LJNTCC2EFDN2wen2Scw8ixgZFjFKJJaWpyb nltsqFecmFtcmpeul5yfu4kRGCrbjv3cvIPx0sbgQ4wCHIxKPLwN98WjhVgTy4orcw8xSnAw K4nwJl4SixbiTUmsrEotyo8vKs1JLT7EKM3BoiTOe96gMkpIID2xJDU7NbUgtQgmy8TBKdXA yHyg6jvL3a63u3L6Ne0lHV0ZPVjaC1kja2sXTZX7x9jzYMGNWSq7vO1sH+btsEo8Y/zm8TSx gv4w6w/x5/bPui/8yj6l4+PV76s+fnJwmrK2oYGRzWJd/r6/jKJvV62OmtS9YiHX6UV2jOxc bMbb1nBWyc6/f/2l0fzW62dMJ8ScKdlowpySqcRSnJFoqMVcVJwIAFIojYgRAgAA X-CMS-MailID: 20180607110622eucas1p260439bb32091de7d6ca76337c97d2526 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180607110622eucas1p260439bb32091de7d6ca76337c97d2526 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 Horizontal (DRM_MODE_REFLECT_Y) and vertical (DMR_MODE_REFLECT_Y) flip were swapped in GScaler driver. Fix this by swapping code for interpreting them. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 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_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 988b391c886a..97182dadad72 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -523,30 +523,30 @@ static void gsc_src_set_transf(struct gsc_context *ctx, unsigned int rotation) switch (degree) { case DRM_MODE_ROTATE_0: - if (rotation & DRM_MODE_REFLECT_Y) - cfg |= GSC_IN_ROT_XFLIP; if (rotation & DRM_MODE_REFLECT_X) + cfg |= GSC_IN_ROT_XFLIP; + if (rotation & DRM_MODE_REFLECT_Y) cfg |= GSC_IN_ROT_YFLIP; break; case DRM_MODE_ROTATE_90: cfg |= GSC_IN_ROT_90; - if (rotation & DRM_MODE_REFLECT_Y) - cfg |= GSC_IN_ROT_XFLIP; if (rotation & DRM_MODE_REFLECT_X) + cfg |= GSC_IN_ROT_XFLIP; + if (rotation & DRM_MODE_REFLECT_Y) cfg |= GSC_IN_ROT_YFLIP; break; case DRM_MODE_ROTATE_180: cfg |= GSC_IN_ROT_180; - if (rotation & DRM_MODE_REFLECT_Y) - cfg &= ~GSC_IN_ROT_XFLIP; if (rotation & DRM_MODE_REFLECT_X) + cfg &= ~GSC_IN_ROT_XFLIP; + if (rotation & DRM_MODE_REFLECT_Y) cfg &= ~GSC_IN_ROT_YFLIP; break; case DRM_MODE_ROTATE_270: cfg |= GSC_IN_ROT_270; - if (rotation & DRM_MODE_REFLECT_Y) - cfg &= ~GSC_IN_ROT_XFLIP; if (rotation & DRM_MODE_REFLECT_X) + cfg &= ~GSC_IN_ROT_XFLIP; + if (rotation & DRM_MODE_REFLECT_Y) cfg &= ~GSC_IN_ROT_YFLIP; break; } From patchwork Thu Jun 7 11:06:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 137870 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1948517lji; Thu, 7 Jun 2018 04:06:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLZbXC+JInR7Vhn2NFVBR0GKrNuDv9+sqU1R0/f0qG/xhrM4HDttaCPYeou7V2P5FgDSQ+1 X-Received: by 2002:a62:458a:: with SMTP id n10-v6mr1347536pfi.215.1528369590971; Thu, 07 Jun 2018 04:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369590; cv=none; d=google.com; s=arc-20160816; b=oHNINB5fpus6GJzBVcKkrA9t8PVeL+EX6dmOlHh1/rlNEHJtiECWiDYNnY8zdpBkp0 DlABqROogZMY9a2yDxEa/qdgNHwB2dXoBWfm6TUyDQFMIegSQyc5kuCGPkJS9FsVS8/F bjKh4Dx7DVHQ1Dg4FhnXaceiyohSLzJ/k2B3h+9JCJZJQKUuMrwVDGBkxUiYCamDpl/y 51rEqQsonbJT2Ld5hIYuEtO+fpjnqMAvLT6HCj/ZTs/YkOT09XMqjHxGmpK2shCCZkTN C6p/IxdirOCmwdOpC35nGjPPlJEo6Ejg8SFE6Okn4mRsomDLotQJALMtgeSjjJys5HEQ LNZA== 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=lNx4OVxhbrE4pElZyrgHsJ1tN+GioLwJ5GjSibd4tZ0=; b=co9vg9TOnQvqI4GJxOvEkvzxuWrPpCAp2Ibyei17Pg+N87dm4EoLqWmhAu1G/Kjn1t UjKjlChaV3KxOFlGcUw2hE5qESZ71iu3B9nQsggom/Ru+dKUS/z0VHKnLeXXDU3DY7DL jJN2NJhdO2KAN9pSBngbYdEtLqHG+zn3ErNBWQ9Cs9FksPK5twGVI1dgLdU5YuXniSA/ Qjum+xU1O45ywjTWOgHWic1zR5vMjmdexAhdOPaIwwKLf1rsTLfbL1F/elH+6AQ5kkDY reAYmlCMSagks37LzEEapn9Bob6RP0Jm0QFV91Lj9uEzQpOUI+uJgtWqFWGKPX5F2gn0 Tt/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@samsung.com header.s=mail20170921 header.b=UuHkuSdl; 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.30; Thu, 07 Jun 2018 04:06:30 -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=UuHkuSdl; 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 S1752972AbeFGLGa (ORCPT + 3 others); Thu, 7 Jun 2018 07:06:30 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:44701 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753357AbeFGLG0 (ORCPT ); Thu, 7 Jun 2018 07:06:26 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20180607110624euoutp019b5be92999d9255254ec47eef667bc1c~13AoImRxt1892018920euoutp01y; Thu, 7 Jun 2018 11:06:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180607110624euoutp019b5be92999d9255254ec47eef667bc1c~13AoImRxt1892018920euoutp01y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1528369584; bh=qwry8vkiPS42nnBuSEC8gZqz0RblKJFwbD79MndjyFM=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=UuHkuSdlRzx26KrfPcjRyzz69YGpcTyREXo5yHZ8qr/+D6sV3PTYFT3PRbVlStpCj vXfb9IrTQ1hfaNe9CmLRTnEq9n/uuXiwQLQs+SyHlaXR6tokBP28cloiipOomo/jof iKvoY7xePKRfO6z4DcD/BDzm/9BCpiV5B2krgd74= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180607110623eucas1p17e5df33fe434aa1713336e38dafb00e6~13And1EiO0960109601eucas1p1g; Thu, 7 Jun 2018 11:06:23 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 7F.43.10409.FA1191B5; Thu, 7 Jun 2018 12:06:23 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20180607110622eucas1p26a84fda8d91f2756ff9a371d918afcdb~13AmsUBd71393813938eucas1p25; Thu, 7 Jun 2018 11:06:22 +0000 (GMT) X-AuditID: cbfec7f5-b45ff700000028a9-85-5b1911af10de Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 2B.AD.04178.EA1191B5; Thu, 7 Jun 2018 12:06:22 +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 8/9] drm/exynos: gsc: Fix support for NV16/61, YUV420/YVU420 and YUV422 modes Date: Thu, 07 Jun 2018 13:06:13 +0200 Message-id: <20180607110614.335-9-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+NgFlrIIsWRmVeSWpSXmKPExsWy7djP87rrBSWjDc4v4LWY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4+fNdpaCN+IVHSv2szQw3hTuYuTkkBAwkVg37xZzFyMXh5DACkaJw41f2EESQgKf GSV+vGaDKbq+ej0jRNEyRokJKyayQTgNTBKb5n5lAqliEzCU6HrbBdYhIuAm0XR4JitIEbPA Y0aJtbs3g40VFoiX6F9/C6yBRUBV4sK7r2BxXgFriWeLV7FDrJOXWL3hADOIzSlgI3F+2SYm kEESAj9ZJW59v8wMUeQi8XDRN0YIW1ji1fEtUM0yEp0dB6Eamhkl2mfMYodwehglts7ZAfWR tcTh4xdZQWxmAT6JSdumA03lAIrzSnS0CUGUeEicPjGPFeLPfkaJc4cWsU9glFzAyLCKUTy1 tDg3PbXYOC+1XK84Mbe4NC9dLzk/dxMjMOJO/zv+dQfjvj9JhxgFOBiVeHgb7otHC7EmlhVX 5h5ilOBgVhLhTbwkFi3Em5JYWZValB9fVJqTWnyIUZqDRUmcN06jLkpIID2xJDU7NbUgtQgm y8TBKdXAaMkuWPzQp8OBO2S5XM+Ud44rj9p8UXg732TzxSKHc2+vuf06t1Jb79xF7Xj25LxD HDu21bzm3v1tg4be3pXLr62MTJt3aOGqnrU/tguyWfdviZ0npLK0d025p4VKqNZHnn/HLCK3 H5jWfH3egeOb9yw1t2SZNEF7flnxdo1E3jVae2eqt9mGJimxFGckGmoxFxUnAgAj6f8QtAIA AA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrHJMWRmVeSWpSXmKPExsVy+t/xy7rrBCWjDXZtU7eY9bKdxWLjjPWs Fle+vmezmHR/AovFjPP7mCzWHrnLbjFj8ks2B3aP+93HmTz6tqxi9Pi8SS6AOYrLJiU1J7Ms tUjfLoEr4+fNdpaCN+IVHSv2szQw3hTuYuTkkBAwkbi+ej1jFyMXh5DAEkaJ5j/7WCCcJiaJ Fws+soNUsQkYSnS97WIDsUUE3CSaDs9kBSliFnjMKPFx2ylWkISwQLzE+u+fwRpYBFQlLrz7 CmbzClhLPFu8ih1inbzE6g0HmEFsTgEbifPLNjGB2EJANW8fnGafwMizgJFhFaNIamlxbnpu saFecWJucWleul5yfu4mRmCobDv2c/MOxksbgw8xCnAwKvHwNtwXjxZiTSwrrsw9xCjBwawk wpt4SSxaiDclsbIqtSg/vqg0J7X4EKM0B4uSOO95g8ooIYH0xJLU7NTUgtQimCwTB6dUA2Pk TIupPZufxvCwL9q5PiZ+q+2vW3OT+cWqlpwLybk6vbpMaXHnppP7ekoYry60dlwf4Wsk/MLr WLe8RoXLTdkr0aturDxS178vx80xxjW+Vehz+I7YuZ9zJbbssg962pwm16fx6OJds63uJVrZ e+90/jJ/PNX36P9zh2dvO75u1zU+NuWzPVpKLMUZiYZazEXFiQBaJ1h1EQIAAA== X-CMS-MailID: 20180607110622eucas1p26a84fda8d91f2756ff9a371d918afcdb X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180607110622eucas1p26a84fda8d91f2756ff9a371d918afcdb 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 Fix following issues related to planar YUV pixel format configuration: - NV16/61 modes were incorrectly programmed as NV12/21, - YVU420 was programmed as YUV420 on source, - YVU420 and YUV422 were programmed as YUV420 on output. Signed-off-by: Marek Szyprowski --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 29 +++++++++++++++++-------- drivers/gpu/drm/exynos/regs-gsc.h | 1 + 2 files changed, 21 insertions(+), 9 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_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 97182dadad72..bf1320ea3712 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -492,21 +492,25 @@ static void gsc_src_set_fmt(struct gsc_context *ctx, u32 fmt) GSC_IN_CHROMA_ORDER_CRCB); break; case DRM_FORMAT_NV21: + cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV420_2P); + break; case DRM_FORMAT_NV61: - cfg |= (GSC_IN_CHROMA_ORDER_CRCB | - GSC_IN_YUV420_2P); + cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV422_2P); break; case DRM_FORMAT_YUV422: cfg |= GSC_IN_YUV422_3P; break; case DRM_FORMAT_YUV420: + cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV420_3P); + break; case DRM_FORMAT_YVU420: - cfg |= GSC_IN_YUV420_3P; + cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV420_3P); break; case DRM_FORMAT_NV12: + cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV420_2P); + break; case DRM_FORMAT_NV16: - cfg |= (GSC_IN_CHROMA_ORDER_CBCR | - GSC_IN_YUV420_2P); + cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV422_2P); break; } @@ -672,18 +676,25 @@ static void gsc_dst_set_fmt(struct gsc_context *ctx, u32 fmt) GSC_OUT_CHROMA_ORDER_CRCB); break; case DRM_FORMAT_NV21: - case DRM_FORMAT_NV61: cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_2P); break; + case DRM_FORMAT_NV61: + cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV422_2P); + break; case DRM_FORMAT_YUV422: + cfg |= GSC_OUT_YUV422_3P; + break; case DRM_FORMAT_YUV420: + cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV420_3P); + break; case DRM_FORMAT_YVU420: - cfg |= GSC_OUT_YUV420_3P; + cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_3P); break; case DRM_FORMAT_NV12: + cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV420_2P); + break; case DRM_FORMAT_NV16: - cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | - GSC_OUT_YUV420_2P); + cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV422_2P); break; } diff --git a/drivers/gpu/drm/exynos/regs-gsc.h b/drivers/gpu/drm/exynos/regs-gsc.h index 4704a993cbb7..16b39734115c 100644 --- a/drivers/gpu/drm/exynos/regs-gsc.h +++ b/drivers/gpu/drm/exynos/regs-gsc.h @@ -138,6 +138,7 @@ #define GSC_OUT_YUV420_3P (3 << 4) #define GSC_OUT_YUV422_1P (4 << 4) #define GSC_OUT_YUV422_2P (5 << 4) +#define GSC_OUT_YUV422_3P (6 << 4) #define GSC_OUT_YUV444 (7 << 4) #define GSC_OUT_TILE_TYPE_MASK (1 << 2) #define GSC_OUT_TILE_C_16x8 (0 << 2) 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);