[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d28c81b0-3d50-46f7-876e-d634bcab2cd0@kwiboo.se>
Date: Fri, 24 Oct 2025 00:53:20 +0200
From: Jonas Karlman <jonas@...boo.se>
To: Detlev Casanova <detlev.casanova@...labora.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
Ezequiel Garcia <ezequiel@...guardiasur.com.ar>,
Heiko Stuebner <heiko@...ech.de>, Ricardo Ribalda <ribalda@...omium.org>,
Hans Verkuil <hverkuil@...nel.org>, Hans de Goede <hansg@...nel.org>,
Yunke Cao <yunkec@...gle.com>, Jonathan Corbet <corbet@....net>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
James Cowgill <james.cowgill@...ize.com>, linux-media@...r.kernel.org,
linux-rockchip@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
kernel@...labora.com, Nicolas Dufresne <nicolas.dufresne@...labora.com>,
Diederik de Haas <didi.debian@...ow.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 12/15] media: rkvdec: Add H264 support for the VDPU381
variant
Hi Detlev,
On 10/23/2025 11:42 PM, Detlev Casanova wrote:
> This decoder variant is found in Rockchip RK3588 SoC family.
>
> Like for rkvdec on rk3399, it supports the NV12, NV15, NV16 and NV20
> output formats and level up to 5.1.
>
> The maximum width and height have been significantly increased
> supporting up to 65520 pixels for both.
>
> Also make sure to only expose the first core and ignore the other
> until mutli-core is supported.
>
> Fluster score for JVT-AVC_V1 is 129/135.
>
> Tested-by: Diederik de Haas <didi.debian@...ow.org> # Rock 5B
> Signed-off-by: Detlev Casanova <detlev.casanova@...labora.com>
> ---
> .../media/platform/rockchip/rkvdec/Makefile | 1 +
> .../rockchip/rkvdec/rkvdec-h264-common.h | 2 +
> .../rockchip/rkvdec/rkvdec-vdpu381-h264.c | 469 ++++++++++++++++++
> .../rockchip/rkvdec/rkvdec-vdpu381-regs.h | 427 ++++++++++++++++
> .../media/platform/rockchip/rkvdec/rkvdec.c | 127 +++++
> .../media/platform/rockchip/rkvdec/rkvdec.h | 4 +
> 6 files changed, 1030 insertions(+)
> create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-h264.c
> create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-vdpu381-regs.h
[snip]
> diff --git a/drivers/media/platform/rockchip/rkvdec/rkvdec.c b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
> index f043b07c8e7d..bc3e35b82a11 100644
> --- a/drivers/media/platform/rockchip/rkvdec/rkvdec.c
> +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec.c
[snip]
> +/*
> + * Some SoCs, like RK3588 have multiple identical VDPU cores, but the
> + * kernel is currently missing support for multi-core handling. Exposing
> + * separate devices for each core to userspace is bad, since that does
> + * not allow scheduling tasks properly (and creates ABI). With this workaround
> + * the driver will only probe for the first core and early exit for the other
> + * cores. Once the driver gains multi-core support, the same technique
> + * for detecting the first core can be used to cluster all cores together.
> + */
> +static int rkvdec_disable_multicore(struct rkvdec_dev *rkvdec)
> +{
> + struct device_node *node = NULL;
> + const char *compatible;
> + bool is_first_core;
> + int ret;
> +
> + /* Intentionally ignores the fallback strings */
> + ret = of_property_read_string(rkvdec->dev->of_node, "compatible", &compatible);
> + if (ret)
> + return ret;
> +
> + /* The first compatible and available node found is considered the main core */
> + do {
> + node = of_find_compatible_node(node, NULL, compatible);
> + if (of_device_is_available(node))
> + break;
> + } while (node);
> +
> + if (!node)
> + return -EINVAL;
> +
> + is_first_core = (rkvdec->dev->of_node == node);
> +
> + of_node_put(node);
> +
> + if (!is_first_core) {
> + dev_info(rkvdec->dev, "missing multi-core support, ignoring this instance\n");
> + return -ENODEV;
> + }
> +
> + return 0;
> +}
The addition of rkvdec_disable_multicore should probably be split into a
separate patch.
Please leave some more time for review before sending next version. I
will try to do a more in depth review of this series this weekend, more
feedback will follow.
Regards,
Jonas
[snip]
Powered by blists - more mailing lists