lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sat,  9 May 2020 10:46:00 -0700
From:   Jonathan Bakker <xc-racer2@...e.ca>
To:     nki.dae@...sung.com, jy0922.shim@...sung.com,
        sw0312.kim@...sung.com, kyungmin.park@...sung.com,
        airlied@...ux.ie, daniel@...ll.ch, kgene@...nel.org,
        krzk@...nel.org, dri-devel@...ts.freedesktop.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Jonathan Bakker <xc-racer2@...e.ca>
Subject: [PATCH] drm/exynos: fimc: Add support for S5PV210 variant

S5PV210 can be trivially supported by this driver.  Only one of
its FIMC devices (#2) supports the same scaling values as Exynos4, and
it is marked by mainscaler-ext in the DTS (as it is for all of the
Exynos4 devices).  It's limits are the same as that of id's 0-2 of
Exynos4 so we don't even need to change the device id check.

It has been tested with a modified libdrm's test from
https://github.com/tobiasjakobi/libdrm/tree/ippv2

Signed-off-by: Jonathan Bakker <xc-racer2@...e.ca>
---
 drivers/gpu/drm/exynos/exynos_drm_fimc.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
index 29ab8be8604c..63e1b8ccb8e9 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c
@@ -89,6 +89,7 @@ struct fimc_scaler {
  * @regs: memory mapped io registers.
  * @lock: locking of operations.
  * @clocks: fimc clocks.
+ * @num_clocks: number of fimc clocks
  * @sc: scaler infomations.
  * @pol: porarity of writeback.
  * @id: fimc id.
@@ -107,6 +108,7 @@ struct fimc_context {
 	void __iomem	*regs;
 	spinlock_t	lock;
 	struct clk	*clocks[FIMC_CLKS_MAX];
+	int		num_clocks;
 	struct fimc_scaler	sc;
 	int	id;
 	int	irq;
@@ -1183,7 +1185,7 @@ static int fimc_setup_clocks(struct fimc_context *ctx)
 	for (i = 0; i < FIMC_CLKS_MAX; i++)
 		ctx->clocks[i] = ERR_PTR(-EINVAL);
 
-	for (i = 0; i < FIMC_CLKS_MAX; i++) {
+	for (i = 0; i < ctx->num_clocks; i++) {
 		if (i == FIMC_CLK_WB_A || i == FIMC_CLK_WB_B)
 			dev = fimc_dev->parent;
 		else
@@ -1210,6 +1212,9 @@ int exynos_drm_check_fimc_device(struct device *dev)
 {
 	int id = of_alias_get_id(dev->of_node, "fimc");
 
+	if (!of_property_read_bool(dev->of_node, "samsung,mainscaler-ext"))
+		return -ENODEV;
+
 	if (id >= 0 && (BIT(id) & fimc_mask))
 		return 0;
 	return -ENODEV;
@@ -1277,6 +1282,11 @@ static int fimc_probe(struct platform_device *pdev)
 	ctx->dev = dev;
 	ctx->id = of_alias_get_id(dev->of_node, "fimc");
 
+	if (of_device_is_compatible(dev->of_node, "samsung,s5pv210-fimc"))
+		ctx->num_clocks = 2;
+	else
+		ctx->num_clocks = FIMC_CLKS_MAX;
+
 	/* construct formats/limits array */
 	num_formats = ARRAY_SIZE(fimc_formats) + ARRAY_SIZE(fimc_tiled_formats);
 	formats = devm_kcalloc(dev, num_formats, sizeof(*formats),
@@ -1409,6 +1419,7 @@ static const struct dev_pm_ops fimc_pm_ops = {
 static const struct of_device_id fimc_of_match[] = {
 	{ .compatible = "samsung,exynos4210-fimc" },
 	{ .compatible = "samsung,exynos4212-fimc" },
+	{ .compatible = "samsung,s5pv210-fimc" },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, fimc_of_match);
-- 
2.20.1

Powered by blists - more mailing lists