From patchwork Mon Mar 20 10:56:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95508 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp882256qgd; Mon, 20 Mar 2017 04:00:32 -0700 (PDT) X-Received: by 10.98.68.199 with SMTP id m68mr32914667pfi.31.1490007632262; Mon, 20 Mar 2017 04:00:32 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n26si17049412pge.228.2017.03.20.04.00.32; Mon, 20 Mar 2017 04:00:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753651AbdCTLA0 (ORCPT + 4 others); Mon, 20 Mar 2017 07:00:26 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:30564 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753644AbdCTK5O (ORCPT ); Mon, 20 Mar 2017 06:57:14 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON400DIN12QV920@mailout3.w1.samsung.com>; Mon, 20 Mar 2017 10:56:51 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170320105650eucas1p1dba5c2e07f67748420baa391389b2105~tkdhyCgM_0044100441eucas1p1n; Mon, 20 Mar 2017 10:56:50 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 0B.7B.17477.275BFC85; Mon, 20 Mar 2017 10:56:50 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105649eucas1p2e296c309f82d635df78b1e1ec1fe21aa~tkdg8rE1l2242222422eucas1p2I; Mon, 20 Mar 2017 10:56:49 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-75-58cfb572f668 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id BC.DA.10233.085BFC85; Mon, 20 Mar 2017 10:57:04 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:49 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 02/16] media: s5p-mfc: Use generic of_device_get_match_data helper Date: Mon, 20 Mar 2017 11:56:28 +0100 Message-id: <1490007402-30265-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsWy7djPc7pFW89HGGxcIWBxa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDmKyyYl NSezLLVI3y6BK+P13HmMBRckKhpWXWVsYGwT7WLk5JAQMJFYPXEzK4QtJnHh3nq2LkYuDiGB pYwSrx/tYIFwPjNKrLvykgmmY/GxdnaIxDJGiWPnH0I5DUwS667fYwapYhMwlOh628UGYosI OEksnPUXrIhZ4DujxLfdp8EWCguES9x8ehTMZhFQlZjU9Y8RxOYV8JA4vbyDBWKdnMTJY5PB ajgFPCVeXP8LdqCEwGM2iebz04AaOIAcWYlNB5gh6l0kJncuY4ewhSVeHd8CZctIXJ7cDTWz n1GiqVUbwp7BKHHuLS+EbS1x+PhFsF3MAnwSk7ZNZ4YYzyvR0SYEUeIhsWD1ZaiRjhKLHi6B en4Oo8SyRadZJzDKLGBkWMUoklpanJueWmyqV5yYW1yal66XnJ+7iREYuaf/Hf+6g3HpMatD jAIcjEo8vAZXz0UIsSaWFVfmHmKU4GBWEuH9OPd8hBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHe PQuuhAsJpCeWpGanphakFsFkmTg4pRoYZ+rfDDggeXd+9s7bj1KupM+POnEzVX6xaqB9vHPj 8idZt5vbfzNtXb6zdNPrAg7P/x+am7w3qs1Zuem4vS630Mx/ZfH2h5KN7HqEAr8GXE10tZlz dnYUV7LiCX95CafzvMYG4tp3FE+EzlE+m/Lp0c/3X9UPslpwSTa5CN+Q4d+z6K/wQ+UzSizF GYmGWsxFxYkAIUCaXdgCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsVy+t/xa7oNW89HGCzfxm5xa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDnKzSYj NTEltUghNS85PyUzL91WKTTETddCSSEvMTfVVilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJ bhmv585jLLggUdGw6ipjA2ObaBcjJ4eEgInE4mPt7BC2mMSFe+vZQGwhgSWMEmc2yEDYTUwS z/ZFg9hsAoYSXW+7wGpEBJwkFs76C9bLLPCdUWLZzTQQW1ggXGLWpgOsIDaLgKrEpK5/jCA2 r4CHxOnlHSwQu+QkTh6bDFbDKeAp8eL6X6i9HhLrPk9kmsDIu4CRYRWjSGppcW56brGRXnFi bnFpXrpecn7uJkZg+G479nPLDsaud8GHGAU4GJV4eA2unosQYk0sK67MPcQowcGsJML7ce75 CCHelMTKqtSi/Pii0pzU4kOMpkBHTWSWEk3OB8ZWXkm8oYmhuaWhkbGFhbmRkZI479QPV8KF BNITS1KzU1MLUotg+pg4OKUaGLcsPGgVonj6zytGl3/PvPY7X7lmKvzp7LlrhjZnp3HOM8ry 0Q/+zst7N/X74kePJj+o0Xx+6MWJho2PePseHszi/td9cb10p6Vw0QQZu8NTeSKtMta3/jB6 fXJzrOraHUd494v+vSmWYn7czq5Cs8pt51bF/++WyL1M68iWMhCpv/bom6i4wlclluKMREMt 5qLiRABH9aNQdQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105649eucas1p2e296c309f82d635df78b1e1ec1fe21aa X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320105649eucas1p2e296c309f82d635df78b1e1ec1fe21aa X-RootMTR: 20170320105649eucas1p2e296c309f82d635df78b1e1ec1fe21aa References: <1490007402-30265-1-git-send-email-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 Replace custom code with generic helper to retrieve driver data. Signed-off-by: Marek Szyprowski Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Acked-by: Andrzej Hajda Tested-by: Smitha T Murthy Reviewed-by: Smitha T Murthy --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 17 ++--------------- drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 4 ++-- 2 files changed, 4 insertions(+), 17 deletions(-) -- 1.9.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/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 4e9f349c1be3..af223b0a41a3 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "s5p_mfc_common.h" @@ -1152,8 +1153,6 @@ static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) device_unregister(mfc_dev->mem_dev_r); } -static void *mfc_get_drv_data(struct platform_device *pdev); - /* MFC probe function */ static int s5p_mfc_probe(struct platform_device *pdev) { @@ -1177,7 +1176,7 @@ static int s5p_mfc_probe(struct platform_device *pdev) return -ENODEV; } - dev->variant = mfc_get_drv_data(pdev); + dev->variant = of_device_get_match_data(&pdev->dev); res = platform_get_resource(pdev, IORESOURCE_MEM, 0); dev->regs_base = devm_ioremap_resource(&pdev->dev, res); @@ -1536,18 +1535,6 @@ static int s5p_mfc_resume(struct device *dev) }; MODULE_DEVICE_TABLE(of, exynos_mfc_match); -static void *mfc_get_drv_data(struct platform_device *pdev) -{ - struct s5p_mfc_variant *driver_data = NULL; - const struct of_device_id *match; - - match = of_match_node(exynos_mfc_match, pdev->dev.of_node); - if (match) - driver_data = (struct s5p_mfc_variant *)match->data; - - return driver_data; -} - static struct platform_driver s5p_mfc_driver = { .probe = s5p_mfc_probe, .remove = s5p_mfc_remove, diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index 3e0e8eaf8bfe..2f1387a4c386 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -192,7 +192,7 @@ struct s5p_mfc_buf { */ struct s5p_mfc_pm { struct clk *clock_gate; - const char **clk_names; + const char * const *clk_names; struct clk *clocks[MFC_MAX_CLOCKS]; int num_clocks; bool use_clock_gating; @@ -304,7 +304,7 @@ struct s5p_mfc_dev { struct v4l2_ctrl_handler dec_ctrl_handler; struct v4l2_ctrl_handler enc_ctrl_handler; struct s5p_mfc_pm pm; - struct s5p_mfc_variant *variant; + const struct s5p_mfc_variant *variant; int num_inst; spinlock_t irqlock; /* lock when operating on context */ spinlock_t condlock; /* lock when changing/checking if a context is From patchwork Mon Mar 20 10:56:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95507 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp882260qgd; Mon, 20 Mar 2017 04:00:32 -0700 (PDT) X-Received: by 10.98.223.133 with SMTP id d5mr32663488pfl.222.1490007632565; Mon, 20 Mar 2017 04:00:32 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n26si17049412pge.228.2017.03.20.04.00.32; Mon, 20 Mar 2017 04:00:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754153AbdCTLA3 (ORCPT + 4 others); Mon, 20 Mar 2017 07:00:29 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:32748 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753642AbdCTK5O (ORCPT ); Mon, 20 Mar 2017 06:57:14 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON400BFJ12RHQ20@mailout4.w1.samsung.com>; Mon, 20 Mar 2017 10:56:51 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105651eucas1p2f135552577bce6e6c74a28e989ebc65f~tkdiO9EKO3057330573eucas1p2f; Mon, 20 Mar 2017 10:56:51 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 37.A0.16908.575BFC85; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105650eucas1p299820f40e39d09fe4a1591917dd8fc6c~tkdhg9lqb2732427324eucas1p2D; Mon, 20 Mar 2017 10:56:50 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-be-58cfb5752a04 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id A0.E7.06687.CD5BFC85; Mon, 20 Mar 2017 10:58:36 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:50 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 04/16] media: s5p-mfc: Replace bank1/bank2 entries with an array Date: Mon, 20 Mar 2017 11:56:30 +0100 Message-id: <1490007402-30265-5-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMIsWRmVeSWpSXmKPExsWy7djP87qlW89HGCxfKG9xa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDmKyyYl NSezLLVI3y6BK+Pi/fNMBT/DK+Ys/cHYwPjDo4uRg0NCwETi85G8LkZOIFNM4sK99WxdjFwc QgLLGCXOLL7EAuF8ZpT4fG8XO0SVicTx+xtZQWywqq87CyCKGpgkdi94xgSSYBMwlOh628UG YosIOEksnPWXHaSIWeA7o8S33afBuoUFQiWarmwAm8oioCqx/VU/WJxXwENiw+2TbBDb5CRO HpsMFucU8JR4cf0v2H0SAs/ZJC78+8kO8YOsxKYDzBD1LhLNEzawQtjCEq+Ob4G6Wkais+Mg E4TdzyjR1KoNYc9glDj3lhfCtpY4fPwiWC+zAJ/EpG3TmSHG80p0tAlBlHhI/P3dBDXSUeJe 61cmiOfnMEq8/beJdQKjzAJGhlWMIqmlxbnpqcWGesWJucWleel6yfm5mxiBUXv63/H3Oxif NoccYhTgYFTi4b1x6VyEEGtiWXFl7iFGCQ5mJRHej3PPRwjxpiRWVqUW5ccXleakFh9ilOZg URLn3bvgSriQQHpiSWp2ampBahFMlomDU6qBcVLt9F0iZud0ExLWpc6JEXH7fOZ9TSD7u1nb k2+E1Jiyfp9XJq4hKr3E88m1FyKrtVc+WhlbM4HDu2nqEsE/HpNYL10JiZJ5M+VO67zrvEHN ty+85Hr1v1X9kerhV1Lenr/c5S79/pCRPEnigoKq5G/rTeyrjvd+fGQQ13PbW8XLUZqtfOct DSWW4oxEQy3mouJEAOB4kxHWAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsVy+t/xa7p3tp6PMDh7is3i1rpzrBaT7k9g sTh/fgO7Rc+GrawWM87vY7JYe+Quu8XhN+1A7uSXbA4cHptWdbJ59G1ZxejxeZNcAHOUm01G amJKapFCal5yfkpmXrqtUmiIm66FkkJeYm6qrVKErm9IkJJCWWJOKZBnZIAGHJwD3IOV9O0S 3DIu3j/PVPAzvGLO0h+MDYw/PLoYOTkkBEwkjt/fyAphi0lcuLeerYuRi0NIYAmjxL3539kh nCYmicbzLewgVWwChhJdb7vYQGwRASeJhbP+gsWZBb4zSiy7mQZiCwuESrybepAFxGYRUJXY /qofbAOvgIfEhtsn2SC2yUmcPDYZLM4p4Cnx4vpfsLgQUM26zxOZJjDyLmBkWMUoklpanJue W2yoV5yYW1yal66XnJ+7iREYwtuO/dy8g/HSxuBDjAIcjEo8vAZXz0UIsSaWFVfmHmKU4GBW EuH9OPd8hBBvSmJlVWpRfnxRaU5q8SFGU6CjJjJLiSbnA+MrryTe0MTQ3NLQyNjCwtzISEmc t+TDlXAhgfTEktTs1NSC1CKYPiYOTqkGRuYVNxWNbx3jqvzC+3Ny4OKnNVVrc2SSmdOvr6r7 4XRoTUyXSqH5s+jnNcvlhNLvzd8ps+3kqXy3TPMt3lte+Vv96Ym5zDgrmDvT6sfkvFf3F6uq 77gWnV0948yqlsOPD6xmLD/Ty5jQ11W5snC93Fnfk0vMXIrNtF5tUMzYXRT1gufVKlUjZSWW 4oxEQy3mouJEAGop3pR3AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105650eucas1p299820f40e39d09fe4a1591917dd8fc6c X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320105650eucas1p299820f40e39d09fe4a1591917dd8fc6c X-RootMTR: 20170320105650eucas1p299820f40e39d09fe4a1591917dd8fc6c References: <1490007402-30265-1-git-send-email-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 Internal MFC driver device structure contains two entries for keeping addresses of the DMA memory banks. Replace them with the dma_base[] array and use defines for accessing particular banks. This will help to simplify code in the next patches. Signed-off-by: Marek Szyprowski Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Acked-by: Andrzej Hajda Tested-by: Smitha T Murthy --- drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 6 ++-- drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 27 +++++++++++------- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c | 38 +++++++++++++------------ drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 10 +++---- 4 files changed, 43 insertions(+), 38 deletions(-) -- 1.9.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/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index 27d4c864e06e..da601a2dba2f 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -273,8 +273,7 @@ struct s5p_mfc_priv_buf { * @queue: waitqueue for waiting for completion of device commands * @fw_size: size of firmware * @fw_virt_addr: virtual firmware address - * @bank1: address of the beginning of bank 1 memory - * @bank2: address of the beginning of bank 2 memory + * @dma_base[]: address of the beginning of memory banks * @hw_lock: used for hardware locking * @ctx: array of driver contexts * @curr_ctx: number of the currently running context @@ -315,8 +314,7 @@ struct s5p_mfc_dev { wait_queue_head_t queue; size_t fw_size; void *fw_virt_addr; - dma_addr_t bank1; - dma_addr_t bank2; + dma_addr_t dma_base[BANK_CTX_NUM]; unsigned long hw_lock; struct s5p_mfc_ctx *ctx[MFC_NUM_CONTEXTS]; int curr_ctx; diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c index cd1406c75d9a..c9bff3d0655f 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c @@ -38,8 +38,8 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) } dev->fw_virt_addr = dma_alloc_coherent(dev->mem_dev[BANK1_CTX], - dev->fw_size, &dev->bank1, GFP_KERNEL); - + dev->fw_size, &dev->dma_base[BANK1_CTX], + GFP_KERNEL); if (!dev->fw_virt_addr) { mfc_err("Allocating bitprocessor buffer failed\n"); return -ENOMEM; @@ -52,7 +52,8 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) if (!bank2_virt) { mfc_err("Allocating bank2 base failed\n"); dma_free_coherent(dev->mem_dev[BANK1_CTX], dev->fw_size, - dev->fw_virt_addr, dev->bank1); + dev->fw_virt_addr, + dev->dma_base[BANK1_CTX]); dev->fw_virt_addr = NULL; return -ENOMEM; } @@ -61,7 +62,7 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) * should not have address of bank2 - MFC will treat it as a null frame. * To avoid such situation we set bank2 address below the pool address. */ - dev->bank2 = bank2_dma_addr - align_size; + dev->dma_base[BANK2_CTX] = bank2_dma_addr - align_size; dma_free_coherent(dev->mem_dev[BANK2_CTX], align_size, bank2_virt, bank2_dma_addr); @@ -70,7 +71,7 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) /* In this case bank2 can point to the same address as bank1. * Firmware will always occupy the beginning of this area so it is * impossible having a video frame buffer with zero address. */ - dev->bank2 = dev->bank1; + dev->dma_base[BANK2_CTX] = dev->dma_base[BANK1_CTX]; } return 0; } @@ -125,7 +126,7 @@ int s5p_mfc_release_firmware(struct s5p_mfc_dev *dev) if (!dev->fw_virt_addr) return -EINVAL; dma_free_coherent(dev->mem_dev[BANK1_CTX], dev->fw_size, - dev->fw_virt_addr, dev->bank1); + dev->fw_virt_addr, dev->dma_base[BANK1_CTX]); dev->fw_virt_addr = NULL; return 0; } @@ -211,13 +212,17 @@ int s5p_mfc_reset(struct s5p_mfc_dev *dev) static inline void s5p_mfc_init_memctrl(struct s5p_mfc_dev *dev) { if (IS_MFCV6_PLUS(dev)) { - mfc_write(dev, dev->bank1, S5P_FIMV_RISC_BASE_ADDRESS_V6); - mfc_debug(2, "Base Address : %pad\n", &dev->bank1); + mfc_write(dev, dev->dma_base[BANK1_CTX], + S5P_FIMV_RISC_BASE_ADDRESS_V6); + mfc_debug(2, "Base Address : %pad\n", + &dev->dma_base[BANK1_CTX]); } else { - mfc_write(dev, dev->bank1, S5P_FIMV_MC_DRAMBASE_ADR_A); - mfc_write(dev, dev->bank2, S5P_FIMV_MC_DRAMBASE_ADR_B); + mfc_write(dev, dev->dma_base[BANK1_CTX], + S5P_FIMV_MC_DRAMBASE_ADR_A); + mfc_write(dev, dev->dma_base[BANK2_CTX], + S5P_FIMV_MC_DRAMBASE_ADR_B); mfc_debug(2, "Bank1: %pad, Bank2: %pad\n", - &dev->bank1, &dev->bank2); + &dev->dma_base[BANK1_CTX], &dev->dma_base[BANK2_CTX]); } } diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c index 65dd3e64b4db..32ce9ade2edb 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c @@ -30,8 +30,8 @@ #include #include -#define OFFSETA(x) (((x) - dev->bank1) >> MFC_OFFSET_SHIFT) -#define OFFSETB(x) (((x) - dev->bank2) >> MFC_OFFSET_SHIFT) +#define OFFSETA(x) (((x) - dev->dma_base[BANK1_CTX]) >> MFC_OFFSET_SHIFT) +#define OFFSETB(x) (((x) - dev->dma_base[BANK2_CTX]) >> MFC_OFFSET_SHIFT) /* Allocate temporary buffers for decoding */ static int s5p_mfc_alloc_dec_temp_buffers_v5(struct s5p_mfc_ctx *ctx) @@ -41,8 +41,8 @@ static int s5p_mfc_alloc_dec_temp_buffers_v5(struct s5p_mfc_ctx *ctx) int ret; ctx->dsc.size = buf_size->dsc; - ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], dev->bank1, - &ctx->dsc); + ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], + dev->dma_base[BANK1_CTX], &ctx->dsc); if (ret) { mfc_err("Failed to allocate temporary buffer\n"); return ret; @@ -174,7 +174,7 @@ static int s5p_mfc_alloc_codec_buffers_v5(struct s5p_mfc_ctx *ctx) if (ctx->bank1.size > 0) { ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], - dev->bank1, &ctx->bank1); + dev->dma_base[BANK1_CTX], &ctx->bank1); if (ret) { mfc_err("Failed to allocate Bank1 temporary buffer\n"); return ret; @@ -184,7 +184,7 @@ static int s5p_mfc_alloc_codec_buffers_v5(struct s5p_mfc_ctx *ctx) /* Allocate only if memory from bank 2 is necessary */ if (ctx->bank2.size > 0) { ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK2_CTX], - dev->bank2, &ctx->bank2); + dev->dma_base[BANK2_CTX], &ctx->bank2); if (ret) { mfc_err("Failed to allocate Bank2 temporary buffer\n"); s5p_mfc_release_priv_buf(ctx->dev->mem_dev[BANK1_CTX], @@ -216,8 +216,8 @@ static int s5p_mfc_alloc_instance_buffer_v5(struct s5p_mfc_ctx *ctx) else ctx->ctx.size = buf_size->non_h264_ctx; - ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], dev->bank1, - &ctx->ctx); + ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], + dev->dma_base[BANK1_CTX], &ctx->ctx); if (ret) { mfc_err("Failed to allocate instance buffer\n"); return ret; @@ -230,8 +230,8 @@ static int s5p_mfc_alloc_instance_buffer_v5(struct s5p_mfc_ctx *ctx) /* Initialize shared memory */ ctx->shm.size = buf_size->shm; - ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], dev->bank1, - &ctx->shm); + ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], + dev->dma_base[BANK1_CTX], &ctx->shm); if (ret) { mfc_err("Failed to allocate shared memory buffer\n"); s5p_mfc_release_priv_buf(dev->mem_dev[BANK1_CTX], &ctx->ctx); @@ -239,7 +239,7 @@ static int s5p_mfc_alloc_instance_buffer_v5(struct s5p_mfc_ctx *ctx) } /* shared memory offset only keeps the offset from base (port a) */ - ctx->shm.ofs = ctx->shm.dma - dev->bank1; + ctx->shm.ofs = ctx->shm.dma - dev->dma_base[BANK1_CTX]; BUG_ON(ctx->shm.ofs & ((1 << MFC_BANK1_ALIGN_ORDER) - 1)); memset(ctx->shm.virt, 0, buf_size->shm); @@ -538,10 +538,10 @@ static void s5p_mfc_get_enc_frame_buffer_v5(struct s5p_mfc_ctx *ctx, { struct s5p_mfc_dev *dev = ctx->dev; - *y_addr = dev->bank2 + (mfc_read(dev, S5P_FIMV_ENCODED_Y_ADDR) - << MFC_OFFSET_SHIFT); - *c_addr = dev->bank2 + (mfc_read(dev, S5P_FIMV_ENCODED_C_ADDR) - << MFC_OFFSET_SHIFT); + *y_addr = dev->dma_base[BANK2_CTX] + + (mfc_read(dev, S5P_FIMV_ENCODED_Y_ADDR) << MFC_OFFSET_SHIFT); + *c_addr = dev->dma_base[BANK2_CTX] + + (mfc_read(dev, S5P_FIMV_ENCODED_C_ADDR) << MFC_OFFSET_SHIFT); } /* Set encoding ref & codec buffer */ @@ -1218,7 +1218,8 @@ static int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) } if (list_empty(&ctx->src_queue)) { /* send null frame */ - s5p_mfc_set_enc_frame_buffer_v5(ctx, dev->bank2, dev->bank2); + s5p_mfc_set_enc_frame_buffer_v5(ctx, dev->dma_base[BANK2_CTX], + dev->dma_base[BANK2_CTX]); src_mb = NULL; } else { src_mb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, @@ -1226,8 +1227,9 @@ static int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) src_mb->flags |= MFC_BUF_FLAG_USED; if (src_mb->b->vb2_buf.planes[0].bytesused == 0) { /* send null frame */ - s5p_mfc_set_enc_frame_buffer_v5(ctx, dev->bank2, - dev->bank2); + s5p_mfc_set_enc_frame_buffer_v5(ctx, + dev->dma_base[BANK2_CTX], + dev->dma_base[BANK2_CTX]); ctx->state = MFCINST_FINISHING; } else { src_y_addr = vb2_dma_contig_plane_dma_addr( diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c index e23ca08e88c5..f1a6a3539549 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c @@ -240,7 +240,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) /* Allocate only if memory from bank 1 is necessary */ if (ctx->bank1.size > 0) { ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], - dev->bank1, &ctx->bank1); + dev->dma_base[BANK1_CTX], &ctx->bank1); if (ret) { mfc_err("Failed to allocate Bank1 memory\n"); return ret; @@ -292,8 +292,8 @@ static int s5p_mfc_alloc_instance_buffer_v6(struct s5p_mfc_ctx *ctx) break; } - ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], dev->bank1, - &ctx->ctx); + ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], + dev->dma_base[BANK1_CTX], &ctx->ctx); if (ret) { mfc_err("Failed to allocate instance buffer\n"); return ret; @@ -322,8 +322,8 @@ static int s5p_mfc_alloc_dev_context_buffer_v6(struct s5p_mfc_dev *dev) mfc_debug_enter(); dev->ctx_buf.size = buf_size->dev_ctx; - ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], dev->bank1, - &dev->ctx_buf); + ret = s5p_mfc_alloc_priv_buf(dev->mem_dev[BANK1_CTX], + dev->dma_base[BANK1_CTX], &dev->ctx_buf); if (ret) { mfc_err("Failed to allocate device context buffer\n"); return ret; From patchwork Mon Mar 20 10:56:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95504 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp882181qgd; Mon, 20 Mar 2017 04:00:23 -0700 (PDT) X-Received: by 10.84.229.2 with SMTP id b2mr39424197plk.154.1490007623708; Mon, 20 Mar 2017 04:00:23 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si17052423pgj.392.2017.03.20.04.00.23; Mon, 20 Mar 2017 04:00:23 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754212AbdCTLAQ (ORCPT + 4 others); Mon, 20 Mar 2017 07:00:16 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:30564 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753662AbdCTK5P (ORCPT ); Mon, 20 Mar 2017 06:57:15 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON400EHD12SLE20@mailout3.w1.samsung.com>; Mon, 20 Mar 2017 10:56:52 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170320105652eucas1p134f44f606b9c8cfe41d6fde483d69d37~tkdjN9Qih2157021570eucas1p1l; Mon, 20 Mar 2017 10:56:52 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 42.BD.28517.375BFC85; Mon, 20 Mar 2017 10:56:51 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170320105651eucas1p1c80766207bf60d211200f2f5daa2c799~tkdif-Mty0560605606eucas1p1a; Mon, 20 Mar 2017 10:56:51 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-32-58cfb573da95 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 4F.DA.10233.185BFC85; Mon, 20 Mar 2017 10:57:05 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:51 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 06/16] media: s5p-mfc: Move setting DMA max segment size to DMA configure function Date: Mon, 20 Mar 2017 11:56:32 +0100 Message-id: <1490007402-30265-7-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsWy7djP87rFW89HGCy+YWhxa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDmKyyYl NSezLLVI3y6BK+POpo3sBRPEKub8rm1gfCfUxcjJISFgIvF5xwE2CFtM4sK99UA2F4eQwFJG id1TPrJAOJ8ZJbbsfMMO07Hx/kyoqmWMEisbt7BDOA1MEmeaPzGCVLEJGEp0ve0Cmysi4CSx cNZfsCJmge+MEt92n2YFSQgLpEuc7DnODGKzCKhK3PjeB9TAwcEr4CFx90gVxDY5iZPHJoOV cwp4Sry4/hdss4TAczaJD4u7mEDqJQRkJTYdYIaod5H483QH1D/CEq+Ob4G6Wkbi8uRuFgi7 n1GiqVUbwp7BKHHuLS+EbS1x+PhFsF3MAnwSk7ZNZ4YYzyvR0SYEYXpIbN5WDlHtKDFj1gFo AM1hlNjz4RHTBEaZBYwMqxhFUkuLc9NTi030ihNzi0vz0vWS83M3MQJj9vS/4192MC4+ZnWI UYCDUYmH98alcxFCrIllxZW5hxglOJiVRHg/zj0fIcSbklhZlVqUH19UmpNafIhRmoNFSZx3 z4Ir4UIC6YklqdmpqQWpRTBZJg5OqQZG5RoPxceOjzsXNpcHOos7LH9p/6PH5k5Y4Ov3zlwb nTY/dun/U/tw+bS92kKTlii/zZvuxyfOukJG6ovPLm1J/uxtZrzt+9me/312fp2tw7PMfQ21 6nsaf54KiErlsp0ZctQ2nvlj0r8Gz+On8m+dkuswj316WS7M5Kjl/R83/TeeF6+48I9LiaU4 I9FQi7moOBEAC46oddUCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsVy+t/xa7qNW89HGOxfbmBxa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDnKzSYj NTEltUghNS85PyUzL91WKTTETddCSSEvMTfVVilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJ bhl3Nm1kL5ggVjHnd20D4zuhLkZODgkBE4mN92eyQdhiEhfurQeyuTiEBJYwSvx91sgE4TQx SRy8/ZMFpIpNwFCi620XWIeIgJPEwll/2UFsZoHvjBLLbqaB2MIC6RIHdk9gBrFZBFQlbnzv A6rn4OAV8JC4e6QKYpmcxMljk1lBbE4BT4kX1/+CjRQCKln3eSLTBEbeBYwMqxhFUkuLc9Nz i430ihNzi0vz0vWS83M3MQLDd9uxn1t2MHa9Cz7EKMDBqMTDa3D1XIQQa2JZcWXuIUYJDmYl Ed6Pc89HCPGmJFZWpRblxxeV5qQWH2I0BbppIrOUaHI+MLbySuINTQzNLQ2NjC0szI2MlMR5 p364Ei4kkJ5YkpqdmlqQWgTTx8TBKdXAyGa0PqKwadNDw4rfL0oLNH2L/y+6PUkpfqHxpLRH O44uPOA4+9bN2ZzbQjq4tVYck1JaLJy5PVdWkcMj/anztZcar/3lGvjsflRVrT0ruYTFYfa+ Bd8eSt4zk2ZsaDQJPp7Qx39Jfe7auYqi0dwpQQZHhbaZBVe+UTwlNv3WvKRVi4v9ODe/VmIp zkg01GIuKk4EABEVUOF1AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105651eucas1p1c80766207bf60d211200f2f5daa2c799 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320105651eucas1p1c80766207bf60d211200f2f5daa2c799 X-RootMTR: 20170320105651eucas1p1c80766207bf60d211200f2f5daa2c799 References: <1490007402-30265-1-git-send-email-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 Setting DMA max segment size to 32 bit mask is a part of DMA memory configuration, so move those calls to s5p_mfc_configure_dma_memory() function. Signed-off-by: Marek Szyprowski Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Acked-by: Andrzej Hajda Tested-by: Smitha T Murthy --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) -- 1.9.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/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index c03ed1a737b7..1fe790d88e70 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1117,9 +1117,13 @@ static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) if (exynos_is_iommu_available(dev)) { int ret = exynos_configure_iommu(dev, S5P_MFC_IOMMU_DMA_BASE, S5P_MFC_IOMMU_DMA_SIZE); - if (ret == 0) + if (ret == 0) { mfc_dev->mem_dev[BANK1_CTX] = mfc_dev->mem_dev[BANK2_CTX] = dev; + vb2_dma_contig_set_max_seg_size(dev, + DMA_BIT_MASK(32)); + } + return ret; } @@ -1138,6 +1142,11 @@ static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) return -ENODEV; } + vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK1_CTX], + DMA_BIT_MASK(32)); + vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK2_CTX], + DMA_BIT_MASK(32)); + return 0; } @@ -1147,11 +1156,14 @@ static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) if (exynos_is_iommu_available(dev)) { exynos_unconfigure_iommu(dev); + vb2_dma_contig_clear_max_seg_size(dev); return; } device_unregister(mfc_dev->mem_dev[BANK1_CTX]); device_unregister(mfc_dev->mem_dev[BANK2_CTX]); + vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK1_CTX]); + vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK2_CTX]); } /* MFC probe function */ @@ -1209,11 +1221,6 @@ static int s5p_mfc_probe(struct platform_device *pdev) goto err_dma; } - vb2_dma_contig_set_max_seg_size(dev->mem_dev[BANK1_CTX], - DMA_BIT_MASK(32)); - vb2_dma_contig_set_max_seg_size(dev->mem_dev[BANK2_CTX], - DMA_BIT_MASK(32)); - mutex_init(&dev->mfc_mutex); init_waitqueue_head(&dev->queue); dev->hw_lock = 0; @@ -1346,8 +1353,6 @@ static int s5p_mfc_remove(struct platform_device *pdev) v4l2_device_unregister(&dev->v4l2_dev); s5p_mfc_release_firmware(dev); s5p_mfc_unconfigure_dma_memory(dev); - vb2_dma_contig_clear_max_seg_size(dev->mem_dev[BANK1_CTX]); - vb2_dma_contig_clear_max_seg_size(dev->mem_dev[BANK2_CTX]); s5p_mfc_final_pm(dev); return 0; From patchwork Mon Mar 20 10:56:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95509 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp882297qgd; Mon, 20 Mar 2017 04:00:35 -0700 (PDT) X-Received: by 10.84.238.9 with SMTP id u9mr39797777plk.174.1490007635811; Mon, 20 Mar 2017 04:00:35 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n26si17049412pge.228.2017.03.20.04.00.35; Mon, 20 Mar 2017 04:00:35 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754162AbdCTLAd (ORCPT + 4 others); Mon, 20 Mar 2017 07:00:33 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:35464 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751467AbdCTK5N (ORCPT ); Mon, 20 Mar 2017 06:57:13 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON400CQ312SV020@mailout1.w1.samsung.com>; Mon, 20 Mar 2017 10:56:52 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105652eucas1p229c2278823bc1fe4fbfc31d883398914~tkdjTSq5J2732427324eucas1p2G; Mon, 20 Mar 2017 10:56:52 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 69.A0.16908.675BFC85; Mon, 20 Mar 2017 10:56:54 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105651eucas1p2f4a367546f4f33c652b36415b8542e3b~tkdiqs94j2243522435eucas1p2U; Mon, 20 Mar 2017 10:56:51 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-c7-58cfb576788d Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 72.E7.06687.DD5BFC85; Mon, 20 Mar 2017 10:58:37 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:51 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 07/16] media: s5p-mfc: Put firmware to private buffer structure Date: Mon, 20 Mar 2017 11:56:33 +0100 Message-id: <1490007402-30265-8-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMIsWRmVeSWpSXmKPExsWy7djP87plW89HGJxdqmFxa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDmKyyYl NSezLLVI3y6BK+NaTxtrQZNGxeknDxgbGJ8pdjFycEgImEh8mJPRxcgJZIpJXLi3nq2LkYtD SGAZo8S1iUvYIZzPjBJvLvxngagykZj7dStC1bMTq5ghnAYmiTPNnxhBqtgEDCW63naxgdgi Ak4SC2f9BRvFLPCdUeLb7tOsIAlhgRCJO3dBujk4WARUJa6sUAIJ8wp4SHy/sZodYpucxMlj k8HKOQU8JV5c/wu2WULgNZvE1ynHmCF+kJXYdIAZot5FYvujx6wQtrDEq+NboObISHR2HGSC sPsZJZpatSHsGYwS597yQtjWEoePXwTrZRbgk5i0bTrUeF6JjjYhiBIPiYW/50GNdJTY+/cQ I8TvcxglVr7ZyjiBUWYBI8MqRpHU0uLc9NRiQ73ixNzi0rx0veT83E2MwKg9/e/4+x2MT5tD DjEKcDAq8fDeuHQuQog1say4MvcQowQHs5II78e55yOEeFMSK6tSi/Lji0pzUosPMUpzsCiJ 8+5dcCVcSCA9sSQ1OzW1ILUIJsvEwSnVwOhRznpLsEbIOOlRyWovoTn58vKOdhMZba49fVFn k1nzJ+Dvgne/lgbdeXdd+kuWx4nFiWfv2i+qN33qdVn2Vu/NnIS0i5nfTH0Xdaq/lp/TcGs+ 30vhCcuEKk+kvygMWNEYXsBjzKWuzLJ8S9mFTrf8WYJC13t9dHdscZCalvgr4LvksTkHMpVY ijMSDbWYi4oTAZDMLQTWAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRmVeSWpSXmKPExsVy+t/xa7p3t56PMNg4V9Ti1rpzrBaT7k9g sTh/fgO7Rc+GrawWM87vY7JYe+Quu8XhN+1A7uSXbA4cHptWdbJ59G1ZxejxeZNcAHOUm01G amJKapFCal5yfkpmXrqtUmiIm66FkkJeYm6qrVKErm9IkJJCWWJOKZBnZIAGHJwD3IOV9O0S 3DKu9bSxFjRpVJx+8oCxgfGZYhcjJ4eEgInE3K9b2SBsMYkL99YD2VwcQgJLGCVWPdjACuE0 MUkcvP2TBaSKTcBQouttF1iHiICTxMJZf9lBbGaB74wSy26mgdjCAiESd+6uYu5i5OBgEVCV uLJCCSTMK+Ah8f3GanaIZXISJ49NZgWxOQU8JV5c/ws2UgioZt3niUwTGHkXMDKsYhRJLS3O Tc8tNtQrTswtLs1L10vOz93ECAzgbcd+bt7BeGlj8CFGAQ5GJR5eg6vnIoRYE8uKK3MPMUpw MCuJ8H6cez5CiDclsbIqtSg/vqg0J7X4EKMp0E0TmaVEk/OB0ZVXEm9oYmhuaWhkbGFhbmSk JM5b8uFKuJBAemJJanZqakFqEUwfEwenVAMjX9TlGnv2xtpVi1on5S3RnNd7RKUt12+q4Fcd jZ9fPidzL7V4NC382xpPDmntXueJW/K0/imGOKy6un3Ttfp5kYfezV83Q12V4VVbp9x+9QoZ 9avZu2ffeVI9yywn91kd+6kExRpO1pUpHn9NZy3QX39o5Ynw2LnTvjy9cFBJw/Tb9V6Tl8cu K7EUZyQaajEXFScCAAbrOY52AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105651eucas1p2f4a367546f4f33c652b36415b8542e3b X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320105651eucas1p2f4a367546f4f33c652b36415b8542e3b X-RootMTR: 20170320105651eucas1p2f4a367546f4f33c652b36415b8542e3b References: <1490007402-30265-1-git-send-email-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 Use s5p_mfc_priv_buf structure for keeping the firmware image. This will help handling of firmware buffer allocation in the next patches. Signed-off-by: Marek Szyprowski Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Acked-by: Andrzej Hajda Tested-by: Smitha T Murthy --- drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v5.c | 2 +- drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 3 +-- drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 36 ++++++++++++------------- 3 files changed, 20 insertions(+), 21 deletions(-) -- 1.9.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/media/platform/s5p-mfc/s5p_mfc_cmd_v5.c b/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v5.c index 8c4739ca16d6..4c80bb4243be 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v5.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_cmd_v5.c @@ -47,7 +47,7 @@ static int s5p_mfc_sys_init_cmd_v5(struct s5p_mfc_dev *dev) struct s5p_mfc_cmd_args h2r_args; memset(&h2r_args, 0, sizeof(struct s5p_mfc_cmd_args)); - h2r_args.arg[0] = dev->fw_size; + h2r_args.arg[0] = dev->fw_buf.size; return s5p_mfc_cmd_host2risc_v5(dev, S5P_FIMV_H2R_CMD_SYS_INIT, &h2r_args); } diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index 9cf860f34c71..cea17a737ef7 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -314,8 +314,7 @@ struct s5p_mfc_dev { int int_type; unsigned int int_err; wait_queue_head_t queue; - size_t fw_size; - void *fw_virt_addr; + struct s5p_mfc_priv_buf fw_buf; dma_addr_t dma_base[BANK_CTX_NUM]; unsigned long hw_lock; struct s5p_mfc_ctx *ctx[MFC_NUM_CONTEXTS]; diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c index c9bff3d0655f..50d698968049 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c @@ -29,21 +29,22 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) void *bank2_virt; dma_addr_t bank2_dma_addr; unsigned int align_size = 1 << MFC_BASE_ALIGN_ORDER; + struct s5p_mfc_priv_buf *fw_buf = &dev->fw_buf; - dev->fw_size = dev->variant->buf_size->fw; + fw_buf->size = dev->variant->buf_size->fw; - if (dev->fw_virt_addr) { + if (fw_buf->virt) { mfc_err("Attempting to allocate firmware when it seems that it is already loaded\n"); return -ENOMEM; } - dev->fw_virt_addr = dma_alloc_coherent(dev->mem_dev[BANK1_CTX], - dev->fw_size, &dev->dma_base[BANK1_CTX], - GFP_KERNEL); - if (!dev->fw_virt_addr) { + fw_buf->virt = dma_alloc_coherent(dev->mem_dev[BANK1_CTX], fw_buf->size, + &fw_buf->dma, GFP_KERNEL); + if (!fw_buf->virt) { mfc_err("Allocating bitprocessor buffer failed\n"); return -ENOMEM; } + dev->dma_base[BANK1_CTX] = fw_buf->dma; if (HAS_PORTNUM(dev) && IS_TWOPORT(dev)) { bank2_virt = dma_alloc_coherent(dev->mem_dev[BANK2_CTX], @@ -51,10 +52,9 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) if (!bank2_virt) { mfc_err("Allocating bank2 base failed\n"); - dma_free_coherent(dev->mem_dev[BANK1_CTX], dev->fw_size, - dev->fw_virt_addr, - dev->dma_base[BANK1_CTX]); - dev->fw_virt_addr = NULL; + dma_free_coherent(dev->mem_dev[BANK1_CTX], fw_buf->size, + fw_buf->virt, fw_buf->dma); + fw_buf->virt = NULL; return -ENOMEM; } @@ -101,17 +101,17 @@ int s5p_mfc_load_firmware(struct s5p_mfc_dev *dev) mfc_err("Firmware is not present in the /lib/firmware directory nor compiled in kernel\n"); return -EINVAL; } - if (fw_blob->size > dev->fw_size) { + if (fw_blob->size > dev->fw_buf.size) { mfc_err("MFC firmware is too big to be loaded\n"); release_firmware(fw_blob); return -ENOMEM; } - if (!dev->fw_virt_addr) { + if (!dev->fw_buf.virt) { mfc_err("MFC firmware is not allocated\n"); release_firmware(fw_blob); return -EINVAL; } - memcpy(dev->fw_virt_addr, fw_blob->data, fw_blob->size); + memcpy(dev->fw_buf.virt, fw_blob->data, fw_blob->size); wmb(); release_firmware(fw_blob); mfc_debug_leave(); @@ -123,11 +123,11 @@ int s5p_mfc_release_firmware(struct s5p_mfc_dev *dev) { /* Before calling this function one has to make sure * that MFC is no longer processing */ - if (!dev->fw_virt_addr) + if (!dev->fw_buf.virt) return -EINVAL; - dma_free_coherent(dev->mem_dev[BANK1_CTX], dev->fw_size, - dev->fw_virt_addr, dev->dma_base[BANK1_CTX]); - dev->fw_virt_addr = NULL; + dma_free_coherent(dev->mem_dev[BANK1_CTX], dev->fw_buf.size, + dev->fw_buf.virt, dev->fw_buf.dma); + dev->fw_buf.virt = NULL; return 0; } @@ -246,7 +246,7 @@ int s5p_mfc_init_hw(struct s5p_mfc_dev *dev) int ret; mfc_debug_enter(); - if (!dev->fw_virt_addr) { + if (!dev->fw_buf.virt) { mfc_err("Firmware memory is not allocated.\n"); return -EINVAL; } From patchwork Mon Mar 20 10:56:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95506 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp882200qgd; Mon, 20 Mar 2017 04:00:25 -0700 (PDT) X-Received: by 10.84.177.164 with SMTP id x33mr38669777plb.75.1490007625219; Mon, 20 Mar 2017 04:00:25 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si17052423pgj.392.2017.03.20.04.00.24; Mon, 20 Mar 2017 04:00: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754082AbdCTLAX (ORCPT + 4 others); Mon, 20 Mar 2017 07:00:23 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:35464 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753651AbdCTK5O (ORCPT ); Mon, 20 Mar 2017 06:57:14 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON400COL12TV220@mailout1.w1.samsung.com>; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105653eucas1p286130363d62fc14b9a3edfe7a5b4dc5e~tkdkTIEm00928009280eucas1p2g; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 6C.7B.17477.475BFC85; Mon, 20 Mar 2017 10:56:52 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170320105652eucas1p1176471116a8764dd0b0c70e58a2806b3~tkdjoEMFP0562005620eucas1p1t; Mon, 20 Mar 2017 10:56:52 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-79-58cfb574f635 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 00.EA.10233.285BFC85; Mon, 20 Mar 2017 10:57:06 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:52 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 09/16] media: s5p-mfc: Allocate firmware with internal private buffer alloc function Date: Mon, 20 Mar 2017 11:56:35 +0100 Message-id: <1490007402-30265-10-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrMIsWRmVeSWpSXmKPExsWy7djPc7olW89HGJxrt7G4te4cq8Wk+xNY LM6f38Bu0bNhK6vFjPP7mCzWHrnLbnH4TTuQO/klmwOHx6ZVnWwefVtWMXp83iQXwBzFZZOS mpNZllqkb5fAlfHhxV6Wgnt8Fd+OuDUwbuTpYuTkkBAwkdh24T8ThC0mceHeerYuRi4OIYGl jBKP3k6Ecj4zSnxfeZYJpqN3+SRWiMQyRok7/1awQzgNTBLvHy1hBKliEzCU6HrbxQZiiwg4 SSyc9ResiFngO6PEt92nWUESwgKZEp0/f7OA2CwCqhJPPp4Aa+AV8JS4teM7I8Q6OYmTxyaD 1XMCxV9c/wt2k4TAczaJpffPAzkcQI6sxKYDzBD1LhKL5jeyQdjCEq+Ob2GHsGUkLk/uZoGw +xklmlq1IewZjBLn3vJC2NYSh49fBNvFLMAnMWnbdGaI8bwSHW1CECUeEsferIHa6ihxYpYf xO9zgMG1fSHjBEaZBYwMqxhFUkuLc9NTi031ihNzi0vz0vWS83M3MQKj9vS/4193MC49ZnWI UYCDUYmH1+DquQgh1sSy4srcQ4wSHMxKIrwf556PEOJNSaysSi3Kjy8qzUktPsQozcGiJM67 Z8GVcCGB9MSS1OzU1ILUIpgsEwenVAPj9VurY5kLra9yLJ/ttZppjoDf0nu7Y0ITNjT7df5w aVk6Oa25suDpCcdbUVM4Al7H5s13kzas0Lvgl7RZIf/lWan9rP1GAdcm/JWt6Volds/bbs+0 Q+038z67LzoXkm6tfPjb4sbzu5MElSPqv/II7Vc1tewKdrT0uvkoztI8V+f2wgr21c+UWIoz Eg21mIuKEwFKwgKx1gIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsVy+t/xa7rNW89HGPzntri17hyrxaT7E1gs zp/fwG7Rs2Erq8WM8/uYLNYeuctucfhNO5A7+SWbA4fHplWdbB59W1YxenzeJBfAHOVmk5Ga mJJapJCal5yfkpmXbqsUGuKma6GkkJeYm2qrFKHrGxKkpFCWmFMK5BkZoAEH5wD3YCV9uwS3 jA8v9rIU3OOr+HbErYFxI08XIyeHhICJRO/ySawQtpjEhXvr2boYuTiEBJYwSvTevMsK4TQx STy8tp8RpIpNwFCi620XG4gtIuAksXDWX3YQm1ngO6PEsptpILawQKZE58/fLCA2i4CqxJOP J8DqeQU8JW7t+M4IsU1O4uSxyWCbOYHiL67/BasREvCQWPd5ItMERt4FjAyrGEVSS4tz03OL jfSKE3OLS/PS9ZLzczcxAsN327GfW3Ywdr0LPsQowMGoxMNrcPVchBBrYllxZe4hRgkOZiUR 3o9zz0cI8aYkVlalFuXHF5XmpBYfYjQFOmois5Rocj4wtvJK4g1NDM0tDY2MLSzMjYyUxHmn frgSLiSQnliSmp2aWpBaBNPHxMEp1cB4oY45Iv6Iq0QEd2/QzZ7Z1g+mfugTe/vTZLIiUx7f 5by3jckV3dUMi1d4sEZ66vGt5PVe6/BbpnnSX/2dArdlN8WLlM+Oem5c+W7nJR/he5d/7px/ lnu3/4Jqi7rJpWemby6aGRwjG5G46AA798PJz6pPRs8rdJiSmMoasHZxeUfqeXM713tKLMUZ iYZazEXFiQAbjdv6dQIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105652eucas1p1176471116a8764dd0b0c70e58a2806b3 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320105652eucas1p1176471116a8764dd0b0c70e58a2806b3 X-RootMTR: 20170320105652eucas1p1176471116a8764dd0b0c70e58a2806b3 References: <1490007402-30265-1-git-send-email-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 Once firmware buffer has been converted to use s5p_mfc_priv_buf structure, it is possible to allocate it with existing s5p_mfc_alloc_priv_buf() function. This change will help to reduce code variants in the next patches. Signed-off-by: Marek Szyprowski Reviewed-by: Javier Martinez Canillas Acked-by: Andrzej Hajda Tested-by: Smitha T Murthy --- drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) -- 1.9.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/media/platform/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c index b0cf3970117a..a1811ee538bd 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c @@ -27,6 +27,7 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) { struct s5p_mfc_priv_buf *fw_buf = &dev->fw_buf; + int err; fw_buf->size = dev->variant->buf_size->fw; @@ -35,11 +36,10 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) return -ENOMEM; } - fw_buf->virt = dma_alloc_coherent(dev->mem_dev[BANK1_CTX], fw_buf->size, - &fw_buf->dma, GFP_KERNEL); - if (!fw_buf->virt) { + err = s5p_mfc_alloc_priv_buf(dev, BANK1_CTX, &dev->fw_buf); + if (err) { mfc_err("Allocating bitprocessor buffer failed\n"); - return -ENOMEM; + return err; } return 0; @@ -92,11 +92,7 @@ int s5p_mfc_release_firmware(struct s5p_mfc_dev *dev) { /* Before calling this function one has to make sure * that MFC is no longer processing */ - if (!dev->fw_buf.virt) - return -EINVAL; - dma_free_coherent(dev->mem_dev[BANK1_CTX], dev->fw_buf.size, - dev->fw_buf.virt, dev->fw_buf.dma); - dev->fw_buf.virt = NULL; + s5p_mfc_release_priv_buf(dev, &dev->fw_buf); return 0; } From patchwork Mon Mar 20 10:56:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95501 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp881741qgd; Mon, 20 Mar 2017 03:59:05 -0700 (PDT) X-Received: by 10.99.206.5 with SMTP id y5mr30312650pgf.212.1490007545472; Mon, 20 Mar 2017 03:59:05 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w15si17108740plk.292.2017.03.20.03.59.05; Mon, 20 Mar 2017 03:59:05 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753849AbdCTK7A (ORCPT + 4 others); Mon, 20 Mar 2017 06:59:00 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:35464 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753667AbdCTK5Q (ORCPT ); Mon, 20 Mar 2017 06:57:16 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON400CQ512UV020@mailout1.w1.samsung.com>; Mon, 20 Mar 2017 10:56:54 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105653eucas1p2ca2059aa9a51df0269d1b8f25496e448~tkdkrveIK2243522435eucas1p2X; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges5.samsung.com (EUCPMTA) with SMTP id FC.7B.17477.575BFC85; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170320105652eucas1p1dfa223654e55908446103109d97aa2c2~tkdkAee5K0043700437eucas1p1s; Mon, 20 Mar 2017 10:56:52 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-7a-58cfb5750148 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 90.EA.10233.385BFC85; Mon, 20 Mar 2017 10:57:07 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:52 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 10/16] media: s5p-mfc: Reduce firmware buffer size for MFC v6+ variants Date: Mon, 20 Mar 2017 11:56:36 +0100 Message-id: <1490007402-30265-11-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsWy7djP87qlW89HGBz+K25xa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDmKyyYl NSezLLVI3y6BK+PNbPuCRUIVc64vY2pgPM7fxcjJISFgIrHm/yxGCFtM4sK99WxdjFwcQgJL GSVubjzBDJIQEvjMKHHvhShMw+Htc5ghipYxSrxb+ZQRwmlgknj/aAnYKDYBQ4mut11sILaI gJPEwll/2UGKmAW+M0p8232aFSQhLBAjsaR3HxOIzSKgKrFiSxvYOl4BT4nZP3uZIdbJSZw8 NhmsnhMo/uL6X7D7JAQes0n8nbIAqIgDyJGV2HQAqt5F4suONewQtrDEq+NboGwZicuTu1kg 7H5GiaZWbQh7BqPEube8ELa1xOHjF8F2MQvwSUzaNh1qPK9ER5sQhOkhcanTEqLaUWLakS4W iN/nMEq8+nGMaQKjzAJGhlWMIqmlxbnpqcWmesWJucWleel6yfm5mxiBMXv63/GvOxiXHrM6 xCjAwajEw2tw9VyEEGtiWXFl7iFGCQ5mJRHej3PPRwjxpiRWVqUW5ccXleakFh9ilOZgURLn 3bPgSriQQHpiSWp2ampBahFMlomDU6qB8cBHrSmPQnyOukzTn/LS7JHeZQ2buxODb9/grZHs Pv/i7OEjHS3dPLaTk66r1jGvesy4Ozle+1JSk93LZw7p/Zt6J6RO6bTt2HjwwYR9O3/+0fzW 95EjYjvHX06eE6FzDYL/RJSlq+z87Pj0/q2WGSx59+J9Tt253Hfb3G1DehH7rum/3f+vT1Vi Kc5INNRiLipOBADpmest1QIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrELMWRmVeSWpSXmKPExsVy+t/xa7rNW89HGDzul7S4te4cq8Wk+xNY LM6f38Bu0bNhK6vFjPP7mCzWHrnLbnH4TTuQO/klmwOHx6ZVnWwefVtWMXp83iQXwBzlZpOR mpiSWqSQmpecn5KZl26rFBripmuhpJCXmJtqqxSh6xsSpKRQlphTCuQZGaABB+cA92AlfbsE t4w3s+0LFglVzLm+jKmB8Th/FyMnh4SAicTh7XOYIWwxiQv31rOB2EICSxglHl+N7mLkArKb mCQeXtvPCJJgEzCU6HrbBVYkIuAksXDWX3YQm1ngO6PEsptpILawQIzEkcPvWUFsFgFViRVb 2sAW8Ap4Ssz+2Qu1TE7i5LHJYDWcQPEX1/9CLfaQWPd5ItMERt4FjAyrGEVSS4tz03OLjfSK E3OLS/PS9ZLzczcxAsN327GfW3Ywdr0LPsQowMGoxMNrcPVchBBrYllxZe4hRgkOZiUR3o9z z0cI8aYkVlalFuXHF5XmpBYfYjQFOmois5Rocj4wtvJK4g1NDM0tDY2MLSzMjYyUxHmnfrgS LiSQnliSmp2aWpBaBNPHxMEp1cDIw5gX2ut2V2h5HrfF+o/yxxbwijeINiZc2qSVv3jq4p/z Js6dxWlxwdJ8hbfb2iuvC1Iv5Zuk3hZf1ce789iyK5xpvJLTgxjiG9Xr7+tOfMBuFmP5/2Rx oEdOyVkFjvS1t9xmP/md9En86DpL4UUsZ2sd7qlOC7tw4uYzhTnxT5q2vlqTweCsxFKckWio xVxUnAgAl/xhrXUCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105652eucas1p1dfa223654e55908446103109d97aa2c2 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320105652eucas1p1dfa223654e55908446103109d97aa2c2 X-RootMTR: 20170320105652eucas1p1dfa223654e55908446103109d97aa2c2 References: <1490007402-30265-1-git-send-email-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 Firmware for MFC v6+ variants is not larger than 400 KiB, so there is no need to allocate a full 1 MiB buffer for it. Reduce it to 512 KiB to keep proper alignment of allocated buffer. Signed-off-by: Marek Szyprowski Reviewed-by: Javier Martinez Canillas Acked-by: Andrzej Hajda Tested-by: Smitha T Murthy --- drivers/media/platform/s5p-mfc/regs-mfc-v6.h | 2 +- drivers/media/platform/s5p-mfc/regs-mfc-v7.h | 2 +- drivers/media/platform/s5p-mfc/regs-mfc-v8.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -- 1.9.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/media/platform/s5p-mfc/regs-mfc-v6.h b/drivers/media/platform/s5p-mfc/regs-mfc-v6.h index d2cd35916dc5..c0166ee9a455 100644 --- a/drivers/media/platform/s5p-mfc/regs-mfc-v6.h +++ b/drivers/media/platform/s5p-mfc/regs-mfc-v6.h @@ -403,7 +403,7 @@ #define MFC_OTHER_ENC_CTX_BUF_SIZE_V6 (12 * SZ_1K) /* 12KB */ /* MFCv6 variant defines */ -#define MAX_FW_SIZE_V6 (SZ_1M) /* 1MB */ +#define MAX_FW_SIZE_V6 (SZ_512K) /* 512KB */ #define MAX_CPB_SIZE_V6 (3 * SZ_1M) /* 3MB */ #define MFC_VERSION_V6 0x61 #define MFC_NUM_PORTS_V6 1 diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v7.h b/drivers/media/platform/s5p-mfc/regs-mfc-v7.h index 1a5c6fdf7846..9f220769d970 100644 --- a/drivers/media/platform/s5p-mfc/regs-mfc-v7.h +++ b/drivers/media/platform/s5p-mfc/regs-mfc-v7.h @@ -34,7 +34,7 @@ #define S5P_FIMV_E_VP8_NUM_T_LAYER_V7 0xfdc4 /* MFCv7 variant defines */ -#define MAX_FW_SIZE_V7 (SZ_1M) /* 1MB */ +#define MAX_FW_SIZE_V7 (SZ_512K) /* 512KB */ #define MAX_CPB_SIZE_V7 (3 * SZ_1M) /* 3MB */ #define MFC_VERSION_V7 0x72 #define MFC_NUM_PORTS_V7 1 diff --git a/drivers/media/platform/s5p-mfc/regs-mfc-v8.h b/drivers/media/platform/s5p-mfc/regs-mfc-v8.h index 4d1c3750eb5e..75f5f7511d72 100644 --- a/drivers/media/platform/s5p-mfc/regs-mfc-v8.h +++ b/drivers/media/platform/s5p-mfc/regs-mfc-v8.h @@ -116,7 +116,7 @@ #define S5P_FIMV_D_ALIGN_PLANE_SIZE_V8 64 /* MFCv8 variant defines */ -#define MAX_FW_SIZE_V8 (SZ_1M) /* 1MB */ +#define MAX_FW_SIZE_V8 (SZ_512K) /* 512KB */ #define MAX_CPB_SIZE_V8 (3 * SZ_1M) /* 3MB */ #define MFC_VERSION_V8 0x80 #define MFC_NUM_PORTS_V8 1 From patchwork Mon Mar 20 10:56:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95505 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp882187qgd; Mon, 20 Mar 2017 04:00:24 -0700 (PDT) X-Received: by 10.99.37.199 with SMTP id l190mr30949117pgl.86.1490007624391; Mon, 20 Mar 2017 04:00:24 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b5si17052423pgj.392.2017.03.20.04.00.24; Mon, 20 Mar 2017 04:00:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754098AbdCTLAT (ORCPT + 4 others); Mon, 20 Mar 2017 07:00:19 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:32748 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753653AbdCTK5P (ORCPT ); Mon, 20 Mar 2017 06:57:15 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON400BHC12U1S20@mailout4.w1.samsung.com>; Mon, 20 Mar 2017 10:56:54 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105653eucas1p257f4251890bfc3dd704680586aaa416d~tkdk9qSkb2733227332eucas1p26; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 03.BD.28517.575BFC85; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105653eucas1p27e61ab46b1804c710d4767d94aab27cd~tkdkNEAnE3058230582eucas1p2Z; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-36-58cfb57513b3 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 93.E7.06687.ED5BFC85; Mon, 20 Mar 2017 10:58:38 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 11/16] media: s5p-mfc: Split variant DMA memory configuration into separate functions Date: Mon, 20 Mar 2017 11:56:37 +0100 Message-id: <1490007402-30265-12-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsWy7djPc7qlW89HGPyeqWVxa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDmKyyYl NSezLLVI3y6BK+Pi/XXsBbO1KtYcOcbcwPheuYuRk0NCwETiyfapzBC2mMSFe+vZuhi5OIQE ljJKLL0wBcr5zChx4XgvI0zHrJc3mSASyxgl+q4+hapqYJK4M+sH2Cw2AUOJrrddbCC2iICT xMJZf9lBipgFvjNKfNt9mhUkISyQJXHm51YWEJtFQFVi3tf7YHFeAU+Jm7MWQK2Tkzh5bDJY nBMo/uL6X7BtEgKv2SRmH50M5HAAObISmw5APeEi0fVtBzuELSzx6vgWKFtGorPjIBOE3c8o 0dSqDWHPYJQ495YXwraWOHz8ItguZgE+iUnbpjNDjOeV6GgTgijxkGg5NRVqpKNEw4cLLBDP z2GU2Pn6M+MERpkFjAyrGEVSS4tz01OLTfSKE3OLS/PS9ZLzczcxAiP39L/jX3YwLj5mdYhR gINRiYf3xqVzEUKsiWXFlbmHGCU4mJVEeD/OPR8hxJuSWFmVWpQfX1Sak1p8iFGag0VJnHfP givhQgLpiSWp2ampBalFMFkmDk6pBkariMKd2yMSHKo1V1Y2cXzellGwP8BPdm6iy4KVMz49 rHv2f8vy+RVxfvxHwnf/t7924XNFuG/23qZ3q4x1OqeXhc1s13IMXJ/zNPHvzKI77pM4LNIF CvbM2lv4UKfxoTO/molE1N3WoqgD3h0nOzW8D689yux24RiTcaXkrWeuO/OybI4sZ1JiKc5I NNRiLipOBAAX+HNr2AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsVy+t/xa7r3tp6PMFjxxsbi1rpzrBaT7k9g sTh/fgO7Rc+GrawWM87vY7JYe+Quu8XhN+1A7uSXbA4cHptWdbJ59G1ZxejxeZNcAHOUm01G amJKapFCal5yfkpmXrqtUmiIm66FkkJeYm6qrVKErm9IkJJCWWJOKZBnZIAGHJwD3IOV9O0S 3DIu3l/HXjBbq2LNkWPMDYzvlbsYOTkkBEwkZr28yQRhi0lcuLeerYuRi0NIYAmjxNbLc1gh nCYmiaMre9lAqtgEDCW63naB2SICThILZ/1lB7GZBb4zSiy7mQZiCwtkSZz5uZUFxGYRUJWY 9/U+K4jNK+ApcXPWAkaIbXISJ49NBotzAsVfXP8LNlNIwENi3eeJTBMYeRcwMqxiFEktLc5N zy021CtOzC0uzUvXS87P3cQIDOFtx35u3sF4aWPwIUYBDkYlHl6Dq+cihFgTy4orcw8xSnAw K4nwfpx7PkKINyWxsiq1KD++qDQntfgQoynQUROZpUST84HxlVcSb2hiaG5paGRsYWFuZKQk zlvy4Uq4kEB6YklqdmpqQWoRTB8TB6dUA2N1+0LtB5MYZpk8v1Xtqbviw49lMz+yMKf8MT9b tVKt4dqKFWsu3HqQsXLRVzN9vVvZVl4X0w/t4Wm+wrF3jtRUw8vvIt7GTz/1V2f6VKst883q HyrMv5t6vWcKnw9DiNaFlo+zGNdqPfjIe2vqtKhaK/E7tv7big5/OM6r1ZgdNKn5qc/v0/vn KLEUZyQaajEXFScCAGbjmtp3AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105653eucas1p27e61ab46b1804c710d4767d94aab27cd X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320105653eucas1p27e61ab46b1804c710d4767d94aab27cd X-RootMTR: 20170320105653eucas1p27e61ab46b1804c710d4767d94aab27cd References: <1490007402-30265-1-git-send-email-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 Move code for DMA memory configuration with IOMMU into separate function to make it easier to compare what is being done in each case. Signed-off-by: Marek Szyprowski Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Acked-by: Andrzej Hajda Tested-by: Smitha T Murthy --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 102 ++++++++++++++++++------------- 1 file changed, 61 insertions(+), 41 deletions(-) -- 1.9.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/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 16f4ba4f25ee..ff3bb8af2423 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1102,44 +1102,15 @@ static struct device *s5p_mfc_alloc_memdev(struct device *dev, return NULL; } -static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) +static int s5p_mfc_configure_2port_memory(struct s5p_mfc_dev *mfc_dev) { struct device *dev = &mfc_dev->plat_dev->dev; void *bank2_virt; dma_addr_t bank2_dma_addr; unsigned long align_size = 1 << MFC_BASE_ALIGN_ORDER; - struct s5p_mfc_priv_buf *fw_buf = &mfc_dev->fw_buf; int ret; /* - * When IOMMU is available, we cannot use the default configuration, - * because of MFC firmware requirements: address space limited to - * 256M and non-zero default start address. - * This is still simplified, not optimal configuration, but for now - * IOMMU core doesn't allow to configure device's IOMMUs channel - * separately. - */ - if (exynos_is_iommu_available(dev)) { - int ret = exynos_configure_iommu(dev, S5P_MFC_IOMMU_DMA_BASE, - S5P_MFC_IOMMU_DMA_SIZE); - if (ret) - return ret; - - mfc_dev->mem_dev[BANK1_CTX] = mfc_dev->mem_dev[BANK2_CTX] = dev; - ret = s5p_mfc_alloc_firmware(mfc_dev); - if (ret) { - exynos_unconfigure_iommu(dev); - return ret; - } - - mfc_dev->dma_base[BANK1_CTX] = fw_buf->dma; - mfc_dev->dma_base[BANK2_CTX] = fw_buf->dma; - vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32)); - - return 0; - } - - /* * Create and initialize virtual devices for accessing * reserved memory regions. */ @@ -1162,7 +1133,7 @@ static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) return ret; } - mfc_dev->dma_base[BANK1_CTX] = fw_buf->dma; + mfc_dev->dma_base[BANK1_CTX] = mfc_dev->fw_buf.dma; bank2_virt = dma_alloc_coherent(mfc_dev->mem_dev[BANK2_CTX], align_size, &bank2_dma_addr, GFP_KERNEL); @@ -1191,22 +1162,71 @@ static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) return 0; } -static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) +static void s5p_mfc_unconfigure_2port_memory(struct s5p_mfc_dev *mfc_dev) { - struct device *dev = &mfc_dev->plat_dev->dev; + device_unregister(mfc_dev->mem_dev[BANK1_CTX]); + device_unregister(mfc_dev->mem_dev[BANK2_CTX]); + vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK1_CTX]); + vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK2_CTX]); +} - s5p_mfc_release_firmware(mfc_dev); +static int s5p_mfc_configure_common_memory(struct s5p_mfc_dev *mfc_dev) +{ + struct device *dev = &mfc_dev->plat_dev->dev; + /* + * When IOMMU is available, we cannot use the default configuration, + * because of MFC firmware requirements: address space limited to + * 256M and non-zero default start address. + * This is still simplified, not optimal configuration, but for now + * IOMMU core doesn't allow to configure device's IOMMUs channel + * separately. + */ + int ret = exynos_configure_iommu(dev, S5P_MFC_IOMMU_DMA_BASE, + S5P_MFC_IOMMU_DMA_SIZE); + if (ret) + return ret; - if (exynos_is_iommu_available(dev)) { + mfc_dev->mem_dev[BANK1_CTX] = mfc_dev->mem_dev[BANK2_CTX] = dev; + ret = s5p_mfc_alloc_firmware(mfc_dev); + if (ret) { exynos_unconfigure_iommu(dev); - vb2_dma_contig_clear_max_seg_size(dev); - return; + return ret; } - device_unregister(mfc_dev->mem_dev[BANK1_CTX]); - device_unregister(mfc_dev->mem_dev[BANK2_CTX]); - vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK1_CTX]); - vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK2_CTX]); + mfc_dev->dma_base[BANK1_CTX] = mfc_dev->fw_buf.dma; + mfc_dev->dma_base[BANK2_CTX] = mfc_dev->fw_buf.dma; + vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32)); + + return 0; +} + +static void s5p_mfc_unconfigure_common_memory(struct s5p_mfc_dev *mfc_dev) +{ + struct device *dev = &mfc_dev->plat_dev->dev; + + exynos_unconfigure_iommu(dev); + vb2_dma_contig_clear_max_seg_size(dev); +} + +static int s5p_mfc_configure_dma_memory(struct s5p_mfc_dev *mfc_dev) +{ + struct device *dev = &mfc_dev->plat_dev->dev; + + if (exynos_is_iommu_available(dev)) + return s5p_mfc_configure_common_memory(mfc_dev); + else + return s5p_mfc_configure_2port_memory(mfc_dev); +} + +static void s5p_mfc_unconfigure_dma_memory(struct s5p_mfc_dev *mfc_dev) +{ + struct device *dev = &mfc_dev->plat_dev->dev; + + s5p_mfc_release_firmware(mfc_dev); + if (exynos_is_iommu_available(dev)) + s5p_mfc_unconfigure_common_memory(mfc_dev); + else + s5p_mfc_unconfigure_2port_memory(mfc_dev); } /* MFC probe function */ From patchwork Mon Mar 20 10:56:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95503 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp881845qgd; Mon, 20 Mar 2017 03:59:27 -0700 (PDT) X-Received: by 10.98.194.88 with SMTP id l85mr31180817pfg.55.1490007567367; Mon, 20 Mar 2017 03:59:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a95si17131711pli.38.2017.03.20.03.59.27; Mon, 20 Mar 2017 03:59: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753422AbdCTK7C (ORCPT + 4 others); Mon, 20 Mar 2017 06:59:02 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:30564 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753676AbdCTK5S (ORCPT ); Mon, 20 Mar 2017 06:57:18 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON400EHG12VLE20@mailout3.w1.samsung.com>; Mon, 20 Mar 2017 10:56:55 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105654eucas1p2c7cca84d61a1554ed4850f0453405ed0~tkdldL-BD2733327333eucas1p29; Mon, 20 Mar 2017 10:56:54 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 8D.7B.17477.675BFC85; Mon, 20 Mar 2017 10:56:54 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105653eucas1p20276c75ba618fbed0e70a78fc14394f8~tkdkmuEzE2242222422eucas1p2M; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-7d-58cfb576c0ee Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 24.E7.06687.FD5BFC85; Mon, 20 Mar 2017 10:58:39 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:53 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 12/16] media: s5p-mfc: Add support for probe-time preallocated block based allocator Date: Mon, 20 Mar 2017 11:56:38 +0100 Message-id: <1490007402-30265-13-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrCIsWRmVeSWpSXmKPExsWy7djPc7plW89HGPxbzGtxa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDmKyyYl NSezLLVI3y6BK+PrxaWMBbvsK3p2X2BrYPxk0sXIySEhYCJx+sQhdghbTOLCvfVsXYxcHEIC SxklLl46wQzhfGaUeLh/NVAVB1jHmY3mEPFljBJn5myCKmpgkrgz6wczyCg2AUOJrrddbCC2 iICTxMJZf9lBipgFvjNKfNt9mhUkISyQKXGhZwdYEYuAqsSyV2fAbF4BT4lZPy+xQtwkJ3Hy 2GQwmxMo/uL6X7D7JARes0lc7bsMdZKsxKYDzBD1LhJ3r12HsoUlXh3fAvWbjERnx0EmCLuf UaKpVRvCnsEoce4tL4RtLXH4+EWwXcwCfBKTtk1nhhjPK9HRJgRR4iHx+OEqNgjbUWLFyves EM/PYZTYO2kZ6wRGmQWMDKsYRVJLi3PTU4tN9YoTc4tL89L1kvNzNzEC4/b0v+NfdzAuPWZ1 iFGAg1GJh9fg6rkIIdbEsuLK3EOMEhzMSiK8H+eejxDiTUmsrEotyo8vKs1JLT7EKM3BoiTO u2fBlXAhgfTEktTs1NSC1CKYLBMHp1QD49LzmkphQmXnyy5Pqv0neNlYY6Y434sKli0KpuE3 7gkpfFb+11by8dh6rxmTb6ie9Jx+vs3keXL367V+ZXL5W/dfncaU/XGdgvakRpGVM25lKJVv 6GVYxn5n3pPCBVOOLdPIPhpSMXfO9nsVZXNfLw09vapgmWa32m59Rsk/h75X1JucdC+cP0WJ pTgj0VCLuag4EQCpX8NH1wIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRmVeSWpSXmKPExsVy+t/xa7r3t56PMFjZIWVxa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDnKzSYj NTEltUghNS85PyUzL91WKTTETddCSSEvMTfVVilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJ bhlfLy5lLNhlX9Gz+wJbA+Mnky5GDg4JAROJMxvNuxg5gUwxiQv31rN1MXJxCAksYZT4fu0n E4TTxCRxdGUvG0gVm4ChRNfbLjBbRMBJYuGsv+wgNrPAd0aJZTfTQGxhgUyJCz07wGpYBFQl lr06A2bzCnhKzPp5iRVim5zEyWOTwWxOoPiL63/BaoQEPCTWfZ7INIGRdwEjwypGkdTS4tz0 3GJDveLE3OLSvHS95PzcTYzAAN527OfmHYyXNgYfYhTgYFTi4TW4ei5CiDWxrLgy9xCjBAez kgjvx7nnI4R4UxIrq1KL8uOLSnNSiw8xmgIdNZFZSjQ5HxhdeSXxhiaG5paGRsYWFuZGRkri vCUfroQLCaQnlqRmp6YWpBbB9DFxcEo1MJafvhN4/uwBVgmt+dfVqiXyzs8ttUo9nvVr8+zq lBXLbjNmLbe+Va3X87hdk3Hh9ieTpO78jxf/P9OyONRpzr4akSP3mUWj3yj9VFt5hv3gRrbX d+ZxzJqgl7WYdyZTm2pyvrWlqouWv//lekWfFaVf9HjvP13B8kr/1MKeKeVn/mevnjSvIFOJ pTgj0VCLuag4EQBYKzLrdgIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105653eucas1p20276c75ba618fbed0e70a78fc14394f8 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320105653eucas1p20276c75ba618fbed0e70a78fc14394f8 X-RootMTR: 20170320105653eucas1p20276c75ba618fbed0e70a78fc14394f8 References: <1490007402-30265-1-git-send-email-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 Current MFC driver depends on the fact that when IOMMU is available, the DMA-mapping framework and its IOMMU glue will use first-fit allocator. This was true for ARM architecture, but its not for ARM64 arch. However, in case of MFC v6+ hardware and latest firmware, it turned out that there is no strict requirement for ALL buffers to be allocated on higher addresses than the firmware base. This requirement is true only for the device and per-context buffers. All video data buffers can be allocated anywhere for all MFC v6+ versions. Such relaxed requirements for the memory buffers can be easily fulfilled by allocating firmware, device and per-context buffers from the probe-time preallocated larger buffer. This patch adds support for it. This way the driver finally works fine on ARM64 architecture. The size of the preallocated buffer is 8 MiB, what is enough for three instances H264 decoders or encoders (other codecs have smaller memory requirements). If one needs more for particular use case, one can use "mem" module parameter to force larger (or smaller) buffer (for example by adding "s5p_mfc.mem=16M" to kernel command line). Signed-off-by: Marek Szyprowski Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Acked-by: Andrzej Hajda Tested-by: Smitha T Murthy --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 43 ++++++++++++++++--- drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 4 ++ drivers/media/platform/s5p-mfc/s5p_mfc_opr.c | 57 ++++++++++++++++--------- 3 files changed, 79 insertions(+), 25 deletions(-) -- 1.9.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/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index ff3bb8af2423..ea01d0aa8303 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -43,6 +43,10 @@ module_param_named(debug, mfc_debug_level, int, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(debug, "Debug level - higher value produces more verbose messages"); +static char *mfc_mem_size = NULL; +module_param_named(mem, mfc_mem_size, charp, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(mem, "Preallocated memory size for the firmware and context buffers"); + /* Helper functions for interrupt processing */ /* Remove from hw execution round robin */ @@ -1173,6 +1177,8 @@ static void s5p_mfc_unconfigure_2port_memory(struct s5p_mfc_dev *mfc_dev) static int s5p_mfc_configure_common_memory(struct s5p_mfc_dev *mfc_dev) { struct device *dev = &mfc_dev->plat_dev->dev; + unsigned long mem_size = SZ_8M; + unsigned int bitmap_size; /* * When IOMMU is available, we cannot use the default configuration, * because of MFC firmware requirements: address space limited to @@ -1186,17 +1192,39 @@ static int s5p_mfc_configure_common_memory(struct s5p_mfc_dev *mfc_dev) if (ret) return ret; - mfc_dev->mem_dev[BANK1_CTX] = mfc_dev->mem_dev[BANK2_CTX] = dev; - ret = s5p_mfc_alloc_firmware(mfc_dev); - if (ret) { + if (mfc_mem_size) + mem_size = memparse(mfc_mem_size, NULL); + + bitmap_size = BITS_TO_LONGS(mem_size >> PAGE_SHIFT) * sizeof(long); + + mfc_dev->mem_bitmap = kzalloc(bitmap_size, GFP_KERNEL); + if (!mfc_dev->mem_bitmap) { exynos_unconfigure_iommu(dev); - return ret; + return -ENOMEM; } - mfc_dev->dma_base[BANK1_CTX] = mfc_dev->fw_buf.dma; - mfc_dev->dma_base[BANK2_CTX] = mfc_dev->fw_buf.dma; + mfc_dev->mem_virt = dma_alloc_coherent(dev, mem_size, + &mfc_dev->mem_base, GFP_KERNEL); + if (!mfc_dev->mem_virt) { + kfree(mfc_dev->mem_bitmap); + dev_err(dev, "failed to preallocate %ld MiB for the firmware and context buffers\n", + (mem_size / SZ_1M)); + exynos_unconfigure_iommu(dev); + return -ENOMEM; + } + mfc_dev->mem_size = mem_size; + mfc_dev->dma_base[BANK1_CTX] = mfc_dev->mem_base; + mfc_dev->dma_base[BANK2_CTX] = mfc_dev->mem_base; + + /* Firmware allocation cannot fail in this case */ + s5p_mfc_alloc_firmware(mfc_dev); + + mfc_dev->mem_dev[BANK1_CTX] = mfc_dev->mem_dev[BANK2_CTX] = dev; vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32)); + dev_info(dev, "preallocated %ld MiB buffer for the firmware and context buffers\n", + (mem_size / SZ_1M)); + return 0; } @@ -1205,6 +1233,9 @@ static void s5p_mfc_unconfigure_common_memory(struct s5p_mfc_dev *mfc_dev) struct device *dev = &mfc_dev->plat_dev->dev; exynos_unconfigure_iommu(dev); + dma_free_coherent(dev, mfc_dev->mem_size, mfc_dev->mem_virt, + mfc_dev->mem_base); + kfree(mfc_dev->mem_bitmap); vb2_dma_contig_clear_max_seg_size(dev); } diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index cea17a737ef7..e64dc6e3c75e 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -315,6 +315,10 @@ struct s5p_mfc_dev { unsigned int int_err; wait_queue_head_t queue; struct s5p_mfc_priv_buf fw_buf; + size_t mem_size; + dma_addr_t mem_base; + unsigned long *mem_bitmap; + void *mem_virt; dma_addr_t dma_base[BANK_CTX_NUM]; unsigned long hw_lock; struct s5p_mfc_ctx *ctx[MFC_NUM_CONTEXTS]; diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr.c index 9294ee124661..34a66189d980 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr.c @@ -40,41 +40,60 @@ void s5p_mfc_init_regs(struct s5p_mfc_dev *dev) int s5p_mfc_alloc_priv_buf(struct s5p_mfc_dev *dev, unsigned int mem_ctx, struct s5p_mfc_priv_buf *b) { - struct device *mem_dev = dev->mem_dev[mem_ctx]; - dma_addr_t base = dev->dma_base[mem_ctx]; + unsigned int bits = dev->mem_size >> PAGE_SHIFT; + unsigned int count = b->size >> PAGE_SHIFT; + unsigned int align = (SZ_64K >> PAGE_SHIFT) - 1; + unsigned int start, offset; mfc_debug(3, "Allocating priv: %zu\n", b->size); - b->ctx = mem_ctx; - b->virt = dma_alloc_coherent(mem_dev, b->size, &b->dma, GFP_KERNEL); + if (dev->mem_virt) { + start = bitmap_find_next_zero_area(dev->mem_bitmap, bits, 0, count, align); + if (start > bits) + goto no_mem; - if (!b->virt) { - mfc_err("Allocating private buffer of size %zu failed\n", - b->size); - return -ENOMEM; - } + bitmap_set(dev->mem_bitmap, start, count); + offset = start << PAGE_SHIFT; + b->virt = dev->mem_virt + offset; + b->dma = dev->mem_base + offset; + } else { + struct device *mem_dev = dev->mem_dev[mem_ctx]; + dma_addr_t base = dev->dma_base[mem_ctx]; - if (b->dma < base) { - mfc_err("Invalid memory configuration - buffer (%pad) is below base memory address(%pad)\n", - &b->dma, &base); - dma_free_coherent(mem_dev, b->size, b->virt, b->dma); - return -ENOMEM; + b->ctx = mem_ctx; + b->virt = dma_alloc_coherent(mem_dev, b->size, &b->dma, GFP_KERNEL); + if (!b->virt) + goto no_mem; + if (b->dma < base) { + mfc_err("Invalid memory configuration - buffer (%pad) is below base memory address(%pad)\n", + &b->dma, &base); + dma_free_coherent(mem_dev, b->size, b->virt, b->dma); + return -ENOMEM; + } } mfc_debug(3, "Allocated addr %p %pad\n", b->virt, &b->dma); return 0; +no_mem: + mfc_err("Allocating private buffer of size %zu failed\n", b->size); + return -ENOMEM; } void s5p_mfc_release_priv_buf(struct s5p_mfc_dev *dev, struct s5p_mfc_priv_buf *b) { - struct device *mem_dev = dev->mem_dev[b->ctx]; + if (dev->mem_virt) { + unsigned int start = (b->dma - dev->mem_base) >> PAGE_SHIFT; + unsigned int count = b->size >> PAGE_SHIFT; + + bitmap_clear(dev->mem_bitmap, start, count); + } else { + struct device *mem_dev = dev->mem_dev[b->ctx]; - if (b->virt) { dma_free_coherent(mem_dev, b->size, b->virt, b->dma); - b->virt = NULL; - b->dma = 0; - b->size = 0; } + b->virt = NULL; + b->dma = 0; + b->size = 0; } From patchwork Mon Mar 20 10:56:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95510 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp882305qgd; Mon, 20 Mar 2017 04:00:36 -0700 (PDT) X-Received: by 10.98.200.19 with SMTP id z19mr32638638pff.223.1490007636526; Mon, 20 Mar 2017 04:00:36 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n26si17049412pge.228.2017.03.20.04.00.36; Mon, 20 Mar 2017 04:00:36 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754222AbdCTLAb (ORCPT + 4 others); Mon, 20 Mar 2017 07:00:31 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:27549 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753578AbdCTK5N (ORCPT ); Mon, 20 Mar 2017 06:57:13 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON400DNK12VCF20@mailout2.w1.samsung.com>; Mon, 20 Mar 2017 10:56:56 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105655eucas1p2e02f7a2cdc00115b2557de3c1748fb3c~tkdmZSAxX0928709287eucas1p2j; Mon, 20 Mar 2017 10:56:55 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id B3.BD.28517.775BFC85; Mon, 20 Mar 2017 10:56:55 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105654eucas1p26e4fb044e6b814d4a349f2d2831076d7~tkdlwxZK32733227332eucas1p28; Mon, 20 Mar 2017 10:56:54 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-39-58cfb577f760 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 86.E7.06687.0E5BFC85; Mon, 20 Mar 2017 10:58:40 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:54 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 15/16] media: s5p-mfc: Rename BANK1/2 to BANK_L/R to better match documentation Date: Mon, 20 Mar 2017 11:56:41 +0100 Message-id: <1490007402-30265-16-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsWy7djP87rlW89HGDy6w2txa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDmKyyYl NSezLLVI3y6BK+P9/9nsBVNrKva+fcDYwHgqs4uRk0NCwETi+ZtHrBC2mMSFe+vZuhi5OIQE ljJKzD93iBnC+cwocffbN0aYjk/zPjBBJJYxSlzctRDKaWCSOHp6NRtIFZuAoUTX2y4wW0TA SWLhrL/sIEXMAt8ZJb7tPg22UFggReLJ6icsIDaLgKpEw66HYA28Ap4Sh54sYoNYJydx8thk sHpOoPiL63/BDpQQeM0mMfvvUaBmDiBHVmLTAWaIeheJiROuQtnCEq+Ob2GHsGUkOjsOMkHY /YwSTa3aEPYMRolzb3khbGuJw8cvgu1iFuCTmLRtOjPEeF6JjjYhiBIPiV0H17BA2I4SC569 ggbRHEaJFZd3sk9glFnAyLCKUSS1tDg3PbXYRK84Mbe4NC9dLzk/dxMjMHJP/zv+ZQfj4mNW hxgFOBiVeHhvXDoXIcSaWFZcmXuIUYKDWUmE9+Pc8xFCvCmJlVWpRfnxRaU5qcWHGKU5WJTE efcsuBIuJJCeWJKanZpakFoEk2Xi4JRqYIxjWCGoquBnZyuSvs/fIrRUeV91om5s2bETzicT ZnGtXLSdN1bZMjTA8VX6zUfbGJaZFjU9Fz3nu/XBVYlXvnL3b9Z9Kt1tz1LVN2XKq775AgG+ 58I0g7ii/JpfzpKbovMr2Wjn5b3G5QuOaz8PWR/92fDXw9Tec8sZctsVunlyrm8+PedLuxJL cUaioRZzUXEiACsU02rYAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsVy+t/xa7oPtp6PMPjwSMPi1rpzrBaT7k9g sTh/fgO7Rc+GrawWM87vY7JYe+Quu8XhN+1A7uSXbA4cHptWdbJ59G1ZxejxeZNcAHOUm01G amJKapFCal5yfkpmXrqtUmiIm66FkkJeYm6qrVKErm9IkJJCWWJOKZBnZIAGHJwD3IOV9O0S 3DLe/5/NXjC1pmLv2weMDYynMrsYOTkkBEwkPs37wARhi0lcuLeerYuRi0NIYAmjxI0Lbxkh nCYmidZ3P5lBqtgEDCW63naxgdgiAk4SC2f9ZQexmQW+M0osu5kGYgsLpEhsXNjNCGKzCKhK NOx6CFbPK+ApcejJIjaIbXISJ49NZgWxOYHiL67/BYsLCXhIrPs8kWkCI+8CRoZVjCKppcW5 6bnFhnrFibnFpXnpesn5uZsYgSG87djPzTsYL20MPsQowMGoxMNrcPVchBBrYllxZe4hRgkO ZiUR3o9zz0cI8aYkVlalFuXHF5XmpBYfYjQFOmois5Rocj4wvvJK4g1NDM0tDY2MLSzMjYyU xHlLPlwJFxJITyxJzU5NLUgtgulj4uCUamA0Lol9tTP2dMKnxYmxq32be6xXh934qXT+Tqak 4Xp3Tr6ZM4pTvWTa0/Z+8Ppkyh59OXeaz/xD/68cq6m7otWw4DxDxwztMq4JP46fnWWSeGl1 qfz54wINUl8lmLVe3qlwe5u0tLfop3jxS87Cmje//kjuaRRn3jZhmmBHwZztO62eXtydYrNa iaU4I9FQi7moOBEAQZ0E8XcCAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105654eucas1p26e4fb044e6b814d4a349f2d2831076d7 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320105654eucas1p26e4fb044e6b814d4a349f2d2831076d7 X-RootMTR: 20170320105654eucas1p26e4fb044e6b814d4a349f2d2831076d7 References: <1490007402-30265-1-git-send-email-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 Documentation for MFC hardware still uses 'left' and 'right' names for the memory channel/banks, so replace BANK1/2 defines with more appropriate BANK_L/R names. Suggested-by: Shuah Khan Signed-off-by: Marek Szyprowski --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 54 ++++++++++++------------- drivers/media/platform/s5p-mfc/s5p_mfc_common.h | 4 +- drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c | 13 +++--- drivers/media/platform/s5p-mfc/s5p_mfc_dec.c | 8 ++-- drivers/media/platform/s5p-mfc/s5p_mfc_enc.c | 10 ++--- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c | 28 ++++++------- drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c | 6 +-- 7 files changed, 62 insertions(+), 61 deletions(-) -- 1.9.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/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index a56031c3263e..dc1f6a96877a 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1118,34 +1118,34 @@ static int s5p_mfc_configure_2port_memory(struct s5p_mfc_dev *mfc_dev) * Create and initialize virtual devices for accessing * reserved memory regions. */ - mfc_dev->mem_dev[BANK1_CTX] = s5p_mfc_alloc_memdev(dev, "left", - BANK1_CTX); - if (!mfc_dev->mem_dev[BANK1_CTX]) + mfc_dev->mem_dev[BANK_L_CTX] = s5p_mfc_alloc_memdev(dev, "left", + BANK_L_CTX); + if (!mfc_dev->mem_dev[BANK_L_CTX]) return -ENODEV; - mfc_dev->mem_dev[BANK2_CTX] = s5p_mfc_alloc_memdev(dev, "right", - BANK2_CTX); - if (!mfc_dev->mem_dev[BANK2_CTX]) { - device_unregister(mfc_dev->mem_dev[BANK1_CTX]); + mfc_dev->mem_dev[BANK_R_CTX] = s5p_mfc_alloc_memdev(dev, "right", + BANK_R_CTX); + if (!mfc_dev->mem_dev[BANK_R_CTX]) { + device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); return -ENODEV; } /* Allocate memory for firmware and initialize both banks addresses */ ret = s5p_mfc_alloc_firmware(mfc_dev); if (ret) { - device_unregister(mfc_dev->mem_dev[BANK2_CTX]); - device_unregister(mfc_dev->mem_dev[BANK1_CTX]); + device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); + device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); return ret; } - mfc_dev->dma_base[BANK1_CTX] = mfc_dev->fw_buf.dma; + mfc_dev->dma_base[BANK_L_CTX] = mfc_dev->fw_buf.dma; - bank2_virt = dma_alloc_coherent(mfc_dev->mem_dev[BANK2_CTX], align_size, - &bank2_dma_addr, GFP_KERNEL); + bank2_virt = dma_alloc_coherent(mfc_dev->mem_dev[BANK_R_CTX], + align_size, &bank2_dma_addr, GFP_KERNEL); if (!bank2_virt) { mfc_err("Allocating bank2 base failed\n"); s5p_mfc_release_firmware(mfc_dev); - device_unregister(mfc_dev->mem_dev[BANK2_CTX]); - device_unregister(mfc_dev->mem_dev[BANK1_CTX]); + device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); + device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); return -ENOMEM; } @@ -1153,14 +1153,14 @@ static int s5p_mfc_configure_2port_memory(struct s5p_mfc_dev *mfc_dev) * should not have address of bank2 - MFC will treat it as a null frame. * To avoid such situation we set bank2 address below the pool address. */ - mfc_dev->dma_base[BANK2_CTX] = bank2_dma_addr - align_size; + mfc_dev->dma_base[BANK_R_CTX] = bank2_dma_addr - align_size; - dma_free_coherent(mfc_dev->mem_dev[BANK2_CTX], align_size, bank2_virt, + dma_free_coherent(mfc_dev->mem_dev[BANK_R_CTX], align_size, bank2_virt, bank2_dma_addr); - vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK1_CTX], + vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK_L_CTX], DMA_BIT_MASK(32)); - vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK2_CTX], + vb2_dma_contig_set_max_seg_size(mfc_dev->mem_dev[BANK_R_CTX], DMA_BIT_MASK(32)); return 0; @@ -1168,10 +1168,10 @@ static int s5p_mfc_configure_2port_memory(struct s5p_mfc_dev *mfc_dev) static void s5p_mfc_unconfigure_2port_memory(struct s5p_mfc_dev *mfc_dev) { - device_unregister(mfc_dev->mem_dev[BANK1_CTX]); - device_unregister(mfc_dev->mem_dev[BANK2_CTX]); - vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK1_CTX]); - vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK2_CTX]); + device_unregister(mfc_dev->mem_dev[BANK_L_CTX]); + device_unregister(mfc_dev->mem_dev[BANK_R_CTX]); + vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK_L_CTX]); + vb2_dma_contig_clear_max_seg_size(mfc_dev->mem_dev[BANK_R_CTX]); } static int s5p_mfc_configure_common_memory(struct s5p_mfc_dev *mfc_dev) @@ -1201,8 +1201,8 @@ static int s5p_mfc_configure_common_memory(struct s5p_mfc_dev *mfc_dev) return -ENOMEM; } mfc_dev->mem_size = mem_size; - mfc_dev->dma_base[BANK1_CTX] = mfc_dev->mem_base; - mfc_dev->dma_base[BANK2_CTX] = mfc_dev->mem_base; + mfc_dev->dma_base[BANK_L_CTX] = mfc_dev->mem_base; + mfc_dev->dma_base[BANK_R_CTX] = mfc_dev->mem_base; /* * MFC hardware cannot handle 0 as a base address, so mark first 128K @@ -1212,14 +1212,14 @@ static int s5p_mfc_configure_common_memory(struct s5p_mfc_dev *mfc_dev) unsigned int offset = 1 << MFC_BASE_ALIGN_ORDER; bitmap_set(mfc_dev->mem_bitmap, 0, offset >> PAGE_SHIFT); - mfc_dev->dma_base[BANK1_CTX] += offset; - mfc_dev->dma_base[BANK2_CTX] += offset; + mfc_dev->dma_base[BANK_L_CTX] += offset; + mfc_dev->dma_base[BANK_R_CTX] += offset; } /* Firmware allocation cannot fail in this case */ s5p_mfc_alloc_firmware(mfc_dev); - mfc_dev->mem_dev[BANK1_CTX] = mfc_dev->mem_dev[BANK2_CTX] = dev; + mfc_dev->mem_dev[BANK_L_CTX] = mfc_dev->mem_dev[BANK_R_CTX] = dev; vb2_dma_contig_set_max_seg_size(dev, DMA_BIT_MASK(32)); dev_info(dev, "preallocated %ld MiB buffer for the firmware and context buffers\n", diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h index e64dc6e3c75e..4220914529b2 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_common.h +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_common.h @@ -33,8 +33,8 @@ * while mmaping */ #define DST_QUEUE_OFF_BASE (1 << 30) -#define BANK1_CTX 0 -#define BANK2_CTX 1 +#define BANK_L_CTX 0 +#define BANK_R_CTX 1 #define BANK_CTX_NUM 2 #define MFC_BANK1_ALIGN_ORDER 13 diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c index a1811ee538bd..69ef9c23a99a 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c @@ -36,7 +36,7 @@ int s5p_mfc_alloc_firmware(struct s5p_mfc_dev *dev) return -ENOMEM; } - err = s5p_mfc_alloc_priv_buf(dev, BANK1_CTX, &dev->fw_buf); + err = s5p_mfc_alloc_priv_buf(dev, BANK_L_CTX, &dev->fw_buf); if (err) { mfc_err("Allocating bitprocessor buffer failed\n"); return err; @@ -177,17 +177,18 @@ int s5p_mfc_reset(struct s5p_mfc_dev *dev) static inline void s5p_mfc_init_memctrl(struct s5p_mfc_dev *dev) { if (IS_MFCV6_PLUS(dev)) { - mfc_write(dev, dev->dma_base[BANK1_CTX], + mfc_write(dev, dev->dma_base[BANK_L_CTX], S5P_FIMV_RISC_BASE_ADDRESS_V6); mfc_debug(2, "Base Address : %pad\n", - &dev->dma_base[BANK1_CTX]); + &dev->dma_base[BANK_L_CTX]); } else { - mfc_write(dev, dev->dma_base[BANK1_CTX], + mfc_write(dev, dev->dma_base[BANK_L_CTX], S5P_FIMV_MC_DRAMBASE_ADR_A); - mfc_write(dev, dev->dma_base[BANK2_CTX], + mfc_write(dev, dev->dma_base[BANK_R_CTX], S5P_FIMV_MC_DRAMBASE_ADR_B); mfc_debug(2, "Bank1: %pad, Bank2: %pad\n", - &dev->dma_base[BANK1_CTX], &dev->dma_base[BANK2_CTX]); + &dev->dma_base[BANK_L_CTX], + &dev->dma_base[BANK_R_CTX]); } } diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c index f17062f9070b..8937b0af7cb3 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_dec.c @@ -931,14 +931,14 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq, psize[1] = ctx->chroma_size; if (IS_MFCV6_PLUS(dev)) - alloc_devs[0] = ctx->dev->mem_dev[BANK1_CTX]; + alloc_devs[0] = ctx->dev->mem_dev[BANK_L_CTX]; else - alloc_devs[0] = ctx->dev->mem_dev[BANK2_CTX]; - alloc_devs[1] = ctx->dev->mem_dev[BANK1_CTX]; + alloc_devs[0] = ctx->dev->mem_dev[BANK_R_CTX]; + alloc_devs[1] = ctx->dev->mem_dev[BANK_L_CTX]; } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && ctx->state == MFCINST_INIT) { psize[0] = ctx->dec_src_buf_size; - alloc_devs[0] = ctx->dev->mem_dev[BANK1_CTX]; + alloc_devs[0] = ctx->dev->mem_dev[BANK_L_CTX]; } else { mfc_err("This video node is dedicated to decoding. Decoding not initialized\n"); return -EINVAL; diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c index 2eea21f06d7e..2a5fd7c42cd5 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_enc.c @@ -1832,7 +1832,7 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq, if (*buf_count > MFC_MAX_BUFFERS) *buf_count = MFC_MAX_BUFFERS; psize[0] = ctx->enc_dst_buf_size; - alloc_devs[0] = ctx->dev->mem_dev[BANK1_CTX]; + alloc_devs[0] = ctx->dev->mem_dev[BANK_L_CTX]; } else if (vq->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) { if (ctx->src_fmt) *plane_count = ctx->src_fmt->num_planes; @@ -1848,11 +1848,11 @@ static int s5p_mfc_queue_setup(struct vb2_queue *vq, psize[1] = ctx->chroma_size; if (IS_MFCV6_PLUS(dev)) { - alloc_devs[0] = ctx->dev->mem_dev[BANK1_CTX]; - alloc_devs[1] = ctx->dev->mem_dev[BANK1_CTX]; + alloc_devs[0] = ctx->dev->mem_dev[BANK_L_CTX]; + alloc_devs[1] = ctx->dev->mem_dev[BANK_L_CTX]; } else { - alloc_devs[0] = ctx->dev->mem_dev[BANK2_CTX]; - alloc_devs[1] = ctx->dev->mem_dev[BANK2_CTX]; + alloc_devs[0] = ctx->dev->mem_dev[BANK_R_CTX]; + alloc_devs[1] = ctx->dev->mem_dev[BANK_R_CTX]; } } else { mfc_err("invalid queue type: %d\n", vq->type); diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c index 20e8a1bdc984..b41ee608c171 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c @@ -30,8 +30,8 @@ #include #include -#define OFFSETA(x) (((x) - dev->dma_base[BANK1_CTX]) >> MFC_OFFSET_SHIFT) -#define OFFSETB(x) (((x) - dev->dma_base[BANK2_CTX]) >> MFC_OFFSET_SHIFT) +#define OFFSETA(x) (((x) - dev->dma_base[BANK_L_CTX]) >> MFC_OFFSET_SHIFT) +#define OFFSETB(x) (((x) - dev->dma_base[BANK_R_CTX]) >> MFC_OFFSET_SHIFT) /* Allocate temporary buffers for decoding */ static int s5p_mfc_alloc_dec_temp_buffers_v5(struct s5p_mfc_ctx *ctx) @@ -41,7 +41,7 @@ static int s5p_mfc_alloc_dec_temp_buffers_v5(struct s5p_mfc_ctx *ctx) int ret; ctx->dsc.size = buf_size->dsc; - ret = s5p_mfc_alloc_priv_buf(dev, BANK1_CTX, &ctx->dsc); + ret = s5p_mfc_alloc_priv_buf(dev, BANK_L_CTX, &ctx->dsc); if (ret) { mfc_err("Failed to allocate temporary buffer\n"); return ret; @@ -172,7 +172,7 @@ static int s5p_mfc_alloc_codec_buffers_v5(struct s5p_mfc_ctx *ctx) /* Allocate only if memory from bank 1 is necessary */ if (ctx->bank1.size > 0) { - ret = s5p_mfc_alloc_priv_buf(dev, BANK1_CTX, &ctx->bank1); + ret = s5p_mfc_alloc_priv_buf(dev, BANK_L_CTX, &ctx->bank1); if (ret) { mfc_err("Failed to allocate Bank1 temporary buffer\n"); return ret; @@ -181,7 +181,7 @@ static int s5p_mfc_alloc_codec_buffers_v5(struct s5p_mfc_ctx *ctx) } /* Allocate only if memory from bank 2 is necessary */ if (ctx->bank2.size > 0) { - ret = s5p_mfc_alloc_priv_buf(dev, BANK2_CTX, &ctx->bank2); + ret = s5p_mfc_alloc_priv_buf(dev, BANK_R_CTX, &ctx->bank2); if (ret) { mfc_err("Failed to allocate Bank2 temporary buffer\n"); s5p_mfc_release_priv_buf(ctx->dev, &ctx->bank1); @@ -212,7 +212,7 @@ static int s5p_mfc_alloc_instance_buffer_v5(struct s5p_mfc_ctx *ctx) else ctx->ctx.size = buf_size->non_h264_ctx; - ret = s5p_mfc_alloc_priv_buf(dev, BANK1_CTX, &ctx->ctx); + ret = s5p_mfc_alloc_priv_buf(dev, BANK_L_CTX, &ctx->ctx); if (ret) { mfc_err("Failed to allocate instance buffer\n"); return ret; @@ -225,7 +225,7 @@ static int s5p_mfc_alloc_instance_buffer_v5(struct s5p_mfc_ctx *ctx) /* Initialize shared memory */ ctx->shm.size = buf_size->shm; - ret = s5p_mfc_alloc_priv_buf(dev, BANK1_CTX, &ctx->shm); + ret = s5p_mfc_alloc_priv_buf(dev, BANK_L_CTX, &ctx->shm); if (ret) { mfc_err("Failed to allocate shared memory buffer\n"); s5p_mfc_release_priv_buf(dev, &ctx->ctx); @@ -233,7 +233,7 @@ static int s5p_mfc_alloc_instance_buffer_v5(struct s5p_mfc_ctx *ctx) } /* shared memory offset only keeps the offset from base (port a) */ - ctx->shm.ofs = ctx->shm.dma - dev->dma_base[BANK1_CTX]; + ctx->shm.ofs = ctx->shm.dma - dev->dma_base[BANK_L_CTX]; BUG_ON(ctx->shm.ofs & ((1 << MFC_BANK1_ALIGN_ORDER) - 1)); memset(ctx->shm.virt, 0, buf_size->shm); @@ -532,9 +532,9 @@ static void s5p_mfc_get_enc_frame_buffer_v5(struct s5p_mfc_ctx *ctx, { struct s5p_mfc_dev *dev = ctx->dev; - *y_addr = dev->dma_base[BANK2_CTX] + + *y_addr = dev->dma_base[BANK_R_CTX] + (mfc_read(dev, S5P_FIMV_ENCODED_Y_ADDR) << MFC_OFFSET_SHIFT); - *c_addr = dev->dma_base[BANK2_CTX] + + *c_addr = dev->dma_base[BANK_R_CTX] + (mfc_read(dev, S5P_FIMV_ENCODED_C_ADDR) << MFC_OFFSET_SHIFT); } @@ -1212,8 +1212,8 @@ static int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) } if (list_empty(&ctx->src_queue)) { /* send null frame */ - s5p_mfc_set_enc_frame_buffer_v5(ctx, dev->dma_base[BANK2_CTX], - dev->dma_base[BANK2_CTX]); + s5p_mfc_set_enc_frame_buffer_v5(ctx, dev->dma_base[BANK_R_CTX], + dev->dma_base[BANK_R_CTX]); src_mb = NULL; } else { src_mb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, @@ -1222,8 +1222,8 @@ static int s5p_mfc_run_enc_frame(struct s5p_mfc_ctx *ctx) if (src_mb->b->vb2_buf.planes[0].bytesused == 0) { /* send null frame */ s5p_mfc_set_enc_frame_buffer_v5(ctx, - dev->dma_base[BANK2_CTX], - dev->dma_base[BANK2_CTX]); + dev->dma_base[BANK_R_CTX], + dev->dma_base[BANK_R_CTX]); ctx->state = MFCINST_FINISHING; } else { src_y_addr = vb2_dma_contig_plane_dma_addr( diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c index 50cc9351d1af..70071a12db16 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_opr_v6.c @@ -239,7 +239,7 @@ static int s5p_mfc_alloc_codec_buffers_v6(struct s5p_mfc_ctx *ctx) /* Allocate only if memory from bank 1 is necessary */ if (ctx->bank1.size > 0) { - ret = s5p_mfc_alloc_priv_buf(dev, BANK1_CTX, &ctx->bank1); + ret = s5p_mfc_alloc_priv_buf(dev, BANK_L_CTX, &ctx->bank1); if (ret) { mfc_err("Failed to allocate Bank1 memory\n"); return ret; @@ -291,7 +291,7 @@ static int s5p_mfc_alloc_instance_buffer_v6(struct s5p_mfc_ctx *ctx) break; } - ret = s5p_mfc_alloc_priv_buf(dev, BANK1_CTX, &ctx->ctx); + ret = s5p_mfc_alloc_priv_buf(dev, BANK_L_CTX, &ctx->ctx); if (ret) { mfc_err("Failed to allocate instance buffer\n"); return ret; @@ -320,7 +320,7 @@ static int s5p_mfc_alloc_dev_context_buffer_v6(struct s5p_mfc_dev *dev) mfc_debug_enter(); dev->ctx_buf.size = buf_size->dev_ctx; - ret = s5p_mfc_alloc_priv_buf(dev, BANK1_CTX, &dev->ctx_buf); + ret = s5p_mfc_alloc_priv_buf(dev, BANK_L_CTX, &dev->ctx_buf); if (ret) { mfc_err("Failed to allocate device context buffer\n"); return ret; From patchwork Mon Mar 20 10:56:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 95502 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp881841qgd; Mon, 20 Mar 2017 03:59:27 -0700 (PDT) X-Received: by 10.98.21.71 with SMTP id 68mr31917275pfv.16.1490007567059; Mon, 20 Mar 2017 03:59:27 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a95si17131711pli.38.2017.03.20.03.59.26; Mon, 20 Mar 2017 03:59: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753668AbdCTK7F (ORCPT + 4 others); Mon, 20 Mar 2017 06:59:05 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:30564 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753678AbdCTK5T (ORCPT ); Mon, 20 Mar 2017 06:57:19 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0ON400DK512WKL20@mailout3.w1.samsung.com>; Mon, 20 Mar 2017 10:56:56 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170320105656eucas1p102f778de6ad2378357dca51acbb1df58~tkdm4BF6i1780617806eucas1p1l; Mon, 20 Mar 2017 10:56:56 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id F9.FF.09557.775BFC85; Mon, 20 Mar 2017 10:56:55 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170320105655eucas1p21706c33b5c1b413126fbfd1e23a34058~tkdmN5VTo0928709287eucas1p2i; Mon, 20 Mar 2017 10:56:55 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-85-58cfb57725b8 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 47.E7.06687.1E5BFC85; Mon, 20 Mar 2017 10:58:41 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0ON4005OP12KYT20@eusync4.samsung.com>; Mon, 20 Mar 2017 10:56:55 +0000 (GMT) From: Marek Szyprowski To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Andrzej Hajda , Krzysztof Kozlowski , Inki Dae , Seung-Woo Kim Subject: [PATCH v3 16/16] ARM: dts: exynos: Remove MFC reserved buffers Date: Mon, 20 Mar 2017 11:56:42 +0100 Message-id: <1490007402-30265-17-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1490007402-30265-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEIsWRmVeSWpSXmKPExsWy7djPc7rlW89HGLw6rWtxa905VotJ9yew WJw/v4HdomfDVlaLGef3MVmsPXKX3eLwm3Ygd/JLNgcOj02rOtk8+rasYvT4vEkugDmKyyYl NSezLLVI3y6BK6PrXWjBJI2KB+2zmBoYG5W7GDk5JARMJLpeHGGCsMUkLtxbzwZiCwksZZRo eybcxcgFZH9mlPh+5xcLTMOrwxPZIRLLGCWONLSyQnQ0MEks3yMPYrMJGEp0ve0CmyQi4CSx cNZfsAZmge+MEt92nwZrEBZwl7i//xLYahYBVYmnex4ygti8Ap4S614+ZobYJidx8thksHpO oPiL63/ZQAZJCDxnk5ixcipQMweQIyux6QBUvYvEwq932CBsYYlXx7ewQ9gyEp0dB6He7GeU aGrVhrBnMEqce8sLYVtLHD5+EWwXswCfxKRt05khxvNKdLQJQZR4SHRv2gENCEeJ2W+usEAC Yg6jxKHOQ8wTGGUWMDKsYhRJLS3OTU8tNtYrTswtLs1L10vOz93ECIzZ0/+Of9rB+PWE1SFG AQ5GJR7eG5fORQixJpYVV+YeYpTgYFYS4f0493yEEG9KYmVValF+fFFpTmrxIUZpDhYlcd49 C66ECwmkJ5akZqemFqQWwWSZODilGhgnLLmevKpBPKf4SY8fM/e5ffdd3xyRcS5tVrb5kfLy stNTs3nX31zfdeBzZPzRFctTfofId/Dwzl2u/Tp5T/ndxMsqq2UTNrDaxa3ZvepAwoNXsoLB 3dy7FiwLNFlUyfIqMfn/r8KaiYo+jy13TFja9n2D/SKBjGiWVXFHVa2X6ORNPrVmt/BHJZbi jERDLeai4kQAEU8d5NUCAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRmVeSWpSXmKPExsVy+t/xa7oPt56PMNh2ktPi1rpzrBaT7k9g sTh/fgO7Rc+GrawWM87vY7JYe+Quu8XhN+1A7uSXbA4cHptWdbJ59G1ZxejxeZNcAHOUm01G amJKapFCal5yfkpmXrqtUmiIm66FkkJeYm6qrVKErm9IkJJCWWJOKZBnZIAGHJwD3IOV9O0S 3DK63oUWTNKoeNA+i6mBsVG5i5GTQ0LAROLV4YnsELaYxIV769m6GLk4hASWMErcun+aHcJp YpL4efYUG0gVm4ChRNfbLjBbRMBJYuGsv2DdzALfGSWW3UwDsYUF3CXu77/EBGKzCKhKPN3z kBHE5hXwlFj38jEzxDY5iZPHJrOC2JxA8RfX/4LNFBLwkFj3eSLTBEbeBYwMqxhFUkuLc9Nz iw31ihNzi0vz0vWS83M3MQIDeNuxn5t3MF7aGHyIUYCDUYmH1+DquQgh1sSy4srcQ4wSHMxK Irwf556PEOJNSaysSi3Kjy8qzUktPsRoCnTURGYp0eR8YHTllcQbmhiaWxoaGVtYmBsZKYnz lny4Ei4kkJ5YkpqdmlqQWgTTx8TBKdXAqNZor3ZBVufKqlkmPVWnDwlflprBzXApe5fx+uKb c7fPzRVsqjlXr2oqMkv29KJZjBNz3GzWMv58N4/n0tzAFUemnIkMufO+6m5VQJiyX2qp9efQ lK3X9sk0/dtxuuzX1S2nWqdWF1rax1lXfH2SclpUguPgux1XmSLrL+QrLdq29tm9SJlgRSWW 4oxEQy3mouJEAGXPAS52AgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170320105655eucas1p21706c33b5c1b413126fbfd1e23a34058 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170320105655eucas1p21706c33b5c1b413126fbfd1e23a34058 X-RootMTR: 20170320105655eucas1p21706c33b5c1b413126fbfd1e23a34058 References: <1490007402-30265-1-git-send-email-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 During my research I found that some of the requirements for the memory buffers for MFC v6+ devices were blindly copied from the previous (v5) version and simply turned out to be excessive. The relaxed requirements are applied by the recent patches to the MFC driver and the driver is now fully functional even without the reserved memory blocks for all v6+ variants. This patch removes those reserved memory nodes from all boards having MFC v6+ hardware block. Signed-off-by: Marek Szyprowski Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Acked-by: Andrzej Hajda Tested-by: Smitha T Murthy --- arch/arm/boot/dts/exynos5250-arndale.dts | 1 - arch/arm/boot/dts/exynos5250-smdk5250.dts | 1 - arch/arm/boot/dts/exynos5250-spring.dts | 1 - arch/arm/boot/dts/exynos5420-arndale-octa.dts | 1 - arch/arm/boot/dts/exynos5420-peach-pit.dts | 1 - arch/arm/boot/dts/exynos5420-smdk5420.dts | 1 - arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi | 1 - arch/arm/boot/dts/exynos5800-peach-pi.dts | 1 - 8 files changed, 8 deletions(-) -- 1.9.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/arch/arm/boot/dts/exynos5250-arndale.dts b/arch/arm/boot/dts/exynos5250-arndale.dts index 6098dacd09f1..6a432460eb77 100644 --- a/arch/arm/boot/dts/exynos5250-arndale.dts +++ b/arch/arm/boot/dts/exynos5250-arndale.dts @@ -14,7 +14,6 @@ #include #include #include "exynos5250.dtsi" -#include "exynos-mfc-reserved-memory.dtsi" / { model = "Insignal Arndale evaluation board based on EXYNOS5250"; diff --git a/arch/arm/boot/dts/exynos5250-smdk5250.dts b/arch/arm/boot/dts/exynos5250-smdk5250.dts index a97a785ccc6b..6632f657394e 100644 --- a/arch/arm/boot/dts/exynos5250-smdk5250.dts +++ b/arch/arm/boot/dts/exynos5250-smdk5250.dts @@ -13,7 +13,6 @@ #include #include #include "exynos5250.dtsi" -#include "exynos-mfc-reserved-memory.dtsi" / { model = "SAMSUNG SMDK5250 board based on EXYNOS5250"; diff --git a/arch/arm/boot/dts/exynos5250-spring.dts b/arch/arm/boot/dts/exynos5250-spring.dts index 4d7bdb735ed3..95c3bcace9dc 100644 --- a/arch/arm/boot/dts/exynos5250-spring.dts +++ b/arch/arm/boot/dts/exynos5250-spring.dts @@ -14,7 +14,6 @@ #include #include #include "exynos5250.dtsi" -#include "exynos-mfc-reserved-memory.dtsi" / { model = "Google Spring"; diff --git a/arch/arm/boot/dts/exynos5420-arndale-octa.dts b/arch/arm/boot/dts/exynos5420-arndale-octa.dts index 9cc83c51c925..ee1bb9b8b366 100644 --- a/arch/arm/boot/dts/exynos5420-arndale-octa.dts +++ b/arch/arm/boot/dts/exynos5420-arndale-octa.dts @@ -16,7 +16,6 @@ #include #include #include -#include "exynos-mfc-reserved-memory.dtsi" / { model = "Insignal Arndale Octa evaluation board based on EXYNOS5420"; diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts b/arch/arm/boot/dts/exynos5420-peach-pit.dts index 1f964ec35c5e..2cd65699a29c 100644 --- a/arch/arm/boot/dts/exynos5420-peach-pit.dts +++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts @@ -16,7 +16,6 @@ #include #include "exynos5420.dtsi" #include "exynos5420-cpus.dtsi" -#include "exynos-mfc-reserved-memory.dtsi" / { model = "Google Peach Pit Rev 6+"; diff --git a/arch/arm/boot/dts/exynos5420-smdk5420.dts b/arch/arm/boot/dts/exynos5420-smdk5420.dts index aaccd0da41e5..08c8ab173e87 100644 --- a/arch/arm/boot/dts/exynos5420-smdk5420.dts +++ b/arch/arm/boot/dts/exynos5420-smdk5420.dts @@ -13,7 +13,6 @@ #include "exynos5420.dtsi" #include "exynos5420-cpus.dtsi" #include -#include "exynos-mfc-reserved-memory.dtsi" / { model = "Samsung SMDK5420 board based on EXYNOS5420"; diff --git a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi index 05b9afdd6757..657535e2e3cc 100644 --- a/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi +++ b/arch/arm/boot/dts/exynos5422-odroidxu3-common.dtsi @@ -18,7 +18,6 @@ #include #include "exynos5800.dtsi" #include "exynos5422-cpus.dtsi" -#include "exynos-mfc-reserved-memory.dtsi" / { memory@40000000 { diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts index f9ff7f07ae0c..ecf1c916e8fc 100644 --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts @@ -16,7 +16,6 @@ #include #include "exynos5800.dtsi" #include "exynos5420-cpus.dtsi" -#include "exynos-mfc-reserved-memory.dtsi" / { model = "Google Peach Pi Rev 10+";