[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5911981.DvuYhMxLoT@trenzalore>
Date: Mon, 11 Aug 2025 09:52:15 -0400
From: Detlev Casanova <detlev.casanova@...labora.com>
To: linux-kernel@...r.kernel.org, Krzysztof Kozlowski <krzk@...nel.org>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
Heiko Stuebner <heiko@...ech.de>, linux-media@...r.kernel.org,
linux-rockchip@...ts.infradead.org, linux-arm-kernel@...ts.infradead.org,
kernel@...labora.com
Subject: Re: [PATCH v2 05/12] media: rkvdec: Add per variant configuration
Hi Krzysztof,
On Monday, 11 August 2025 02:13:04 EDT Krzysztof Kozlowski wrote:
> On 08/08/2025 22:03, Detlev Casanova wrote:
> > This is to prepare for adding different variants of the decoder and
>
> Prepare for...
Sounds better indeed.
> > support specific formats and ops.
> >
> > Signed-off-by: Detlev Casanova <detlev.casanova@...labora.com>
> > ---
>
> ...
>
> > static int rkvdec_init_ctrls(struct rkvdec_ctx *ctx)
> > {
> >
> > + struct rkvdec_config *cfg = ctx->dev->config;
> >
> > unsigned int i, nctrls = 0;
> > int ret;
> >
> > - for (i = 0; i < ARRAY_SIZE(rkvdec_coded_fmts); i++)
> > - nctrls += rkvdec_coded_fmts[i].ctrls->num_ctrls;
> > + for (i = 0; i < cfg->coded_fmts_num; i++)
> > + nctrls += cfg->coded_fmts[i].ctrls->num_ctrls;
> >
> > v4l2_ctrl_handler_init(&ctx->ctrl_hdl, nctrls);
> >
> > - for (i = 0; i < ARRAY_SIZE(rkvdec_coded_fmts); i++) {
> > - ret = rkvdec_add_ctrls(ctx,
rkvdec_coded_fmts[i].ctrls);
> > + for (i = 0; i < cfg->coded_fmts_num; i++) {
> > + ret = rkvdec_add_ctrls(ctx, cfg->coded_fmts[i].ctrls);
> >
> > if (ret)
> >
> > goto err_free_handler;
> >
> > }
> >
> > @@ -1119,8 +1127,13 @@ static void rkvdec_watchdog_func(struct work_struct
> > *work)>
> > }
> >
> > }
> >
> > +const struct rkvdec_config config_rkvdec = {
>
> Why isn't this static?
>
> > + .coded_fmts = (struct rkvdec_coded_fmt_desc *)rkvdec_coded_fmts,
> > + .coded_fmts_num = ARRAY_SIZE(rkvdec_coded_fmts),
> > +};
> > +
> >
> > static const struct of_device_id of_rkvdec_match[] = {
> >
> > - { .compatible = "rockchip,rk3399-vdec" },
> > + { .compatible = "rockchip,rk3399-vdec", .data = &config_rkvdec },
> >
> > { /* sentinel */ }
> >
> > };
> > MODULE_DEVICE_TABLE(of, of_rkvdec_match);
> >
> > @@ -1144,6 +1157,9 @@ static int rkvdec_probe(struct platform_device
> > *pdev)
> >
> > mutex_init(&rkvdec->vdev_lock);
> > INIT_DELAYED_WORK(&rkvdec->watchdog_work, rkvdec_watchdog_func);
> >
> > + rkvdec->config =
> > + (struct rkvdec_config *)of_device_get_match_data(rkvdec-
>dev);
>
> If you need a cast, your code is wrong.
Right, some const/static addition is needed. I'll fix that :)
Detlev.
Powered by blists - more mailing lists