* [PATCH 0/4] Add DT bindings and driver code for Scaler
[not found] <CGME20250827045905epcas2p2daa6599d04f38c002e396abf23d60fe7@epcas2p2.samsung.com>
@ 2025-08-27 4:47 ` Kisung Lee
[not found] ` <CGME20250827045905epcas2p4b2cbd4b881af1c1be4b345861d1a635b@epcas2p4.samsung.com>
` (4 more replies)
0 siblings, 5 replies; 9+ messages in thread
From: Kisung Lee @ 2025-08-27 4:47 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Mauro Carvalho Chehab, Inki Dae
Cc: Kisung Lee, dri-devel, devicetree, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-media
This patch series adds device tree bindings and driver support
for the ExynosAuto scaler hardware. It adds YAML binding docs,
updates Kconfig and Makefile, and provides initial driver
code to register the Scaler device as a V4L2 video node for
video processing.
Kisung Lee (4):
dt-bindings: soc: samsung: scaler: exynos: Add ExynosAutov920
compatible
media: samsung: scaler: add scaler driver code
arm64: dts: exynosautov920: enable support for scaler device
media: samsung: scaler: Add Kconfig and Makefile
.../bindings/gpu/samsung-scaler.yaml | 1 +
.../arm64/boot/dts/exynos/exynosautov920.dtsi | 22 +
drivers/media/platform/samsung/Kconfig | 1 +
drivers/media/platform/samsung/Makefile | 1 +
.../platform/samsung/v920-scaler/Kconfig | 17 +
.../platform/samsung/v920-scaler/Makefile | 9 +
.../samsung/v920-scaler/scaler-core.c | 3640 +++++++++++++++++
.../samsung/v920-scaler/scaler-regs.c | 744 ++++
.../samsung/v920-scaler/scaler-regs.h | 406 ++
.../platform/samsung/v920-scaler/scaler.h | 621 +++
.../v920-scaler/videodev2_exynos_media.h | 162 +
11 files changed, 5624 insertions(+)
create mode 100644 drivers/media/platform/samsung/v920-scaler/Kconfig
create mode 100644 drivers/media/platform/samsung/v920-scaler/Makefile
create mode 100644 drivers/media/platform/samsung/v920-scaler/scaler-core.c
create mode 100644 drivers/media/platform/samsung/v920-scaler/scaler-regs.c
create mode 100644 drivers/media/platform/samsung/v920-scaler/scaler-regs.h
create mode 100644 drivers/media/platform/samsung/v920-scaler/scaler.h
create mode 100644 drivers/media/platform/samsung/v920-scaler/videodev2_exynos_media.h
--
2.25.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/4] dt-bindings: soc: samsung: scaler: exynos: Add ExynosAutov920 compatible
[not found] ` <CGME20250827045905epcas2p4b2cbd4b881af1c1be4b345861d1a635b@epcas2p4.samsung.com>
@ 2025-08-27 4:47 ` Kisung Lee
2025-08-27 6:30 ` Krzysztof Kozlowski
0 siblings, 1 reply; 9+ messages in thread
From: Kisung Lee @ 2025-08-27 4:47 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Mauro Carvalho Chehab, Inki Dae
Cc: Kisung Lee, dri-devel, devicetree, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-media
Add samsung,exynos5-scaler compatible for ExynosAutov920 SoC.
Signed-off-by: Kisung Lee <kiisung.lee@samsung.com>
---
Documentation/devicetree/bindings/gpu/samsung-scaler.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml b/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml
index 9fb530e65d0e..5a472e29dc8a 100644
--- a/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml
+++ b/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml
@@ -14,6 +14,7 @@ properties:
enum:
- samsung,exynos5420-scaler
- samsung,exynos5433-scaler
+ - samsung,exynos5-scaler
reg:
maxItems: 1
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/4] arm64: dts: exynosautov920: enable support for scaler device
[not found] ` <CGME20250827045905epcas2p3a52debf186f41eef08e6d0a351d80476@epcas2p3.samsung.com>
@ 2025-08-27 4:47 ` Kisung Lee
2025-08-27 6:38 ` Krzysztof Kozlowski
0 siblings, 1 reply; 9+ messages in thread
From: Kisung Lee @ 2025-08-27 4:47 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Mauro Carvalho Chehab, Inki Dae
Cc: Kisung Lee, dri-devel, devicetree, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-media
Add the Scaler Devicetree for the Scaler present on the
ExynosAutoV920 SoC. The scaler provides hardware acceleration
for 2D scaling up/down and color space conversion processing.
Signed-off-by: Kisung Lee <kiisung.lee@samsung.com>
---
.../arm64/boot/dts/exynos/exynosautov920.dtsi | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
index 0fdf2062930a..e3dad683fa36 100644
--- a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
+++ b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
@@ -26,6 +26,7 @@ aliases {
pinctrl5 = &pinctrl_hsi2ufs;
pinctrl6 = &pinctrl_peric0;
pinctrl7 = &pinctrl_peric1;
+ scaler0 = &scaler_0;
};
arm-pmu {
@@ -1504,6 +1505,27 @@ timer {
<GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
<GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
};
+
+ scaler_0: scaler@1A830000 {
+ compatible = "samsung,exynos5-scaler";
+ reg = <0x0 0x1A830000 0x0 0x3000>;
+ interrupts = <GIC_SPI 639 IRQ_TYPE_LEVEL_HIGH>;
+
+ mscl_qos_table = < 0 800000 800000
+ 0 663000 663000
+ 0 533000 553000
+ 0 400000 400000
+ 0 350000 350000
+ 0 200000 200000
+ 0 160000 160000 >;
+
+ mscl_ppc_table = < 12 496 470
+ 16 374 342
+ 24 303 288
+ 32 189 188
+ 100 479 436 >;
+ status = "disabled";
+ };
};
#include "exynosautov920-pinctrl.dtsi"
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/4] media: samsung: scaler: Add Kconfig and Makefile
[not found] ` <CGME20250827045906epcas2p2198037517886df0714e24d8d908a6c57@epcas2p2.samsung.com>
@ 2025-08-27 4:47 ` Kisung Lee
2025-08-27 6:39 ` Krzysztof Kozlowski
0 siblings, 1 reply; 9+ messages in thread
From: Kisung Lee @ 2025-08-27 4:47 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Mauro Carvalho Chehab, Inki Dae
Cc: Kisung Lee, dri-devel, devicetree, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-media
Add Kconfig and Makefile for Scaler driver directory.
This will serve as the entry point for enabling and building
Exynosautov920 specific device drivers.
Signed-off-by: Kisung Lee <kiisung.lee@samsung.com>
---
drivers/media/platform/samsung/Kconfig | 1 +
drivers/media/platform/samsung/Makefile | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/media/platform/samsung/Kconfig b/drivers/media/platform/samsung/Kconfig
index 0e34c5fc1dfc..baff5f7b9c3a 100644
--- a/drivers/media/platform/samsung/Kconfig
+++ b/drivers/media/platform/samsung/Kconfig
@@ -8,3 +8,4 @@ source "drivers/media/platform/samsung/s3c-camif/Kconfig"
source "drivers/media/platform/samsung/s5p-g2d/Kconfig"
source "drivers/media/platform/samsung/s5p-jpeg/Kconfig"
source "drivers/media/platform/samsung/s5p-mfc/Kconfig"
+source "drivers/media/platform/samsung/v920-scaler/Kconfig"
diff --git a/drivers/media/platform/samsung/Makefile b/drivers/media/platform/samsung/Makefile
index 21fea3330e4b..7a9e6f126628 100644
--- a/drivers/media/platform/samsung/Makefile
+++ b/drivers/media/platform/samsung/Makefile
@@ -5,3 +5,4 @@ obj-y += s3c-camif/
obj-y += s5p-g2d/
obj-y += s5p-jpeg/
obj-y += s5p-mfc/
+obj-y += v920-scaler/
--
2.25.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] dt-bindings: soc: samsung: scaler: exynos: Add ExynosAutov920 compatible
2025-08-27 4:47 ` [PATCH 1/4] dt-bindings: soc: samsung: scaler: exynos: Add ExynosAutov920 compatible Kisung Lee
@ 2025-08-27 6:30 ` Krzysztof Kozlowski
0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-27 6:30 UTC (permalink / raw)
To: Kisung Lee, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Alim Akhtar, Mauro Carvalho Chehab, Inki Dae
Cc: dri-devel, devicetree, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-media
On 27/08/2025 06:47, Kisung Lee wrote:
> Add samsung,exynos5-scaler compatible for ExynosAutov920 SoC.
>
> Signed-off-by: Kisung Lee <kiisung.lee@samsung.com>
> ---
> Documentation/devicetree/bindings/gpu/samsung-scaler.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml b/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml
> index 9fb530e65d0e..5a472e29dc8a 100644
> --- a/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml
> +++ b/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml
> @@ -14,6 +14,7 @@ properties:
> enum:
> - samsung,exynos5420-scaler
> - samsung,exynos5433-scaler
> + - samsung,exynos5-scaler
Uh, no, 5 != 920.
Please follow writing bindings or check my talk from yesterday at OSSE25.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/4] media: samsung: scaler: add scaler driver code
[not found] ` <20250827044720.3751272-3-kiisung.lee@samsung.com>
@ 2025-08-27 6:38 ` Krzysztof Kozlowski
0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-27 6:38 UTC (permalink / raw)
To: Kisung Lee, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Alim Akhtar, Mauro Carvalho Chehab, Inki Dae
Cc: dri-devel, devicetree, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-media
On 27/08/2025 06:47, Kisung Lee wrote:
> +
> +static int sc_probe(struct platform_device *pdev)
> +{
> + struct sc_dev *sc;
> + struct resource *res;
> + int ret = 0;
> + size_t ivar;
> + u32 hwver = 0;
> + int irq_num;
> +
> + sc = devm_kzalloc(&pdev->dev, sizeof(struct sc_dev), GFP_KERNEL);
Oh yeah, 10 year old coding style. Very dissapointing :(
> + if (!sc)
> + goto err_dev;
> +
> + sc->dev = &pdev->dev;
> + spin_lock_init(&sc->ctxlist_lock);
> + INIT_LIST_HEAD(&sc->ctx_list_high_prio);
> + INIT_LIST_HEAD(&sc->ctx_list_low_prio);
> + spin_lock_init(&sc->slock);
> + mutex_init(&sc->lock);
> + init_waitqueue_head(&sc->wait);
> +
> + sc->fence_context = dma_fence_context_alloc(1);
> + spin_lock_init(&sc->fence_lock);
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + pr_err("Resource start: 0x%pa, end: 0x%pa, size: 0x%lx, flags: 0x%lx\n",
No, drop.
> + &res->start, &res->end,
> + (unsigned long)resource_size(res),
> + (unsigned long)res->flags);
> + sc->regs = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(sc->regs)) {
> + pr_err("devm_ioremap_resource failed: %pe\n", sc->regs);
> + goto err_io_resource;
> + }
> + dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
> +
> + atomic_set(&sc->wdt.cnt, 0);
> + timer_setup(&sc->wdt.timer, sc_watchdog, 0);
> +
> + if (pdev->dev.of_node) {
> + sc->dev_id = of_alias_get_id(pdev->dev.of_node, "scaler");
NAK, check my DT talk.
> + if (sc->dev_id < 0) {
> + dev_err(&pdev->dev,
> + "Failed to read scaler node id(%d)!\n", sc->dev_id);
> + ret = -EINVAL;
> + goto err_node_id;
> + }
> + } else {
> + sc->dev_id = pdev->id;
> + }
> +
> + platform_set_drvdata(pdev, sc);
> +
> + pm_runtime_enable(&pdev->dev);
> +
> + ret = sc_populate_dt(sc);
> + if (ret)
> + goto err_dt;
> +
> + ret = sc_register_m2m_device(sc, sc->dev_id);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to register m2m device\n");
> + goto err_m2m;
> + }
> +
> +#if defined(CONFIG_PM_DEVFREQ) && defined(NEVER_DEFINED)
You must be joking?
> + if (!of_property_read_u32(pdev->dev.of_node, "mscl,int_qos_minlock",
NAK
> + (u32 *)&sc->qosreq_int_level)) {
> + if (sc->qosreq_int_level > 0) {
> + exynos_pm_qos_add_request(&sc->qosreq_int,
> + PM_QOS_DEVICE_THROUGHPUT, 0);
> + dev_info(&pdev->dev, "INT Min.Lock Freq. = %u\n",
> + sc->qosreq_int_level);
> + }
> + }
> +#endif
> + if (of_property_read_u32(pdev->dev.of_node, "mscl,cfw",
Cannot express more: NAK. You cannot add such undocumented ABI.
> + (u32 *)&sc->cfw))
> + sc->cfw = 0;
> +
> + ret = sc_get_hwversion(sc);
> + if (ret < 0) {
> + dev_err(&pdev->dev, "%s: failed to get hw version (err %d)\n",
> + __func__, ret);
> + goto err_m2m;
> + } else {
> + hwver = ret;
> + }
> +
> + for (ivar = 0; ivar < ARRAY_SIZE(sc_variant); ivar++) {
> + if (sc->version >= sc_variant[ivar].version) {
> + sc->variant = &sc_variant[ivar];
> + break;
> + }
> + }
> +
> + if (sc->version >= SCALER_VERSION(7, 0, 1)) {
> + sc->sysreg_offset = SCALER_SYSREG_OFFSET(res->start);
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + if (res) {
> + sc->sysreg = devm_ioremap_resource(&pdev->dev, res);
> + if (IS_ERR(sc->sysreg)) {
> + dev_info(&pdev->dev, "SCALER LLC SYSREG is not setted.\n");
> + } else {
> + writel(SCALER_LLC_NO_HINT, sc->sysreg + sc->sysreg_offset);
> + dev_info(&pdev->dev, "SCALER LLC SYSREG is setted with NO_HINT.\n");
> + }
> + }
> + }
> +
> + sc_hwset_soft_reset(sc);
> +
> + if (!IS_ERR(sc->aclk))
> + clk_disable_unprepare(sc->aclk);
> + if (!IS_ERR(sc->pclk))
> + clk_disable_unprepare(sc->pclk);
> + pm_runtime_put(&pdev->dev);
> +
> + irq_num = platform_get_irq(pdev, 0);
> + if (irq_num < 0) {
> + dev_err(&pdev->dev, "failed to get IRQ resource\n");
you just upstream 10 year old code, right?
Please carefully check the slides of my Monday's talk from OSSE25 about
static analyzers. Look at slides about upstreaming 10 year old vendor
code (that's a very bad idea).
> + ret = -ENOENT;
Wrong error code.
> + goto err_get_irq_res;
> + }
> +
> + ret = devm_request_irq(&pdev->dev, irq_num, sc_irq_handler, 0,
> + pdev->name, sc);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to install irq\n");
> + goto err_request_irq;
> + }
> +
> + dev_info(&pdev->dev,
> + "Driver probed successfully(version: %08x(%x))\n",
> + hwver, sc->version);
NAK, don't add such code. Ever.
> +
> + return 0;
> +
> +err_request_irq:
> +err_get_irq_res:
> +err_m2m:
> +err_dt:
> +err_node_id:
> +err_io_resource:
> + if (sc)
> + devm_kfree(&pdev->dev, sc);
> +err_dev:
> + dev_err(&pdev->dev,
> + "Driver probed failed!\n");
No, drop. Useless.
> +
> + return ret;
> +}
> +
...
> +static struct sc_csc_tab sc_y2r = {
> + /* REC.601 Narrow */
> + { 0x0254, 0x0000, 0x0331, 0x0254, 0xFF37, 0xFE60, 0x0254, 0x0409, 0x0000 },
> + /* REC.601 Wide */
> + { 0x0200, 0x0000, 0x02BE, 0x0200, 0xFF54, 0xFE9B, 0x0200, 0x0377, 0x0000 },
> + /* REC.709 Narrow */
> + { 0x0254, 0x0000, 0x0396, 0x0254, 0xFF93, 0xFEEF, 0x0254, 0x043A, 0x0000 },
> + /* REC.709 Wide */
> + { 0x0200, 0x0000, 0x0314, 0x0200, 0xFFA2, 0xFF16, 0x0200, 0x03A1, 0x0000 },
> + /* BT.2020 Narrow */
> + { 0x0254, 0x0000, 0x035B, 0x0254, 0xFFA0, 0xFEB3, 0x0254, 0x0449, 0x0000 },
> + /* BT.2020 Wide */
> + { 0x0200, 0x0000, 0x02E2, 0x0200, 0xFFAE, 0xFEE2, 0x0200, 0x03AE, 0x0000 },
> +};
> +
> +static struct sc_csc_tab sc_r2y = {
> + /* REC.601 Narrow */
> + { 0x0083, 0x0102, 0x0032, 0xFFB4, 0xFF6B, 0x00E1, 0x00E1, 0xFF44, 0xFFDB },
> + /* REC.601 Wide */
> + { 0x0099, 0x012D, 0x003A, 0xFFA8, 0xFF53, 0x0106, 0x0106, 0xFF25, 0xFFD5 },
> + /* REC.709 Narrow */
> + { 0x005D, 0x013A, 0x0020, 0xFFCC, 0xFF53, 0x00E1, 0x00E1, 0xFF34, 0xFFEB },
> + /* REC.709 Wide */
> + { 0x006D, 0x016E, 0x0025, 0xFFC4, 0xFF36, 0x0106, 0x0106, 0xFF12, 0xFFE8 },
> + /* BT.2020 Narrow */
> + { 0x0074, 0x012A, 0x001A, 0xFFC1, 0xFF5E, 0x00E1, 0x00E1, 0xFF31, 0xFFEE },
> + /* BT.2020 Wide */
> + { 0x0087, 0x015B, 0x001E, 0xFFB7, 0xFF43, 0x0106, 0x0106, 0xFF0F, 0xFFEB },
> +};
> +
> +static struct sc_csc_tab *sc_csc_list[] = {
> + [0] = &sc_no_csc,
> + [1] = &sc_y2r,
> + [2] = &sc_r2y,
> +};
> +
> +static struct sc_bl_op_val sc_bl_op_tbl[] = {
Why absolutely nothing here is const?
> + /* Sc, Sa, Dc, Da */
> + {ZERO, ZERO, ZERO, ZERO}, /* CLEAR */
> + { ONE, ONE, ZERO, ZERO}, /* SRC */
> + {ZERO, ZERO, ONE, ONE}, /* DST */
> + { ONE, ONE, INV_SA, INV_SA}, /* SRC_OVER */
> + {INV_DA, ONE, ONE, INV_SA}, /* DST_OVER */
> + {DST_A, DST_A, ZERO, ZERO}, /* SRC_IN */
> + {ZERO, ZERO, SRC_A, SRC_A}, /* DST_IN */
> + {INV_DA, INV_DA, ZERO, ZERO}, /* SRC_OUT */
> + {ZERO, ZERO, INV_SA, INV_SA}, /* DST_OUT */
> + {DST_A, ZERO, INV_SA, ONE}, /* SRC_ATOP */
> + {INV_DA, ONE, SRC_A, ZERO}, /* DST_ATOP */
> + {INV_DA, ONE, INV_SA, ONE}, /* XOR: need to WA */
> + {INV_DA, ONE, INV_SA, INV_SA}, /* DARKEN */
> + {INV_DA, ONE, INV_SA, INV_SA}, /* LIGHTEN */
> + {INV_DA, ONE, INV_SA, INV_SA}, /* MULTIPLY */
> + {ONE, ONE, INV_SC, INV_SA}, /* SCREEN */
> + {ONE, ONE, ONE, ONE}, /* ADD */
> +};
> +
...
> + yfilter = sc_get_scale_filter(yratio);
> + cfilter = sc_get_scale_filter(cratio);
> + bit_adj = !sc->variant->pixfmt_10bit;
> +
> + /* reset value of the coefficient registers are the 8:8 table */
> + for (phase = 0; phase < 9; phase++) {
> + __raw_writel(sc_coef_adj(bit_adj, sc_coef_4t[yfilter][phase][1]),
> + sc->regs + SCALER_YVCOEF + phase * 8);
> + __raw_writel(sc_coef_adj(bit_adj, sc_coef_4t[yfilter][phase][0]),
> + sc->regs + SCALER_YVCOEF + phase * 8 + 4);
> + }
> +
> + for (phase = 0; phase < 9; phase++) {
> + __raw_writel(sc_coef_adj(bit_adj, sc_coef_4t[cfilter][phase][1]),
> + sc->regs + SCALER_CVCOEF + phase * 8);
> + __raw_writel(sc_coef_adj(bit_adj, sc_coef_4t[cfilter][phase][0]),
> + sc->regs + SCALER_CVCOEF + phase * 8 + 4);
> + }
> +}
> +
> +void sc_get_span(struct sc_frame *frame, u32 *yspan, u32 *cspan)
> +{
> + if (IS_ERR_OR_NULL(frame) || IS_ERR_OR_NULL(yspan) || IS_ERR_OR_NULL(cspan)) {
Sorrry, but what? How each of these can be ERR or NULL? How is it possible?
Please provide exact cases leading to this.
> + pr_err("[%s] frame(%p) or yspan(%p) or cspan(%p) is wrong\n",
> + __func__, frame, yspan, cspan);
> + return;
> + }
> +
> + *yspan = frame->width;
> +
> + if (frame->sc_fmt->num_comp == 2) {
> + *cspan = frame->width << frame->sc_fmt->cspan;
> + } else if (frame->sc_fmt->num_comp == 3) {
> + if (sc_fmt_is_ayv12(frame->sc_fmt->pixelformat)) {
> + *cspan = ALIGN(frame->width >> 1, 16);
> + } else if (sc_fmt_is_yuv420(frame->sc_fmt->pixelformat)) { /* YUV420 */
> + if (frame->cspanalign) {
> + *cspan = ALIGN(frame->width >> 1,
> + 8 << (frame->cspanalign - 1));
> + } else {
> + *cspan = frame->width >> 1;
> + }
> + } else if (frame->sc_fmt->cspan) { /* YUV444 */
> + *cspan = frame->width;
> + } else {
> + *cspan = frame->width >> 1;
> + }
> + } else if (frame->sc_fmt->num_comp == 1) {
> + if (sc_fmt_is_rgb888(frame->sc_fmt->pixelformat))
> + if (frame->yspanalign)
> + *yspan = ALIGN(frame->width,
> + 8 << (frame->yspanalign - 1));
> + *cspan = 0;
> + } else {
> + *cspan = 0;
> + }
> +}
> +
> +void sc_hwset_src_imgsize(struct sc_dev *sc, struct sc_frame *frame)
> +{
> + u32 yspan = 0, cspan = 0;
> +
> + if (IS_ERR_OR_NULL(sc) || IS_ERR_OR_NULL(frame)) {
How can be ERR or NULL? This looks buggy, like you don't know flow of
own code.
> + pr_err("[%s] sc(%p) or frame(%p) is wrong\n", __func__, sc, frame);
dev_err
This is terrible driver, poorly coded, using 10 year old coding style,
repeating many known antipatterns and mistakes. It is very dissapointing
to see Samsung sending such poor code.
Really poor code.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/4] arm64: dts: exynosautov920: enable support for scaler device
2025-08-27 4:47 ` [PATCH 3/4] arm64: dts: exynosautov920: enable support for scaler device Kisung Lee
@ 2025-08-27 6:38 ` Krzysztof Kozlowski
0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-27 6:38 UTC (permalink / raw)
To: Kisung Lee, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Alim Akhtar, Mauro Carvalho Chehab, Inki Dae
Cc: dri-devel, devicetree, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-media
On 27/08/2025 06:47, Kisung Lee wrote:
> Add the Scaler Devicetree for the Scaler present on the
> ExynosAutoV920 SoC. The scaler provides hardware acceleration
> for 2D scaling up/down and color space conversion processing.
>
> Signed-off-by: Kisung Lee <kiisung.lee@samsung.com>
> ---
> .../arm64/boot/dts/exynos/exynosautov920.dtsi | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
> index 0fdf2062930a..e3dad683fa36 100644
> --- a/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
> +++ b/arch/arm64/boot/dts/exynos/exynosautov920.dtsi
> @@ -26,6 +26,7 @@ aliases {
> pinctrl5 = &pinctrl_hsi2ufs;
> pinctrl6 = &pinctrl_peric0;
> pinctrl7 = &pinctrl_peric1;
> + scaler0 = &scaler_0;
> };
>
> arm-pmu {
> @@ -1504,6 +1505,27 @@ timer {
> <GIC_PPI 10 IRQ_TYPE_LEVEL_LOW>,
> <GIC_PPI 12 IRQ_TYPE_LEVEL_LOW>;
> };
> +
> + scaler_0: scaler@1A830000 {
> + compatible = "samsung,exynos5-scaler";
> + reg = <0x0 0x1A830000 0x0 0x3000>;
> + interrupts = <GIC_SPI 639 IRQ_TYPE_LEVEL_HIGH>;
> +
> + mscl_qos_table = < 0 800000 800000
Nice try. NAK. Don't ever send such properties.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] media: samsung: scaler: Add Kconfig and Makefile
2025-08-27 4:47 ` [PATCH 4/4] media: samsung: scaler: Add Kconfig and Makefile Kisung Lee
@ 2025-08-27 6:39 ` Krzysztof Kozlowski
0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2025-08-27 6:39 UTC (permalink / raw)
To: Kisung Lee, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Alim Akhtar, Mauro Carvalho Chehab, Inki Dae
Cc: dri-devel, devicetree, linux-kernel, linux-arm-kernel,
linux-samsung-soc, linux-media
On 27/08/2025 06:47, Kisung Lee wrote:
> Add Kconfig and Makefile for Scaler driver directory.
> This will serve as the entry point for enabling and building
> Exynosautov920 specific device drivers.
That's not a separate commit.
>
> Signed-off-by: Kisung Lee <kiisung.lee@samsung.com>
> ---
> drivers/media/platform/samsung/Kconfig | 1 +
> drivers/media/platform/samsung/Makefile | 1 +
> 2 files changed, 2 insertions(+)
BTW, your patchset does not pass checks required by Samsung SoC
maintainer profile. Use the tools instead of reviewers...
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 0/4] Add DT bindings and driver code for Scaler
2025-08-27 4:47 ` [PATCH 0/4] Add DT bindings and driver code for Scaler Kisung Lee
` (3 preceding siblings ...)
[not found] ` <CGME20250827045905epcas2p46c8bc31d9c32168f77d1e10808e92b77@epcas2p4.samsung.com>
@ 2025-08-27 23:18 ` Rob Herring (Arm)
4 siblings, 0 replies; 9+ messages in thread
From: Rob Herring (Arm) @ 2025-08-27 23:18 UTC (permalink / raw)
To: Kisung Lee
Cc: dri-devel, Thomas Zimmermann, Inki Dae, Mauro Carvalho Chehab,
Conor Dooley, linux-kernel, linux-samsung-soc, Simona Vetter,
devicetree, linux-media, Alim Akhtar, Maarten Lankhorst,
Krzysztof Kozlowski, David Airlie, linux-arm-kernel,
Maxime Ripard
On Wed, 27 Aug 2025 04:47:16 +0000, Kisung Lee wrote:
> This patch series adds device tree bindings and driver support
> for the ExynosAuto scaler hardware. It adds YAML binding docs,
> updates Kconfig and Makefile, and provides initial driver
> code to register the Scaler device as a V4L2 video node for
> video processing.
>
> Kisung Lee (4):
> dt-bindings: soc: samsung: scaler: exynos: Add ExynosAutov920
> compatible
> media: samsung: scaler: add scaler driver code
> arm64: dts: exynosautov920: enable support for scaler device
> media: samsung: scaler: Add Kconfig and Makefile
>
> .../bindings/gpu/samsung-scaler.yaml | 1 +
> .../arm64/boot/dts/exynos/exynosautov920.dtsi | 22 +
> drivers/media/platform/samsung/Kconfig | 1 +
> drivers/media/platform/samsung/Makefile | 1 +
> .../platform/samsung/v920-scaler/Kconfig | 17 +
> .../platform/samsung/v920-scaler/Makefile | 9 +
> .../samsung/v920-scaler/scaler-core.c | 3640 +++++++++++++++++
> .../samsung/v920-scaler/scaler-regs.c | 744 ++++
> .../samsung/v920-scaler/scaler-regs.h | 406 ++
> .../platform/samsung/v920-scaler/scaler.h | 621 +++
> .../v920-scaler/videodev2_exynos_media.h | 162 +
> 11 files changed, 5624 insertions(+)
> create mode 100644 drivers/media/platform/samsung/v920-scaler/Kconfig
> create mode 100644 drivers/media/platform/samsung/v920-scaler/Makefile
> create mode 100644 drivers/media/platform/samsung/v920-scaler/scaler-core.c
> create mode 100644 drivers/media/platform/samsung/v920-scaler/scaler-regs.c
> create mode 100644 drivers/media/platform/samsung/v920-scaler/scaler-regs.h
> create mode 100644 drivers/media/platform/samsung/v920-scaler/scaler.h
> create mode 100644 drivers/media/platform/samsung/v920-scaler/videodev2_exynos_media.h
>
> --
> 2.25.1
>
>
>
My bot found new DTB warnings on the .dts files added or changed in this
series.
Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.
If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:
pip3 install dtschema --upgrade
This patch series was applied (using b4) to base:
Base: attempting to guess base-commit...
Base: tags/next-20250825 (exact match)
If this is not the correct base, please add 'base-commit' tag
(or use b4 which does this automatically)
New warnings running 'make CHECK_DTBS=y for arch/arm64/boot/dts/exynos/' for 20250827044720.3751272-1-kiisung.lee@samsung.com:
arch/arm64/boot/dts/exynos/exynosautov920-sadk.dtb: scaler@1A830000 (samsung,exynos5-scaler): 'mscl_ppc_table', 'mscl_qos_table' do not match any of the regexes: '^pinctrl-[0-9]+$'
from schema $id: http://devicetree.org/schemas/gpu/samsung-scaler.yaml#
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-08-28 0:23 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20250827045905epcas2p2daa6599d04f38c002e396abf23d60fe7@epcas2p2.samsung.com>
2025-08-27 4:47 ` [PATCH 0/4] Add DT bindings and driver code for Scaler Kisung Lee
[not found] ` <CGME20250827045905epcas2p4b2cbd4b881af1c1be4b345861d1a635b@epcas2p4.samsung.com>
2025-08-27 4:47 ` [PATCH 1/4] dt-bindings: soc: samsung: scaler: exynos: Add ExynosAutov920 compatible Kisung Lee
2025-08-27 6:30 ` Krzysztof Kozlowski
[not found] ` <CGME20250827045905epcas2p3a52debf186f41eef08e6d0a351d80476@epcas2p3.samsung.com>
2025-08-27 4:47 ` [PATCH 3/4] arm64: dts: exynosautov920: enable support for scaler device Kisung Lee
2025-08-27 6:38 ` Krzysztof Kozlowski
[not found] ` <CGME20250827045906epcas2p2198037517886df0714e24d8d908a6c57@epcas2p2.samsung.com>
2025-08-27 4:47 ` [PATCH 4/4] media: samsung: scaler: Add Kconfig and Makefile Kisung Lee
2025-08-27 6:39 ` Krzysztof Kozlowski
[not found] ` <CGME20250827045905epcas2p46c8bc31d9c32168f77d1e10808e92b77@epcas2p4.samsung.com>
[not found] ` <20250827044720.3751272-3-kiisung.lee@samsung.com>
2025-08-27 6:38 ` [PATCH 2/4] media: samsung: scaler: add scaler driver code Krzysztof Kozlowski
2025-08-27 23:18 ` [PATCH 0/4] Add DT bindings and driver code for Scaler Rob Herring (Arm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).