From patchwork Fri Sep 8 06:02:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hoegeun Kwon X-Patchwork-Id: 9943199 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 2C316600CB for ; Fri, 8 Sep 2017 06:03:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EA13284C7 for ; Fri, 8 Sep 2017 06:03:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1368928501; Fri, 8 Sep 2017 06:03:17 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A3893284E4 for ; Fri, 8 Sep 2017 06:03:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BE036EA6F; Fri, 8 Sep 2017 06:03:12 +0000 (UTC) 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 9AB3E6EA76 for ; Fri, 8 Sep 2017 06:03:11 +0000 (UTC) Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20170908060310epoutp01d57090855052e2966fa27adabce98a15~iTaN6wDcX1786317863epoutp019; Fri, 8 Sep 2017 06:03:10 +0000 (GMT) Received: from epsmges1p2.samsung.com (unknown [182.195.40.66]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20170908060309epcas1p365639948f570335f7c377e0181295fb0~iTaNkVyI41586715867epcas1p3c; Fri, 8 Sep 2017 06:03:09 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id D0.EB.20955.D9232B95; Fri, 8 Sep 2017 15:03:09 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20170908060309epcas1p3d48dd0871d3fde02ba3c9921bbe5a7a6~iTaNPzUwv1583315833epcas1p3V; Fri, 8 Sep 2017 06:03:09 +0000 (GMT) X-AuditID: b6c32a36-f79196d0000051db-9b-59b2329d8390 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id E6.25.11757.C9232B95; Fri, 8 Sep 2017 15:03:09 +0900 (KST) Received: from localhost.localdomain ([10.113.63.38]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OVY00KW1655VA30@mmp2.samsung.com>; Fri, 08 Sep 2017 15:03:08 +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 Subject: [PATCH v3 4/6] [media] exynos-gsc: Add hardware rotation limits Date: Fri, 08 Sep 2017 15:02:38 +0900 Message-id: <1504850560-27950-5-git-send-email-hoegeun.kwon@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1504850560-27950-1-git-send-email-hoegeun.kwon@samsung.com> X-Brightmail-T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VWhFYaNVaWTznyFqQkl dd5bmZX9D8X2rgVHz8Fxa/Q6Wi1ZeWaeSpT4f1dLo7OMAwAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrELMWRmVeSWpSXmKPExsVy+t9jQd25RpsiDa418VjcWneO1aL33Ekm i/fLehgt5h8Bcq98fc9m8X55F5vFpPsTWCz6H79mtjh/fgO7xabH11gtLu+aw2bRs2Erq8WM 8/uYLNYeuctusfT6RSaLZZv+MFm07j3CbnH4TTurxcuPJ1gchD3WzFvD6LFpVSebx/ZvD1g9 7ncfZ/LYvKTeo2/LKkaPz5vkAtijuGxSUnMyy1KL9O0SuDLOfnjLXvBKsWL7o88sDYzbpbsY OTgkBEwkrtxQ62Lk4hASWMcosfD4blYI5zujxOqjNxi7GDk52AR0Jb72XGcCSYgIfGSUeLa+ kR3EYRZoZ5KYefslO0iVsICHxNauZ2AdLAKqEudn94PZvEDxads62EBsCQE5iZPHJrOC2JwC nhKt9y+B1QgB1ew5vZh9AiPPAkaGVYySqQXFuem5xUYFhnmp5XrFibnFpXnpesn5uZsYgSG9 7bBW3w7G+0viDzEKcDAq8fBaBG+MFGJNLCuuzD3EKMHBrCTC+193U6QQb0piZVVqUX58UWlO avEhRmkOFiVx3sy+GZFCAumJJanZqakFqUUwWSYOTqkGxkiz9ktiNbbzf5Y9kf59wnAGp7Ut k0eZkbCFu9RO/oeut2OXS1hanQvMr0q5YMTZrWrR+nwic9vkn+cZWf2N/hTslz01PYWp0rsg yH6nP499Xc6fS0vrmfz/x1lv/HrcRu7JiQMcC12iMs2+H+Z7l52m3TaxJ3VjvZaYSQ3v5DOO Rw/tzRRSYinOSDTUYi4qTgQARZP3IGUCAAA= X-CMS-MailID: 20170908060309epcas1p3d48dd0871d3fde02ba3c9921bbe5a7a6 X-Msg-Generator: CA X-Sender-IP: 182.195.42.142 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: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20170908060309epcas1p3d48dd0871d3fde02ba3c9921bbe5a7a6 X-RootMTR: 20170908060309epcas1p3d48dd0871d3fde02ba3c9921bbe5a7a6 References: <1504850560-27950-1-git-send-email-hoegeun.kwon@samsung.com> Cc: devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Hoegeun Kwon , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org 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-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 | 96 ++++++++++++++++++++++++---- 1 file changed, 83 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c index 4380150..8f8636e 100644 --- a/drivers/media/platform/exynos-gsc/gsc-core.c +++ b/drivers/media/platform/exynos-gsc/gsc-core.c @@ -943,7 +943,37 @@ static irqreturn_t gsc_irq_handler(int irq, void *priv) return IRQ_HANDLED; } -static struct gsc_pix_max gsc_v_100_max = { +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, @@ -979,8 +1009,8 @@ static irqreturn_t gsc_irq_handler(int irq, void *priv) .target_h = 2, /* yuv420 : 2, others : 1 */ }; -static struct gsc_variant gsc_v_100_variant = { - .pix_max = &gsc_v_100_max, +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, @@ -992,12 +1022,48 @@ static irqreturn_t gsc_irq_handler(int irq, void *priv) .local_sc_down = 2, }; -static struct gsc_driverdata gsc_v_100_drvdata = { +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_5250_drvdata = { .variant = { - [0] = &gsc_v_100_variant, - [1] = &gsc_v_100_variant, - [2] = &gsc_v_100_variant, - [3] = &gsc_v_100_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" }, @@ -1006,9 +1072,9 @@ static irqreturn_t gsc_irq_handler(int irq, void *priv) 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,8 +1083,12 @@ 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",