From patchwork Wed Sep 13 11:41:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hoegeun Kwon X-Patchwork-Id: 9951217 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 758916024A for ; Wed, 13 Sep 2017 11:43:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 675C628EE2 for ; Wed, 13 Sep 2017 11:43:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C35F28F01; Wed, 13 Sep 2017 11:43:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E559E28EE2 for ; Wed, 13 Sep 2017 11:43:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752304AbdIMLna (ORCPT ); Wed, 13 Sep 2017 07:43:30 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:24147 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751645AbdIMLmT (ORCPT ); Wed, 13 Sep 2017 07:42:19 -0400 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20170913114217epoutp030375ae934e004e799f4dbb4031fda581~j6Qu9CWHF2592425924epoutp03g; Wed, 13 Sep 2017 11:42:17 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.69]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20170913114215epcas1p17ee0c3f429ab2a9b158ce56b6c0f6675~j6QtzV-I01977919779epcas1p1N; Wed, 13 Sep 2017 11:42:15 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id ED.5B.15349.79919B95; Wed, 13 Sep 2017 20:42:15 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20170913114215epcas2p346dd3987cf25481bc780e0eef8b91ed8~j6QtYfBsP2411124111epcas2p3s; Wed, 13 Sep 2017 11:42:15 +0000 (GMT) X-AuditID: b6c32a46-f790d6d000003bf5-4d-59b919977589 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 99.99.10338.79919B95; Wed, 13 Sep 2017 20:42:15 +0900 (KST) Received: from localhost.localdomain ([10.113.63.38]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OW7004DTV6CH850@mmp1.samsung.com>; Wed, 13 Sep 2017 20:42:14 +0900 (KST) From: Hoegeun Kwon To: inki.dae@samsung.com, airlied@linux.ie, kgene@kernel.org, krzk@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, mchehab@kernel.org, s.nawrocki@samsung.com, m.szyprowski@samsung.com, robin.murphy@arm.com Cc: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, a.hajda@samsung.com, Hoegeun Kwon Subject: [PATCH v4 4/4] [media] exynos-gsc: Add hardware rotation limits Date: Wed, 13 Sep 2017 20:41:55 +0900 Message-id: <1505302915-15699-5-git-send-email-hoegeun.kwon@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1505302915-15699-1-git-send-email-hoegeun.kwon@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrPKsWRmVeSWpSXmKPExsWy7bCmue50yZ2RBj8uG1rcWneO1aL33Ekm i/fLehgt5h8Bcq98fc9m8X55F5vFpPsTWCz6H79mtjh/fgO7xabH11gtLu+aw2bRs2Erq8WM 8/uYLNYeuctusfT6RSaLZZv+MFm07j3CbnHwwxNWi8Nv2lktXn48weIg4rFm3hpGj02rOtk8 tn97wOpxv/s4k8fmJfUefVtWMXp83iQXwB6VapORmpiSWqSQmpecn5KZl26r5B0c7xxvamZg qGtoaWGupJCXmJtqq+TiE6DrlpkD9JCSQlliTilQKCCxuFhJ386mKL+0JFUhI7+4xFYp2tDQ SM/QwFzPyMhIz8Q41srIFKgkITVj5eZ3rAWn1Cv2XBVuYHwv38XIySEhYCIxp3ElC4QtJnHh 3nq2LkYuDiGBHYwSi5a8YIdwvjNKHDxwlB2m49GJXawQid2MEtdWvWSEq5r/5AgTSBWbgK7E 157rTCAJEYF2JoklJ14wgzjMIM7DcxvAZgkLeEicmvMabDuLgKrEqUszGEFsXqD4yn+vmCH2 yUmcPDaZFcTmFPCUWNY1AWydhMBnNomG3u1QRS4Scz78Z4WwhSVeHd8Cday0xLNVGxkh7HqJ yztOQjU3MEr0T5wNVWQscaqrEexuZgE+iY7Df4HiHEBxXomONiGIEg+JS0s6WCHCjhLH+hNB wkICc4ChdJNnAqP0AkaGVYxiqQXFuempxUYFRnrFibnFpXnpesn5uZsYwYlPy20H45JzPocY BTgYlXh4A25tjxRiTSwrrsw9xCjBwawkwsvEvzNSiDclsbIqtSg/vqg0J7X4EKMpMGgmMkuJ JucDk3JeSbyhiaWBiZmZkbmZBTBpiPPWbbsWISSQnliSmp2aWpBaBNPHxMEp1cC45NtaszWL g/8lHXja7NWwTPn0PhPthsJu5cM92p3t+eLaFdNc8hem3GB/3THL/dm7Obsabsw9Icctprpm yt5L4X+35b3Rj/v3vl5MpsftloKB2NwZ6zNipq1+su+UT7BYY8Gk0mTlQO7HIt7Bu3av4l3K mLs3oS0l/JR9vYLK7wbZfpEslRYlluKMREMt5qLiRADdzwX0kgMAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsVy+t9jAd3pkjsjDaZeEbO4te4cq0XvuZNM Fu+X9TBazD8C5F75+p7N4v3yLjaLSfcnsFj0P37NbHH+/AZ2i02Pr7FaXN41h82iZ8NWVosZ 5/cxWaw9cpfdYun1i0wWyzb9YbJo3XuE3eLghyesFofftLNavPx4gsVBxGPNvDWMHptWdbJ5 bP/2gNXjfvdxJo/NS+o9+rasYvT4vEkugD2KyyYlNSezLLVI3y6BK2Pl5nesBafUK/ZcFW5g fC/fxcjJISFgIvHoxC5WEFtIYCejxPlezi5GLiD7O6PE5A0P2EESbAK6El97rjOBJEQE2pkk Xv69D+Ywgzgzb78EqxIW8JA4Nec1C4jNIqAqcerSDEYQmxcovvLfK2aIdXISJ49NBlvHKeAp saxrAiPEag+JVwfXsk9g5FnAyLCKUTK1oDg3PbfYqMAoL7Vcrzgxt7g0L10vOT93EyMwtLcd 1urfwfh4SfwhRgEORiUe3hV3tkcKsSaWFVfmHmKU4GBWEuFl4t8ZKcSbklhZlVqUH19UmpNa fIhRmoNFSZw3s29GpJBAemJJanZqakFqEUyWiYNTqoFx5XSzB3bTNjJlzsldoMjw80DB2ql/ FzxT+Op5+L2yZmuwl/Xi8/2Tj9k8WMT2cZ9zfr2Ks8iiLYnety/lp7Pw3VkS3MclVrP2/LLD Sxq/iol2XmhIe3HvgsmSlnnXJ+hMit8jcUFGfUHNiZJpR6O32MwSyY86XZcgnaxra7P/a9bn sOf77v75o8RSnJFoqMVcVJwIAElJFmlpAgAA X-CMS-MailID: 20170913114215epcas2p346dd3987cf25481bc780e0eef8b91ed8 X-Msg-Generator: CA X-Sender-IP: 182.195.42.143 X-Local-Sender: =?UTF-8?B?6raM7ZqM6re8G1RpemVuIFBsYXRmb3JtIExhYihTL1fshLw=?= =?UTF-8?B?7YSwKRvsgrzshLHsoITsnpAbRW5naW5lZXI=?= X-Global-Sender: =?UTF-8?B?SG9lZ2V1biBLd29uG1RpemVuIFBsYXRmb3JtIExhYi4bU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtFbmdpbmVlcg==?= X-Sender-Code: =?UTF-8?B?QzEwG1RFTEUbQzEwVjgxMTE=?= CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170913114215epcas2p346dd3987cf25481bc780e0eef8b91ed8 X-RootMTR: 20170913114215epcas2p346dd3987cf25481bc780e0eef8b91ed8 References: <1505302915-15699-1-git-send-email-hoegeun.kwon@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The hardware rotation limits of gsc depends on SOC (Exynos 5250/5420/5433). Distinguish them and add them to the driver data. Signed-off-by: Hoegeun Kwon --- drivers/media/platform/exynos-gsc/gsc-core.c | 127 +++++++++++++++++++++++++-- 1 file changed, 122 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 4380150..173a238 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -958,6 +958,51 @@ static irqreturn_t gsc_irq_handler(int irq, void *priv) .target_rot_en_h = 2016, }; +static struct gsc_pix_max gsc_v_5250_max = { + .org_scaler_bypass_w = 8192, + .org_scaler_bypass_h = 8192, + .org_scaler_input_w = 4800, + .org_scaler_input_h = 3344, + .real_rot_dis_w = 4800, + .real_rot_dis_h = 3344, + .real_rot_en_w = 2016, + .real_rot_en_h = 2016, + .target_rot_dis_w = 4800, + .target_rot_dis_h = 3344, + .target_rot_en_w = 2016, + .target_rot_en_h = 2016, +}; + +static struct gsc_pix_max gsc_v_5420_max = { + .org_scaler_bypass_w = 8192, + .org_scaler_bypass_h = 8192, + .org_scaler_input_w = 4800, + .org_scaler_input_h = 3344, + .real_rot_dis_w = 4800, + .real_rot_dis_h = 3344, + .real_rot_en_w = 2048, + .real_rot_en_h = 2048, + .target_rot_dis_w = 4800, + .target_rot_dis_h = 3344, + .target_rot_en_w = 2016, + .target_rot_en_h = 2016, +}; + +static struct gsc_pix_max gsc_v_5433_max = { + .org_scaler_bypass_w = 8192, + .org_scaler_bypass_h = 8192, + .org_scaler_input_w = 4800, + .org_scaler_input_h = 3344, + .real_rot_dis_w = 4800, + .real_rot_dis_h = 3344, + .real_rot_en_w = 2047, + .real_rot_en_h = 2047, + .target_rot_dis_w = 4800, + .target_rot_dis_h = 3344, + .target_rot_en_w = 2016, + .target_rot_en_h = 2016, +}; + static struct gsc_pix_min gsc_v_100_min = { .org_w = 64, .org_h = 32, @@ -992,6 +1037,45 @@ static irqreturn_t gsc_irq_handler(int irq, void *priv) .local_sc_down = 2, }; +static struct gsc_variant gsc_v_5250_variant = { + .pix_max = &gsc_v_5250_max, + .pix_min = &gsc_v_100_min, + .pix_align = &gsc_v_100_align, + .in_buf_cnt = 32, + .out_buf_cnt = 32, + .sc_up_max = 8, + .sc_down_max = 16, + .poly_sc_down_max = 4, + .pre_sc_down_max = 4, + .local_sc_down = 2, +}; + +static struct gsc_variant gsc_v_5420_variant = { + .pix_max = &gsc_v_5420_max, + .pix_min = &gsc_v_100_min, + .pix_align = &gsc_v_100_align, + .in_buf_cnt = 32, + .out_buf_cnt = 32, + .sc_up_max = 8, + .sc_down_max = 16, + .poly_sc_down_max = 4, + .pre_sc_down_max = 4, + .local_sc_down = 2, +}; + +static struct gsc_variant gsc_v_5433_variant = { + .pix_max = &gsc_v_5433_max, + .pix_min = &gsc_v_100_min, + .pix_align = &gsc_v_100_align, + .in_buf_cnt = 32, + .out_buf_cnt = 32, + .sc_up_max = 8, + .sc_down_max = 16, + .poly_sc_down_max = 4, + .pre_sc_down_max = 4, + .local_sc_down = 2, +}; + static struct gsc_driverdata gsc_v_100_drvdata = { .variant = { [0] = &gsc_v_100_variant, @@ -1004,11 +1088,33 @@ static irqreturn_t gsc_irq_handler(int irq, void *priv) .num_clocks = 1, }; +static struct gsc_driverdata gsc_v_5250_drvdata = { + .variant = { + [0] = &gsc_v_5250_variant, + [1] = &gsc_v_5250_variant, + [2] = &gsc_v_5250_variant, + [3] = &gsc_v_5250_variant, + }, + .num_entities = 4, + .clk_names = { "gscl" }, + .num_clocks = 1, +}; + +static struct gsc_driverdata gsc_v_5420_drvdata = { + .variant = { + [0] = &gsc_v_5420_variant, + [1] = &gsc_v_5420_variant, + }, + .num_entities = 4, + .clk_names = { "gscl" }, + .num_clocks = 1, +}; + static struct gsc_driverdata gsc_5433_drvdata = { .variant = { - [0] = &gsc_v_100_variant, - [1] = &gsc_v_100_variant, - [2] = &gsc_v_100_variant, + [0] = &gsc_v_5433_variant, + [1] = &gsc_v_5433_variant, + [2] = &gsc_v_5433_variant, }, .num_entities = 3, .clk_names = { "pclk", "aclk", "aclk_xiu", "aclk_gsclbend" }, @@ -1017,13 +1123,21 @@ static irqreturn_t gsc_irq_handler(int irq, void *priv) static const struct of_device_id exynos_gsc_match[] = { { - .compatible = "samsung,exynos5-gsc", - .data = &gsc_v_100_drvdata, + .compatible = "samsung,exynos5250-gsc", + .data = &gsc_v_5250_drvdata, + }, + { + .compatible = "samsung,exynos5420-gsc", + .data = &gsc_v_5420_drvdata, }, { .compatible = "samsung,exynos5433-gsc", .data = &gsc_5433_drvdata, }, + { + .compatible = "samsung,exynos5-gsc", + .data = &gsc_v_100_drvdata, + }, {}, }; MODULE_DEVICE_TABLE(of, exynos_gsc_match); @@ -1045,6 +1159,9 @@ static int gsc_probe(struct platform_device *pdev) if (ret < 0) return ret; + if (drv_data == &gsc_v_100_drvdata) + dev_info(dev, "compatible 'exynos5-gsc' is deprecated\n"); + gsc->id = ret; if (gsc->id >= drv_data->num_entities) { dev_err(dev, "Invalid platform device id: %d\n", gsc->id);