[PATCH v4 1/3] media: v4l2-mem2mem: Add a kref to the v4l2_m2m_dev structure
Ulf Hansson
ulf.hansson at linaro.org
Tue Jan 6 05:28:19 PST 2026
On Mon, 5 Jan 2026 at 19:08, Nicolas Dufresne <nicolas at ndufresne.ca> wrote:
>
> Hi,
>
> Le mardi 30 décembre 2025 à 14:39 +0100, Ulf Hansson a écrit :
> > On Fri, 5 Dec 2025 at 02:55, <ming.qian at oss.nxp.com> wrote:
> > >
> > > From: Nicolas Dufresne <nicolas.dufresne at collabora.com>
> > >
> > > Adding a reference count to the v4l2_m2m_dev structure allow safely
> > > sharing it across multiple hardware nodes. This can be used to prevent
> > > running jobs concurrently on m2m cores that have some internal resource
> > > sharing.
> > >
> > > Signed-off-by: Nicolas Dufresne <nicolas.dufresne at collabora.com>
> > > Signed-off-by: Ming Qian <ming.qian at oss.nxp.com>
> >
> > I certainly don't have the complete picture for how this needs to work.
> >
> > However, I was thinking that rather than using a kref and having to
> > share two specific functions to update it (v4l2_m2m_get|put), couldn't
> > we just use a device-link instead?
>
> The device link seems to be intended for power management, I'm effectively not
> familiar with it, so thanks for the information. However, my impression is that
> this is indented to describe power management dependencies on siblings, but this
> was done differently on this SoC (way before my time here), the DT seems to
> describe a block controller which is common to the two (defective) cores. So
> power management wise, its already handled.
>
> Be aware that my intent is to rename v4l2_m2m_dev into v4l2_m2m_sched. Its not a
> dev wrapper, but a helper object that will schedule work coming from N
> v4l2_m2m_ctx (per open() calls). Making this helper object ref counted makes the
> live-time management a lot simpler, and since its not a dev wrapper, this patch
> is not creating a second refcount for the same object.
Okay, fair enough. No objections from my side,
[...]
Kind regards
Uffe
More information about the linux-arm-kernel
mailing list