Re: [PATCH v7 12/12] media: add driver for StarTech USB3HDCAP

From: Matthew Laux

Date: Wed Nov 25 2026 - 14:46:02 EST


On Wed, Nov 25, 2026 at 02:39:45PM +0100, Hans Verkuil wrote:
> <snip>
> > + if (vb2_is_streaming(&hdcap->vb2q))
> > + return -EBUSY;
>
> Why is this needed? Does querying the timings while streaming actually interfere
> with the streaming?
>
> This is expected to work, but if it can't be made to work, then it the reason should be
> documented here.

Removed in v8. Tested and it doesn't interfere with streaming, and the
buffer size can't change, so it's safe.

> <snip>
> > + case V4L2_CID_DV_RX_POWER_PRESENT:
> > + ctrl->val = 1;
>
> Huh? It is a volatile control, but the value is fixed?
>
> This makes no sense.

Removed in v8, I had this as a stub to stop v4l2-compliance from
warning, but the chip doesn't actually tell us whether RX power is
present, so I just removed it entirely.

> <snip>
> > + case V4L2_EVENT_SOURCE_CHANGE:
> > + return v4l2_src_change_event_subscribe(fh, sub);
>
> The V4L2_EVENT_SOURCE_CHANGE is never raised. It is supposed to be sent
> if a signal goes away or if the format changes, but I see none of that in
> this driver. That can't be right.

Removed in v8, since nothing generates the event yet. This
v4l2-compliance test now fails:

fail: v4l2-test-controls.cpp(1175): doioctl(node, VIDIOC_SUBSCRIBE_EVENT,
&sub)
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: FAIL

I do want to support this feature eventually. The Windows driver has a
complicated signal monitoring background thread that I still need to
reverse engineer.

> <snip>
> > + .vidioc_streamoff = vb2_ioctl_streamoff,
>
> Add .vidioc_expbuf.

Added in v8

> <snip>
> > + /* For applications that never call S_INPUT... */
> > + if (!hdcap->hw_inited && !vb2_is_busy(&hdcap->vb2q))
> > + usb3hdcap_init_input(hdcap);
>
> This doesn't look right. I think this is something you want to do only
> on first open, and then you can use v4l2_fh_is_singular().

Agreed and fixed in v8

> <snip>
> > + hdcap->vb2q.io_modes = VB2_MMAP | VB2_USERPTR | VB2_READ;
>
> Add VB2_DMABUF. I would suggest dropping VB2_USERPTR: we don't really like
> that streaming mode.

Added DMABUF support and dropped USERPTR in v8.

> <snip>
> > + hdcap->ctrl_rx_power->flags |= V4L2_CTRL_FLAG_VOLATILE |
> > + V4L2_CTRL_FLAG_READ_ONLY;
>
> It makes no sense for this to be a volatile control. I suspect there is some
> confusion about thi.

This control is now gone entirely.

Thanks,

Matthew