From patchwork Wed Jul 1 10:09:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyungwon Hwang X-Patchwork-Id: 6702611 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 726A6C05AC for ; Wed, 1 Jul 2015 10:09:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD1E5206A7 for ; Wed, 1 Jul 2015 10:09:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 724282041F for ; Wed, 1 Jul 2015 10:09:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF81D6EAB9; Wed, 1 Jul 2015 03:09:44 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B5E86EAB9 for ; Wed, 1 Jul 2015 03:09:44 -0700 (PDT) Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NQT01U90086P850@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Wed, 01 Jul 2015 19:09:42 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.114]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id EC.3D.24422.66CB3955; Wed, 1 Jul 2015 19:09:42 +0900 (KST) X-AuditID: cbfee68f-f793b6d000005f66-de-5593bc66c3d7 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 5D.72.25346.66CB3955; Wed, 1 Jul 2015 19:09:42 +0900 (KST) Received: from localhost.localdomain ([10.252.82.145]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NQT00C4007VGJ10@mmp1.samsung.com>; Wed, 01 Jul 2015 19:09:42 +0900 (KST) From: Hyungwon Hwang To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm/exynos: gsc: Handles the combination of rotation and flip Date: Wed, 01 Jul 2015 19:09:25 +0900 Message-id: <1435745365-21045-2-git-send-email-human.hwang@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1435745365-21045-1-git-send-email-human.hwang@samsung.com> References: <1435745365-21045-1-git-send-email-human.hwang@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCLMWRmVeSWpSXmKPExsWyRsSkSDdtz+RQgynrhS2ufH3PZrF0Rh+r xaT7E1gsXty7yGIxY/JLNgdWj/vdx5k8+rasYgxgiuKySUnNySxLLdK3S+DKuHT9IEvBYd6K n4ueMjcwdnN3MXJySAiYSFz6+ooFwhaTuHBvPVsXIxeHkMBSRolrL2axwhRd7TwElVjEKPH9 +HsWCOcHo8SRn4cZQarYBPQkFlz7wQ5iiwgoS/yduAoszixQKnFn/mJmEFtYIETiyPO1TCA2 i4CqxL7+pWD1vALuEtveNLFBbJOTOHlsMthmTgEPib+rN4DNEQKqudV0ihFksYTAZzaJ7ws6 mSEGCUh8m3wI6CIOoISsxKYDzBBzJCUOrrjBMoFReAEjwypG0dSC5ILipPQiY73ixNzi0rx0 veT83E2MwMA9/e9Z/w7GuwesDzEKcDAq8fAKiE0OFWJNLCuuzD3EaAq0YSKzlGhyPjA+8kri DY3NjCxMTUyNjcwtzZTEeRdK/QwWEkhPLEnNTk0tSC2KLyrNSS0+xMjEwSnVwKi+/tbz13wy 919qWJVsOP2shL+RszFCcDrTLXudJia5Vy8uXJuboT9bZNVpJ0fDH17tx4z2cf4tbTd3qwoU SORf0WWV+vLM1j9hCt0Hjhc+qq+eEau058uN3Wc0Wh78++74TdKCXeLJaa0QdrZu55CtYk07 +n8HRuib3jr59jBvPPupK9Y/k5RYijMSDbWYi4oTARDO/apXAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42I5/e+xgG7ansmhBqc38llc+fqezWLpjD5W i0n3J7BYvLh3kcVixuSXbA6sHve7jzN59G1ZxRjAFNXAaJORmpiSWqSQmpecn5KZl26r5B0c 7xxvamZgqGtoaWGupJCXmJtqq+TiE6DrlpkDtE9JoSwxpxQoFJBYXKykb4dpQmiIm64FTGOE rm9IEFyPkQEaSFjDmHHp+kGWgsO8FT8XPWVuYOzm7mLk5JAQMJG42nmIDcIWk7hwbz2QzcUh JLCIUeL78fcsEM4PRokjPw8zglSxCehJLLj2gx3EFhFQlvg7cRVYnFmgVOLO/MXMILawQIjE kedrmUBsFgFViX39S8HqeQXcJba9aYLaJidx8thkVhCbU8BD4u/qDWBzhIBqbjWdYpzAyLuA kWEVo2hqQXJBcVJ6rqFecWJucWleul5yfu4mRnBcPJPawbiyweIQowAHoxIPr4DY5FAh1sSy 4srcQ4wSHMxKIrxfpgKFeFMSK6tSi/Lji0pzUosPMZoCXTWRWUo0OR8Ys3kl8YbGJmZGlkbm hhZGxuZK4rwn831ChQTSE0tSs1NTC1KLYPqYODilGhgnr+Frcj/POLfAycdfpyhr4p5wU4UQ Ld4p/OoMKxr2zUkTsp5ol73usPZJTps/YnPzg/iC0s8f/NP56vPd/XypydMNstXUGTebnNlV skuvXv35IZ/Xe+YUzXzY/52Xc91sTp2/bj7zbn9f+WrLuTszyws/rnzH9jDltsVUn8ySuW/1 2CI+T/VWYinOSDTUYi4qTgQAKiMlOKECAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: sw0312.kim@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The unique results of all the combination of rotation and flip can be represented by just 8 states. This patch handles all the combination correctly. Signed-off-by: Hyungwon Hwang --- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index f1c6b76..808a0a0 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c @@ -582,9 +582,17 @@ static int gsc_src_set_transf(struct device *dev, break; case EXYNOS_DRM_DEGREE_180: cfg |= GSC_IN_ROT_180; + if (flip & EXYNOS_DRM_FLIP_VERTICAL) + cfg &= ~GSC_IN_ROT_XFLIP; + if (flip & EXYNOS_DRM_FLIP_HORIZONTAL) + cfg &= ~GSC_IN_ROT_YFLIP; break; case EXYNOS_DRM_DEGREE_270: cfg |= GSC_IN_ROT_270; + if (flip & EXYNOS_DRM_FLIP_VERTICAL) + cfg &= ~GSC_IN_ROT_XFLIP; + if (flip & EXYNOS_DRM_FLIP_HORIZONTAL) + cfg &= ~GSC_IN_ROT_YFLIP; break; default: dev_err(ippdrv->dev, "inavlid degree value %d.\n", degree); @@ -845,9 +853,17 @@ static int gsc_dst_set_transf(struct device *dev, break; case EXYNOS_DRM_DEGREE_180: cfg |= GSC_IN_ROT_180; + if (flip & EXYNOS_DRM_FLIP_VERTICAL) + cfg &= ~GSC_IN_ROT_XFLIP; + if (flip & EXYNOS_DRM_FLIP_HORIZONTAL) + cfg &= ~GSC_IN_ROT_YFLIP; break; case EXYNOS_DRM_DEGREE_270: cfg |= GSC_IN_ROT_270; + if (flip & EXYNOS_DRM_FLIP_VERTICAL) + cfg &= ~GSC_IN_ROT_XFLIP; + if (flip & EXYNOS_DRM_FLIP_HORIZONTAL) + cfg &= ~GSC_IN_ROT_YFLIP; break; default: dev_err(ippdrv->dev, "inavlid degree value %d.\n", degree);