media: pvrusb2: fix control enumeration with V4L2_CTRL_FLAG_NEXT_COMPOUND
Subsystems (3)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 media: pvrusb2: fix control enumeration with V4L2_CTRL_FLAG_NEXT_COMPOUND
Since pvrusb2 implements vidioc_query_ext_ctrl, applications that enumerate controls with VIDIOC_QUERY_EXT_CTRL and V4L2_CTRL_FLAG_NEXT_CTRL | V4L2_CTRL_FLAG_NEXT_COMPOUND (v4l2-ctl, qv4l2) reach it with both flags set. Only NEXT_CTRL is cleared before the lookup, so the search starts above 0x40000000, finds nothing and the enumeration ends at once. v4l2-ctl then falls back to probing the user-class IDs one by one: the MPEG encoder controls are not listed and "v4l2-ctl -C" can't find them by name.
Mask the ID with V4L2_CTRL_ID_MASK like v4l2_query_ext_ctrl() does. pvrusb2 has no compound controls, so NEXT_COMPOUND needs no other handling.
Tested on an HVR-1950, kernel 7.0: v4l2-ctl -l on the video node lists 9 controls before, the full set including the MPEG controls after.
--- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +1 -1
@@ -510,7 +510,7 @@ static int pvr2_query_ext_ctrl(struct file *file, void *priv,if (vc->id &V4L2_CTRL_FLAG_NEXT_CTRL ) { cptr =pvr2_hdw_get_ctrl_nextv4l ( - hdw, (vc->id & ~V4L2_CTRL_FLAG_NEXT_CTRL )); + hdw, vc->id &V4L2_CTRL_ID_MASK );if (cptr) vc->id =pvr2_ctrl_get_v4lid (cptr); }else {
Signature · 1 line
2.53.0
This is an accidental duplicate of the same patch, sent two minutes earlier:
https://lore.kernel.org/linux-media/[email protected]/
The two are identical. Please ignore this copy, sorry for the noise.