[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9aaf6c09-1a01-aa82-cab5-d2dd07649707@xs4all.nl>
Date: Sun, 26 Apr 2020 10:07:29 +0200
From: Hans Verkuil <hverkuil@...all.nl>
To: Dmitry Osipenko <digetx@...il.com>,
Sowjanya Komatineni <skomatineni@...dia.com>,
thierry.reding@...il.com, jonathanh@...dia.com, frankc@...dia.com,
sakari.ailus@....fi, helen.koike@...labora.com
Cc: sboyd@...nel.org, linux-media@...r.kernel.org,
devicetree@...r.kernel.org, linux-clk@...r.kernel.org,
linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH v10 6/9] media: tegra: Add Tegra210 Video input driver
On 26/04/2020 02:19, Dmitry Osipenko wrote:
> 26.04.2020 02:44, Sowjanya Komatineni пишет:
> ...
>>> How much of the T210 code could be reused by T186/194?
>>
>> vi/csi are common driver where soc structure should be populated for
>> T186/T194
>>
>> Tegra210.c can't be reused for Tegra186/t194 as programming seq is a
>> whole lot diff
>>
>
> How are you going to separate Tegra210/186/194 drivers from each other?
> I don't think you'll want to have one "fat" driver that covers all those
> SoCs, won't you?
As long as the differences between SoCs are small, the media subsystem policy
is to keep it all in one driver. You might split off some of it into separate
SoC-specific sources that are included only if selected in the Kconfig (see
e.g. drivers/staging/media/hantro/ or drivers/staging/media/imx/). If that
makes sense for the Tegra, then that's a perfectly fine option. But creating
multiple drivers for SoCs that only differ in relatively minor ways is not
recommended.
Also, these drivers allocate *huge* amounts of memory when streaming video,
so a somewhat bigger driver is not something you'll notice. Keeping things
readable, simple and maintainable is much more important.
Regards,
Hans
>
> In the end it should be three modules: tegra210-video.ko
> tegra186-video.ko tegra194-video.ko.
>
> Using a per-SoC OPS doesn't allow you to do that because the "root"
> driver will have to lookup OPS' code symbols of every SoC, and thus, the
> unwanted driver modules will get auto-loaded if you'll try to factor out
> the OPS into a separate driver modules.
>
Powered by blists - more mailing lists