[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ea79ef0-ceba-43b3-9190-7a92c823e3d2@kernel.org>
Date: Mon, 8 Dec 2025 12:12:39 +0100
From: Hans de Goede <hansg@...nel.org>
To: Ricardo Ribalda <ribalda@...omium.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org, Manav Gautama <bandwidthcrunch@...il.com>,
Martin Rubli <martin_rubli@...itech.com>
Subject: Re: [PATCH v2 2/6] media: uvcvideo: Import standard controls from
uvcdynctrl
Hi,
On 8-Dec-25 12:02 PM, Hans de Goede wrote:
> Hi Ricardo,
>
> Thank you very much for doing this, this has been on my own TODO list for
> a long time, so it is great to finally see this happen.
>
> On 19-Nov-25 8:37 PM, Ricardo Ribalda wrote:
>> The uvcdynctrl tool from libwebcam:
>> https://sourceforge.net/projects/libwebcam/
>> maps proprietary controls into v4l2 controls using the UVCIOC_CTRL_MAP
>> ioctl.
>>
>> The tool has not been updated for 10+ years now, and there is no reason
>> for the UVC driver to not do the mapping by itself.
>>
>> This patch adds the mappings from the uvcdynctrl into the driver. Hopefully
>> this effort can help in deprecating the UVCIOC_CTRL_MAP ioctl.
>
> ...
>
> Question what happens if uvcdynctrl is run after applying this patch ?
Answering my own question here, we will hit:
drivers/media/usb/uvc/uvc_ctrl.c: 3166:
list_for_each_entry(map, &ctrl->info.mappings, list) {
if (mapping->id == map->id) {
uvc_dbg(dev, CONTROL,
"Can't add mapping '%s', control id 0x%08x already exists\n",
uvc_map_get_name(mapping), mapping->id);
ret = -EEXIST;
goto done;
}
}
So uvcdynctrl will see an EEXIST error. I think we need to add an -EEXIST check
to uvc_ctrl_add_mapping() )or uvc_ioctl_xu_ctrl_map() which is the only caller of
uvc_ctrl_add_mapping()) and if -EEXIST is returned do a uvc_warn_once() that duplicate
mappings are being ignored and return 0 instead of -EEXIST to avoid breaking existing
userspace.
Regards,
Hans
Powered by blists - more mailing lists