[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z3_nCPk_g8znto4A@hovoldconsulting.com>
Date: Thu, 9 Jan 2025 16:11:04 +0100
From: Johan Hovold <johan@...nel.org>
To: Dikshita Agarwal <quic_dikshita@...cinc.com>
Cc: Vikash Garodia <quic_vgarodia@...cinc.com>,
Abhinav Kumar <quic_abhinavk@...cinc.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Hans Verkuil <hverkuil@...all.nl>,
Sebastian Fricke <sebastian.fricke@...labora.com>,
Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Neil Armstrong <neil.armstrong@...aro.org>,
Nicolas Dufresne <nicolas@...fresne.ca>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
Jianhua Lu <lujianhua000@...il.com>,
Stefan Schmidt <stefan.schmidt@...aro.org>,
linux-media@...r.kernel.org, linux-arm-msm@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
Bjorn Andersson <andersson@...nel.org>
Subject: Re: [PATCH v9 27/28] media: iris: enable video driver probe of
SM8250 SoC
On Thu, Dec 12, 2024 at 05:21:49PM +0530, Dikshita Agarwal wrote:
> Initialize the platform data and enable video driver probe of SM8250
> SoC. Add a kernel param to select between venus and iris drivers for
> platforms supported by both drivers, for ex: SM8250.
Why do you want to use a module parameter for this? What would be the
default configuration? (Module parameters should generally be avoided.)
Why not simply switch to the new driver (and make sure that the new
driver is selected if the old one was enabled in the kernel config)?
> Tested-by: Stefan Schmidt <stefan.schmidt@...aro.org> # x1e80100 (Dell
Looks like something is missing from Stefan's Tested-by tag throughout
the series ("Dell XPS13"?)
> Reviewed-by: Stefan Schmidt <stefan.schmidt@...aro.org>
> Signed-off-by: Dikshita Agarwal <quic_dikshita@...cinc.com>
> +static bool prefer_venus = true;
> +MODULE_PARM_DESC(prefer_venus, "Select whether venus or iris driver should be preferred");
> +module_param(prefer_venus, bool, 0444);
> +
> +/* list all platforms supported by only iris driver */
> +static const char *const iris_only_platforms[] = {
> + "qcom,sm8550-iris",
> + NULL,
> +};
Surely you don't want to have to add every new platform to two tables
(i.e. the id table and again here).
> +
> +/* list all platforms supported by both venus and iris drivers */
> +static const char *const venus_to_iris_migration[] = {
> + "qcom,sm8250-venus",
> + NULL,
> +};
> +
> +static bool video_drv_should_bind(struct device *dev, bool is_iris_driver)
> +{
> + if (of_device_compatible_match(dev->of_node, iris_only_platforms))
> + return is_iris_driver;
> +
> + /* If it is not in the migration list, use venus */
> + if (!of_device_compatible_match(dev->of_node, venus_to_iris_migration))
> + return !is_iris_driver;
> +
> + return prefer_venus ? !is_iris_driver : is_iris_driver;
> +}
> +
> static int iris_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> @@ -196,6 +224,9 @@ static int iris_probe(struct platform_device *pdev)
> u64 dma_mask;
> int ret;
>
> + if (!video_drv_should_bind(&pdev->dev, true))
> + return -ENODEV;
AFAICT nothing is preventing venus from binding even when 'prefer_venus'
is false.
> +
> core = devm_kzalloc(&pdev->dev, sizeof(*core), GFP_KERNEL);
> if (!core)
> return -ENOMEM;
> @@ -324,6 +355,10 @@ static const struct of_device_id iris_dt_match[] = {
> .compatible = "qcom,sm8550-iris",
> .data = &sm8550_data,
> },
> + {
> + .compatible = "qcom,sm8250-venus",
> + .data = &sm8250_data,
> + },
> { },
> };
> MODULE_DEVICE_TABLE(of, iris_dt_match);
Johan
Powered by blists - more mailing lists