From nobody Fri Dec 27 11:43:48 2024 Received: from mail-qv1-f42.google.com (mail-qv1-f42.google.com [209.85.219.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E87C0197A68 for ; Mon, 9 Dec 2024 19:25:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772338; cv=none; b=hTbzBP8ioaOPx1M/K9xwguHI9/JsLa3JRY8iI+EbkcXS2BsuQ5uFeRe6sEkEeuIgiPXRnQXD9Vu7d7mSG05uJbTcMYARpT6rbFMgXKkjlA/+wpG5d6xrzYlWHEw2WHvW4soP8XsQjmXWVCGjx4LvjdLrbLCIRpXp6q76sszL+O4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772338; c=relaxed/simple; bh=EY8oqmKTiUV81iDV12LiEs5fxLsbZtTGDuxYmfLNCp0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UbmrdbOGzrlv2Gaf3uuLzrrte+ASlwVINOorX74PSGY+Z13iNkkHQjqIxPqWoRJivSbJuWIN9esWy0Dk2TaCHtPhdsYLajXyRl2tYJ7H314dZFn/IJYVyEw8nQpw3hioO7baAn2EX/AOFwyK8li82rn7AsowAQq4MeyOU9fSnuk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=eDl8YVIC; arc=none smtp.client-ip=209.85.219.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="eDl8YVIC" Received: by mail-qv1-f42.google.com with SMTP id 6a1803df08f44-6d888c38841so37742336d6.3 for ; Mon, 09 Dec 2024 11:25:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733772335; x=1734377135; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ALuCNiC6NiBbAaZWJ7ZF+lCNq8dvy5S4QphoAjogwrE=; b=eDl8YVICjG0HdP+oStEBU76cEvD73LNGZQr4bUC3PDPQJmWs7MzS8TFDsg/zZuBS5j yYuDMdi5DgpjIQ/0YWuz6/Bl3DagroPNpJyjVOQ4E6Ip7/B1MMSGcCH+uuPFoxVarOGt Cb0J8FRa92vYKcg0Yi1HDY8Zf92Bpn/xFfOxA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772335; x=1734377135; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ALuCNiC6NiBbAaZWJ7ZF+lCNq8dvy5S4QphoAjogwrE=; b=JR7E9Z1CFKjNv4iMVXa3Dt1quxvE1MyLxTWTTCD+JEILSnEu0RpRAqIGAEnfdU5UlD tkUeV43D7rW+67D9bEeZHP4inNGSVjNHOL7qNv45tmGHlwTq6rOrCB1OENhDIhWP7t54 0+2WC9iHF7PqT4x6A/xjJiIffCQ1yuNpo9K5shAXlJ1sNWGeIEAcwRrf4OwvbxzzvULm e/fAgCnSNX7aszs4npenCzc9NABSq0gvAY9bquc4degDD0Gv+t5DNpTudmO6kOvOM1/A g+Xv9O5+LNpgb+1WSbTLKiaK9mqba0g07QWzpmabroiUiSGnRUXG0lNsBKJi3kAGJInu TeLw== X-Forwarded-Encrypted: i=1; AJvYcCWvdLYGRB2fVtMXvXUgWYXNuWfwGiGlZ71tOU+a260fBmy/JjxodZCOMbhEjK+ojtkpYC0o+yJ6beNXn6Y=@vger.kernel.org X-Gm-Message-State: AOJu0YxHVOFSXd6V7fD9rrf8ZpegPVWzpArvDq7xfO0ajngLIYfrmc53 4zBu1Wqfd5196CRUoYvcYrddeO0rzCoGnl3Y2laVJ2m+1HybhJrvpDgFCI4cUw== X-Gm-Gg: ASbGnctiIEOj9Mo2AHb+ofOsaf+wo7ZzMnOBIf34P22yfMy/WXGGjUaXEssQnBIyAFf jSrzEdU16a6abkWu0boEvP8bwqcWFRjUOdk1CcSbV1NhoFqh83fZSkRnls8Y8qp6P/5x2pWU+iz GOdazKt5bsBbMkrIqZmvVyGLjqJuw3FlmTHbjPfWccYNAg0Srs7Vf0cIDaUQEdJU4E8YALETYIn CRM3qsr/POfR6PMDsyoCwvbq4H5nUTWh2VioObfQmly2J8ybJh1eddw1wZMGUl1b75woerDbw6J 0dUV9/w5Lla5OnRApRZtrqGS X-Google-Smtp-Source: AGHT+IHsk+VHbWui+xY2odwllC141usB+LpKAHlP2mMq7yUmbaK9+La1b1tTbukiapbv37JDSVTxrw== X-Received: by 2002:a05:6214:5086:b0:6d8:9002:bde2 with SMTP id 6a1803df08f44-6d8e71a8c8fmr234897486d6.28.1733772335566; Mon, 09 Dec 2024 11:25:35 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b6cc1cf6fesm217433385a.102.2024.12.09.11.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:25:35 -0800 (PST) From: Ricardo Ribalda Date: Mon, 09 Dec 2024 19:25:32 +0000 Subject: [PATCH 01/10] media: ioctl: Simulate v4l2_queryctrl with v4l2_query_ext_ctrl Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-queryctrl-v1-1-deff7acfcdcb@chromium.org> References: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> In-Reply-To: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 v4l2_queryctrl is a subset of v4l2_query_ext_ctrl. If the driver does not implement v4l2_queryctrl we can implement it with v4l2_query_ext_ctrl. Suggested-by: Hans de Goede Signed-off-by: Ricardo Ribalda --- drivers/media/v4l2-core/v4l2-dev.c | 3 ++- drivers/media/v4l2-core/v4l2-ioctl.c | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v= 4l2-dev.c index 5bcaeeba4d09..252308a67fa8 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -572,7 +572,8 @@ static void determine_valid_ioctls(struct video_device = *vdev) and that can't be tested here. If the bit for these control ioctls is set, then the ioctl is valid. But if it is 0, then it can still be valid if the filehandle passed the control handler. */ - if (vdev->ctrl_handler || ops->vidioc_queryctrl) + if (vdev->ctrl_handler || ops->vidioc_queryctrl || + ops->vidioc_query_ext_ctrl) __set_bit(_IOC_NR(VIDIOC_QUERYCTRL), valid_ioctls); if (vdev->ctrl_handler || ops->vidioc_query_ext_ctrl) __set_bit(_IOC_NR(VIDIOC_QUERY_EXT_CTRL), valid_ioctls); diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core= /v4l2-ioctl.c index 0304daa8471d..a5562f2f1fc9 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2284,9 +2284,11 @@ static int v4l_queryctrl(const struct v4l2_ioctl_ops= *ops, struct file *file, void *fh, void *arg) { struct video_device *vfd =3D video_devdata(file); + struct v4l2_query_ext_ctrl qec; struct v4l2_queryctrl *p =3D arg; struct v4l2_fh *vfh =3D test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags) ? fh : NULL; + int ret; =20 if (vfh && vfh->ctrl_handler) return v4l2_queryctrl(vfh->ctrl_handler, p); @@ -2294,7 +2296,25 @@ static int v4l_queryctrl(const struct v4l2_ioctl_ops= *ops, return v4l2_queryctrl(vfd->ctrl_handler, p); if (ops->vidioc_queryctrl) return ops->vidioc_queryctrl(file, fh, p); - return -ENOTTY; + if (!ops->vidioc_query_ext_ctrl) + return -ENOTTY; + + /* Simulate query_ext_ctr using query_ctrl. */ + qec.id =3D p->id; + ret =3D ops->vidioc_query_ext_ctrl(file, fh, &qec); + if (ret) + return ret; + + p->id =3D qec.id; + p->type =3D qec.type; + strscpy(p->name, qec.name, sizeof(p->name)); + p->minimum =3D qec.minimum; + p->maximum =3D qec.maximum; + p->step =3D qec.step; + p->default_value =3D qec.default_value; + p->flags =3D qec.flags; + + return 0; } =20 static int v4l_query_ext_ctrl(const struct v4l2_ioctl_ops *ops, --=20 2.47.0.338.g60cca15819-goog From nobody Fri Dec 27 11:43:48 2024 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6832017C990 for ; Mon, 9 Dec 2024 19:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772339; cv=none; b=C/AP7MErToXnRKTSDSPMP2T6Db98TMo4RqYc997raUsi+BnUANB5pts7xD8s4KMcX20RnaGcI5/llmKulXSCh4GecH0kGrhlXOlM1Xbe5ZykNoQw0wEe4I8eKW97jirHwbG3X2Z8tZ6vBn4kXq4cyMXoNB4wkHXcz+VaFWFHvOo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772339; c=relaxed/simple; bh=n8ESl2FNmzgV2J4Gu+GXBLuTnzpMfyubm8vIAlksLz0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tBbTC7+RfIzjCX27UfB6Gd/ZouEYUdlliWZLkaoXVc0+CqMvQIT8l6Up8GGwSLKzvzfxpsjX+LHwyVFeecylhuKtk06wQRp6dACTHH2S74ogG8Zh0KDfjH/WJaw1g5i70qWTC+MzseCP4wi5H8X2sAvxwjH39VRoHQD25jnLeYo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=VCwtBMaI; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="VCwtBMaI" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-7b6c2bc1d21so193270385a.0 for ; Mon, 09 Dec 2024 11:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733772336; x=1734377136; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=42cU5HndT5BBlsrtO6ikMSsiagZ6GECUgrygXPNYYzM=; b=VCwtBMaIEtcZLSJ5GhjTDwfRKvtrAASRUt7liqs5t+EgdA94NFfjpxx6RxICVoXAyA LUWmM+XpJu0S1EMNT2pUI1FoUoZxmm+8Atlvz1EgJYCPCp19CgBo4iWXQU1LTVZ1K6xw xqu7T38ksx5lObjlDtodsuttPf9hhHMwVWixw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772336; x=1734377136; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=42cU5HndT5BBlsrtO6ikMSsiagZ6GECUgrygXPNYYzM=; b=DDjwR28/UqPuPV6zCx7mHVhbYOimzWrWZ33rLuiXIuzKSmfVDh8l6OHJtLvEmsMXMe AmFQG2W46D1u0NQF03wARd85nSvZ5/AiL+18XTkJZox6G7wE4XTSl2M6q9ijps1LNuAt WT6Rk9tWQlKBPyub8z0wifUq5bqPq+BUx+2wgDtWPjrhZzjR7FKrO4SvluujZl+JMVwu G3Fe8YrE42S2GRCArVkB9u3MOOncCJH+DY1fSiO1jjCX3YgXpYIIsPmQj5AsgbDWCLmF O1dBvZKnfdVOHjRf3F0NFVgZkn+lU/iyE9bXa/PK9WSuQCpgow85XTUkCbRKJobC5P3U l2mg== X-Forwarded-Encrypted: i=1; AJvYcCUtnh0PAAn7F8xOGyhK+uJfF96xqVzAQXzAU5XD+oFwIufedvA2s+gcoCmwn4tupcJHiotZcYA2HmSUyiI=@vger.kernel.org X-Gm-Message-State: AOJu0Yx4UEqDRjVHQKE4cza1VouvuHYV3ZjCY/Bwl/BbfPNgqH3fxI+4 Yddespm7kvFtrbQIqjXa+BE36V2VbUIsxMpXFD0wWM52lA/tyWOsMYoF7Y8e2A== X-Gm-Gg: ASbGncv+TUxc6kXd4d+3i8RrnvygcV6DuqkOKOWxL4WVdmqOZllFGMm2r16+n8YIGBC Wbol45kJqCHg/QCzsT5Kjh1+cB4qh6ss2bg8hUXTc0f1u5jJf/pvpBrKP0xuRkXiFo5zTeuWEP1 Pj+0UiqrEca8/zvHHCkcwOPf3beCLaP/yNLU2XJd7EFLHAM1mvSgGtkNymbeiiLrBvX3ZAzbfNA UuYJGiRELjAP2T1H1zeLwAVbTAWazPC1A+GQMPwazBM+be8/PdIu9X58Ns91c11xKvKIcBZuexm CFzltDV/ES9Wsjo53QMDKkYq X-Google-Smtp-Source: AGHT+IEy6l30xGUpPrtDhWxzqtb+SOk5CYgv2g/6hAF9Khw34+20F7wqboI2TcspSBsyb30HCeEv+A== X-Received: by 2002:a05:620a:261d:b0:7b6:cbe5:4072 with SMTP id af79cd13be357-7b6dcee4214mr257887485a.61.1733772336321; Mon, 09 Dec 2024 11:25:36 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b6cc1cf6fesm217433385a.102.2024.12.09.11.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:25:35 -0800 (PST) From: Ricardo Ribalda Date: Mon, 09 Dec 2024 19:25:33 +0000 Subject: [PATCH 02/10] media: pvrusb2: Convert queryctrl to query_ext_ctrl Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-queryctrl-v1-2-deff7acfcdcb@chromium.org> References: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> In-Reply-To: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 The driver was missing support for query_ext_ctrl. Instead of adding a new callback for it, replace the current implementation of queryctrl and let the ioctl framework emulate the old function. Most of the fields are identical, so the change is pretty simple. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/p= vrusb2/pvrusb2-v4l2.c index d608b793fa84..7c8be6a0cf7c 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -497,8 +497,8 @@ static int pvr2_streamoff(struct file *file, void *priv= , enum v4l2_buf_type i) return pvr2_hdw_set_streaming(hdw, 0); } =20 -static int pvr2_queryctrl(struct file *file, void *priv, - struct v4l2_queryctrl *vc) +static int pvr2_query_ext_ctrl(struct file *file, void *priv, + struct v4l2_query_ext_ctrl *vc) { struct pvr2_v4l2_fh *fh =3D file->private_data; struct pvr2_hdw *hdw =3D fh->channel.mc_head->hdw; @@ -521,13 +521,16 @@ static int pvr2_queryctrl(struct file *file, void *pr= iv, } =20 pvr2_trace(PVR2_TRACE_V4LIOCTL, - "QUERYCTRL id=3D0x%x mapping name=3D%s (%s)", + "QUERYEXTCTRL id=3D0x%x mapping name=3D%s (%s)", vc->id, pvr2_ctrl_get_name(cptr), pvr2_ctrl_get_desc(cptr)); strscpy(vc->name, pvr2_ctrl_get_desc(cptr), sizeof(vc->name)); vc->flags =3D pvr2_ctrl_get_v4lflags(cptr); pvr2_ctrl_get_def(cptr, &val); vc->default_value =3D val; + vc->nr_of_dims =3D 0; + vc->elems =3D 1; + vc->elem_size =3D 4; switch (pvr2_ctrl_get_type(cptr)) { case pvr2_ctl_enum: vc->type =3D V4L2_CTRL_TYPE_MENU; @@ -549,7 +552,7 @@ static int pvr2_queryctrl(struct file *file, void *priv, break; default: pvr2_trace(PVR2_TRACE_V4LIOCTL, - "QUERYCTRL id=3D0x%x name=3D%s not mappable", + "QUERYEXTCTRL id=3D0x%x name=3D%s not mappable", vc->id, pvr2_ctrl_get_name(cptr)); return -EINVAL; } @@ -812,7 +815,7 @@ static const struct v4l2_ioctl_ops pvr2_ioctl_ops =3D { .vidioc_try_fmt_vid_cap =3D pvr2_try_fmt_vid_cap, .vidioc_streamon =3D pvr2_streamon, .vidioc_streamoff =3D pvr2_streamoff, - .vidioc_queryctrl =3D pvr2_queryctrl, + .vidioc_query_ext_ctrl =3D pvr2_query_ext_ctrl, .vidioc_querymenu =3D pvr2_querymenu, .vidioc_g_ctrl =3D pvr2_g_ctrl, .vidioc_s_ctrl =3D pvr2_s_ctrl, --=20 2.47.0.338.g60cca15819-goog From nobody Fri Dec 27 11:43:48 2024 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2404219884C for ; Mon, 9 Dec 2024 19:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772339; cv=none; b=RdImwGf6JsZ4gLx+8z/Yi5V9anvS1dcx1Hftd7RQfHApkzc28AQmsGZdGDGbPVw9pzyALOxthkSeETKOOJX9LFpoFKlO7jNGqci8Znh4b4edq+MJwP902gS4A00SZOWfB9eTqCUpcYcgmsoE+MkXazCAvouNqHaLvFDpYiPYXtA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772339; c=relaxed/simple; bh=QTPQ1DyM59FTFwoOCCInfTij+St4lWshfJMO2MNF9Jk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oBidjE4byME47WY7Tsv6hR7z77xPrEH4YgQaiTrQeBTtiV74TYhNsgHQD/CeLfDex+v56inFjZG8yu0Hf82KD37dL4b9PxcQ9E44SuXKCG6KTrLpAu0l+yOSvAE5sUF2U69JBYfpTJnnHsUU4j0u4mEEkulyO051zfHUCzaZlmY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=iIu4JGBY; arc=none smtp.client-ip=209.85.219.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="iIu4JGBY" Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-6d89a727a19so51436476d6.0 for ; Mon, 09 Dec 2024 11:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733772337; x=1734377137; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ldrzuJki4Bob493jggNorXy/00Sxo1CNpTeJmfaThng=; b=iIu4JGBYFJSNofCrIrysiSZl9FgvesfdhxENnmlefDM0UeeFchhFDA+My5CX+z4pPA 8Zf9kWY7mboSXqHCRLZ2PIgXIPg+3yZoswhJg0+HvcNkQ69et2SO2G7mvcfZQFjQH0kz HVaJ7aWizBd2cQsYf5o627aVW51ZCCx5/WR9E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772337; x=1734377137; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ldrzuJki4Bob493jggNorXy/00Sxo1CNpTeJmfaThng=; b=e77K/EYatIslbi1wZVn1bK9vNynZszy+L2FFcrC8gdr/4VFB6ttwtXaQOnU63apDvD 4A64FT5pWjH0DyUyTWTCVizmJKwnYA1OdcrhQqU+MkUCprYNhaTlp6/LIiLbd0PNB+Nf c2d99eqf6oUBBR6WKvLuk1jYgiZ+Cd9ow68u+BkuRh6svqv3AF58AsInX6HFJwgtwwmg 6BpvmHI84ijOKAPDsrA7fea/VbgqUp3jiCSNLhFO7Gh8XBLl2pomUI+PieyLZ8VDXMLH y+izt5HkJkR6uTIX2gqNICnRYzVpK+jErhZ9ZW50IFvMJarx/lp0o2zrxWgYT/ZtaE5L jR5g== X-Forwarded-Encrypted: i=1; AJvYcCWAjU4NCYEWd7dqPnxq0iq/UQYog2X7jAbzoYsY2UclrtGLnmgCQWzzIHyFBerCT6CU1kND9FEnJcalEXo=@vger.kernel.org X-Gm-Message-State: AOJu0YwShmrGeqnJ4iEfsFPXtMqNwiDGbBUTyLaDUi8iF97haRPcuSTu KvrTpp5XPLabr80Q1Zlzo+2QLLHWQNlsgZYMTqNWK2TlbD5C3ZIg+x14r65ckA== X-Gm-Gg: ASbGncuFuBm3ma4DAjO7ETlcWRegcSuMgFekNqH6n5NR/zd2+vqZyroe0smUxmGgCpP bcgX5NRSl+VP1S0MQTMEFPmjI6oiTrFBVM/JRjCRIhNEVjqMs6Q46Yi8fS7AhlJiQCwka9dikBV r80Y/Md/HHwrF8ZJS42kOgnZCfp3hFNJ2wOH+JW++SbkGqPIS5XMGKo0sfv6YaJ/fSseNbOPda7 ztivgsQpubl/ATSZyqgaRNAEvWdYXZfac7b8OvVjdovHtHU7Dz5KHGfQ/a6elqfx96U5z0vYoSv tqJAn9sj7voqd8sJcp/VeqLw X-Google-Smtp-Source: AGHT+IFHW0/0qUHG8qwMzURyamcTUPmaaCxTzs+9Cce4VEgPbFPUYI69YdWNaUrMvMWP46LE5wus3A== X-Received: by 2002:a05:6214:27c2:b0:6d9:1532:d8fc with SMTP id 6a1803df08f44-6d9212c7c65mr9382816d6.11.1733772337147; Mon, 09 Dec 2024 11:25:37 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b6cc1cf6fesm217433385a.102.2024.12.09.11.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:25:36 -0800 (PST) From: Ricardo Ribalda Date: Mon, 09 Dec 2024 19:25:34 +0000 Subject: [PATCH 03/10] media: pvrusb2: Remove g/s_ctrl callbacks Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-queryctrl-v1-3-deff7acfcdcb@chromium.org> References: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> In-Reply-To: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 The ioctl helpers can emulate g/s_ctrl with g/s_ext_ctrl. Simplify the code. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/p= vrusb2/pvrusb2-v4l2.c index 7c8be6a0cf7c..ad38e1240541 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -574,31 +574,6 @@ static int pvr2_querymenu(struct file *file, void *pri= v, struct v4l2_querymenu * return ret; } =20 -static int pvr2_g_ctrl(struct file *file, void *priv, struct v4l2_control = *vc) -{ - struct pvr2_v4l2_fh *fh =3D file->private_data; - struct pvr2_hdw *hdw =3D fh->channel.mc_head->hdw; - int val =3D 0; - int ret; - - ret =3D pvr2_ctrl_get_value(pvr2_hdw_get_ctrl_v4l(hdw, vc->id), - &val); - vc->value =3D val; - return ret; -} - -static int pvr2_s_ctrl(struct file *file, void *priv, struct v4l2_control = *vc) -{ - struct pvr2_v4l2_fh *fh =3D file->private_data; - struct pvr2_hdw *hdw =3D fh->channel.mc_head->hdw; - int ret; - - ret =3D pvr2_ctrl_set_value(pvr2_hdw_get_ctrl_v4l(hdw, vc->id), - vc->value); - pvr2_hdw_commit_ctl(hdw); - return ret; -} - static int pvr2_g_ext_ctrls(struct file *file, void *priv, struct v4l2_ext_controls *ctls) { @@ -817,8 +792,6 @@ static const struct v4l2_ioctl_ops pvr2_ioctl_ops =3D { .vidioc_streamoff =3D pvr2_streamoff, .vidioc_query_ext_ctrl =3D pvr2_query_ext_ctrl, .vidioc_querymenu =3D pvr2_querymenu, - .vidioc_g_ctrl =3D pvr2_g_ctrl, - .vidioc_s_ctrl =3D pvr2_s_ctrl, .vidioc_g_ext_ctrls =3D pvr2_g_ext_ctrls, .vidioc_s_ext_ctrls =3D pvr2_s_ext_ctrls, .vidioc_try_ext_ctrls =3D pvr2_try_ext_ctrls, --=20 2.47.0.338.g60cca15819-goog From nobody Fri Dec 27 11:43:48 2024 Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 061911990AF for ; Mon, 9 Dec 2024 19:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772340; cv=none; b=asNAJnpaYfOVJQejqhwbTC1dynaK0KxOgD0r9IbvjHgmJ45+M3ziNUzz1V9sYQcutWWH8WRfKrH+7dmBiuAlvOCKNs+LzouKi1YhZ1YTgOH9KguFlVnDnB+d28zJYvpdcq4yAvoEgnGtgebR8x90Zo5aX0eEyNFesXJz6Y05YaE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772340; c=relaxed/simple; bh=64tvBdAJsYjij/MYhZgHmQi1NAwPb0Ws3Nyiuj2wFEA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=nV2sn49wsX4+5BFL623aeMH+g4gcSnvzTOE0u22n/7qgkjB2fGFxFMKXxsP7hyN18v0FrArHuDJhVHy5Z8Unge/YLbdwEiMX5bhr1Zd2Y2eHYdrX8/bmzPtvefPM5LC22aMETqoGc/DjTIuS1AV87Y1HOBpzoCWQB4aHFEvLEwA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=j3J9HS76; arc=none smtp.client-ip=209.85.222.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="j3J9HS76" Received: by mail-qk1-f179.google.com with SMTP id af79cd13be357-7b6d6fe8b16so98083785a.1 for ; Mon, 09 Dec 2024 11:25:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733772338; x=1734377138; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=FjvmPnf8Z5eA5SFOWcK4xqjLhjw4Qhz4HdUq4wZg+ks=; b=j3J9HS768c3Ch4LlgB/MDrznPR/pg595aotX7TfjwmFVjR2ac+VnuiBAncyLub2zLG BaxyEfzr964Oqis7d9iVfNPFHXtOFrTJcjewHVoTw6oVM4mgJ4RtoSsRCn5PuloKELrV ZYNrVK2dwz/fY5T1ncqf+dibKvgdxbIJzbfrA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772338; x=1734377138; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FjvmPnf8Z5eA5SFOWcK4xqjLhjw4Qhz4HdUq4wZg+ks=; b=kD3e/20Nb0s6pNf1AtXs1sphJIPvwfMJz3eEQCx24kKhOZ8jXHHjn6/xOW9+DsPX80 nD+1oUiBTeTDflurDgwT6Fbu+VdDxv7JiW9nfuZPnRnnH+eLurYAMHorQRT0Ws4lJUqS 1w/vg0Qmg7PMRqo+oJ8Sw2sckBRjXn4pUibpimEtWGG78v1qx59s830AzGZkbK6wKrIe vIM7MIUUriRE7rSRU5A0nVgdKlg8AR0hzPcgPYh/+Q04g7WB7B7QRlRG8f/IXhz9LEDD tVhcRyeXvrArUTTIjBuTUSe34WXh2PS34CrD3+L9HUtfbW3MiUftZOD7HDRchu56fwhf wF/A== X-Forwarded-Encrypted: i=1; AJvYcCXkd7nc1NbLqReqXYNAB4rCUp6b9ubPgp56eeUiWrgF1wlhDN76LOvr/Tef0em68ta7Fax/uY+9rSYhl1Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yz4ewowGIMIuT8MGVzqFLUi5Bqcb5PmGhZaDdzJj4oibn5NSRrW NDMVk5x5s1r3r8lTyQN7y/pVsflyXPMG4aeV7VTq79gL9ie87hF5hl+ncZIGWw== X-Gm-Gg: ASbGncvMW28nCD8NCFVxEtIzgMSrb4vspvdkwhD8fWOdHI6Za7sUDArulCsOr0tQNZh Oco0KCxmbNJAM7henjsd5tvoRDZcoAT30DGJw2hLYU4wHkXfPdKsvEvSe/b8fmrGWUSRaKCzsNd DUeBOamRoPpK9Pn5sMt0vhzTEsds7FY6y1FTN+o8XAPB2R+YGnCT10D7tyd8QjNRRgE/hICSKmS IXZhAS+9ER4e6rQfXeTuEa3UDi2G6Vaq+kzTvNxAtFCSESPBfnql6q5TxLKDVJSFl298CH0QPTt l/N6iph7oixXL20T4jbYv4s5 X-Google-Smtp-Source: AGHT+IH1wzP+i+irxWUKaESGp3CH30PU34aVuj1OORJWuuu0GU8d5eHV3sDCSLEwq9q3e/12onKEKQ== X-Received: by 2002:a05:620a:8904:b0:7b6:dc74:82a5 with SMTP id af79cd13be357-7b6dcdcdcd8mr249752585a.10.1733772337958; Mon, 09 Dec 2024 11:25:37 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b6cc1cf6fesm217433385a.102.2024.12.09.11.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:25:37 -0800 (PST) From: Ricardo Ribalda Date: Mon, 09 Dec 2024 19:25:35 +0000 Subject: [PATCH 04/10] media: uvcvideo: Remove vidioc_queryctrl Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-queryctrl-v1-4-deff7acfcdcb@chromium.org> References: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> In-Reply-To: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 It can be implemented by the v4l2 ioctl framework using vidioc_query_ext_ctrl. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_v4l2.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v= 4l2.c index 97c5407f6603..39f0ddb6d01c 100644 --- a/drivers/media/usb/uvc/uvc_v4l2.c +++ b/drivers/media/usb/uvc/uvc_v4l2.c @@ -1014,15 +1014,6 @@ static int uvc_ioctl_s_input(struct file *file, void= *fh, unsigned int input) return ret; } =20 -static int uvc_ioctl_queryctrl(struct file *file, void *fh, - struct v4l2_queryctrl *qc) -{ - struct uvc_fh *handle =3D fh; - struct uvc_video_chain *chain =3D handle->chain; - - return uvc_query_v4l2_ctrl(chain, qc); -} - static int uvc_ioctl_query_ext_ctrl(struct file *file, void *fh, struct v4l2_query_ext_ctrl *qec) { @@ -1563,7 +1554,6 @@ const struct v4l2_ioctl_ops uvc_ioctl_ops =3D { .vidioc_enum_input =3D uvc_ioctl_enum_input, .vidioc_g_input =3D uvc_ioctl_g_input, .vidioc_s_input =3D uvc_ioctl_s_input, - .vidioc_queryctrl =3D uvc_ioctl_queryctrl, .vidioc_query_ext_ctrl =3D uvc_ioctl_query_ext_ctrl, .vidioc_g_ext_ctrls =3D uvc_ioctl_g_ext_ctrls, .vidioc_s_ext_ctrls =3D uvc_ioctl_s_ext_ctrls, --=20 2.47.0.338.g60cca15819-goog From nobody Fri Dec 27 11:43:48 2024 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 098F0195980 for ; Mon, 9 Dec 2024 19:25:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772342; cv=none; b=R1hLlxO9MtCX5IbQwgf67/t1r+qd0k6Q8kclu47VREAbPgCG2Tmkq5Y+xQu9oX4T6Ypt/u3CrM0UPRkdKClATzsYrHEuz1QxkC2ryho6LYgUnNYS++dt6Xui/ccivvYfLPE+3r3iX1vPpZSr/0z/BaS+4qs+5z5eWtVU3hz1Le0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772342; c=relaxed/simple; bh=3hn+UbgNRo1Vvg//E6tf3MH9DX6Es4eU9XONllUKPyw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tXN0SdP+a3eAboa841xFj75tl6mNRu6TWTuw+gCSzlRZ/XxXCGbOBKdL2rbmqWljHu6Ix+j3znFdetmBUzUt6EE/Glt6jEf3/ANeaG+k9aLMiBFprOxtqlEGLY4aIxZq9BPp87pV5IYK1HiEXadh6a8In9cJA7rhSZoex9Au1ok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=bLvxZVLf; arc=none smtp.client-ip=209.85.219.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="bLvxZVLf" Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-6d8a3e99e32so37967196d6.2 for ; Mon, 09 Dec 2024 11:25:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733772339; x=1734377139; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LZ2bYJmReZdYhWgrWqbpm/s7LwVM5L6DZW3JOy2ZqFs=; b=bLvxZVLfJsZBwDreq9bMF0xGQRIpteKVAZuJV7c2roC+c4knnOur5AydYTB4SmeDmh tBbbjv9xNPo/TqZMV1fw8TVIFnGh7tniypSQoSnflmJW2N+lFEqpz4kGGizYIJ9JruFv fAdnqVipkQtZXi/nZCz4OHJ2mfENiMg7JlwdE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772339; x=1734377139; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LZ2bYJmReZdYhWgrWqbpm/s7LwVM5L6DZW3JOy2ZqFs=; b=K8Ia0JkggXHIj4Ilbkk261g9D2H2c7ufnexhL4i1tXrqmg2te816qEOLi/dVP+Y6wg oQ4/S9OvtqWC3jr5Sm6Oq5NueR1jG1S8Uamu6qWqLzqpSG2kQlVxzFIJe3u/+bhLHY84 u7cdZfas+W48p6EwaYiVdcykiqjrz+trvPnEh/L3himrHvHiKyFh7F7G67APO4f3fLU6 Qzb62Xa0hjFOQvtWJU0tG5+DKltTRySgQOpykpvnpRiSgIzv1AKEjltpGfkgMG8Vnff7 SipN00bc/WouziAXUPJSpJr2GycXJNF/1XOLTmlf6ntOWYwsNcunNFBmxV7gcvTyjikH 4SPQ== X-Forwarded-Encrypted: i=1; AJvYcCXBnEAG1ujBvZjZCnv1MM752En5k7aHcrIwfx4gZ1d5yyoXyfMkzjHrpzHqxmSuKVT2ZSXTDbeyrie/YwI=@vger.kernel.org X-Gm-Message-State: AOJu0YxJggeLoGh/tKL96b5U5hjVcDzTAklbxu1qFFzM4c4qQitMqb6r wnC4ZIkcj8SsHPyQNQshzJgCGIr3RzEAXLx/IX0ANGekWd2Z+dthpJ/eElfxDQ== X-Gm-Gg: ASbGnctwylkN6/d/oVbJm65RCadvWVkAIzQW8gOLZKwzKFp30szULWKmaCIF2JAA9Pz 1CSATqiuU2df7MpSdkcsLWLpxw33TLV9+Iwd6pmZ0EpIrVugLQROaB4y7zKkycCU9ABWplobybJ xPeqEwgFRjFZEMd13kWju+jjNKcjOkoriZXpNkU3k0oj7Pm3HnAQb9kT9OX1yMpTxGcR5HoL8UR VokB8dogiLCy/2CLR5WFqWjdUvaLgxnHPRlw9p0XvUsdtR9dtC3nqA6SLxKD2Je2aTxoms1nBU8 M03FuTjVHQXk7LhUNUhlxahA X-Google-Smtp-Source: AGHT+IEEzHN2lOcUckbzOhPkCQcj1XO3mZCg8zUBijND4xHIzep7iljKXyw3l3y8ggzjN0SCzkOjSw== X-Received: by 2002:a05:6214:d84:b0:6d4:1e43:f395 with SMTP id 6a1803df08f44-6d91e399f68mr25209096d6.24.1733772338843; Mon, 09 Dec 2024 11:25:38 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b6cc1cf6fesm217433385a.102.2024.12.09.11.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:25:38 -0800 (PST) From: Ricardo Ribalda Date: Mon, 09 Dec 2024 19:25:36 +0000 Subject: [PATCH 05/10] media: atomisp: Replace queryctrl with query_ext_ctrl Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-queryctrl-v1-5-deff7acfcdcb@chromium.org> References: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> In-Reply-To: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 The ioctl framework provides an emulator of queryctrl using query_ext_ctrl. Replace our implementation of queryctrl to support both. Now that we are at it: - Add comment about missing functionality. - Remove superfluous clear of reserved[0]. - Remove ret var. Signed-off-by: Ricardo Ribalda --- drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 34 +++++++++++++------= ---- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/st= aging/media/atomisp/pci/atomisp_ioctl.c index 1a960a01854f..d24420d8bd57 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -34,7 +34,7 @@ static const char *CARD =3D "ATOM ISP"; /* max size 31 */ * FIXME: ISP should not know beforehand all CIDs supported by sensor. * Instead, it needs to propagate to sensor unknown CIDs. */ -static struct v4l2_queryctrl ci_v4l2_controls[] =3D { +static struct v4l2_query_ext_ctrl ci_v4l2_controls[] =3D { { .id =3D V4L2_CID_AUTO_WHITE_BALANCE, .type =3D V4L2_CTRL_TYPE_BOOLEAN, @@ -1140,31 +1140,35 @@ static int atomisp_s_ctrl(struct file *file, void *= fh, =20 /* * To query the attributes of a control. - * applications set the id field of a struct v4l2_queryctrl and call the + * applications set the id field of a struct v4l2_query_ext_ctrl and call = the * this ioctl with a pointer to this structure. The driver fills * the rest of the structure. */ -static int atomisp_queryctl(struct file *file, void *fh, - struct v4l2_queryctrl *qc) +static int atomisp_query_ext_ctrl(struct file *file, void *fh, + struct v4l2_query_ext_ctrl *qc) { - int i, ret =3D -EINVAL; + int i; =20 + /* TODO: implement V4L2_CTRL_FLAG_NEXT_CTRL */ if (qc->id & V4L2_CTRL_FLAG_NEXT_CTRL) - return ret; + return -EINVAL; =20 for (i =3D 0; i < ctrls_num; i++) { if (ci_v4l2_controls[i].id =3D=3D qc->id) { - memcpy(qc, &ci_v4l2_controls[i], - sizeof(struct v4l2_queryctrl)); - qc->reserved[0] =3D 0; - ret =3D 0; - break; + memcpy(qc, &ci_v4l2_controls[i], sizeof(*qc)); + qc->nr_of_dims =3D 0; + qc->elems =3D 1; + qc->elem_size =3D 4; + return 0; } } - if (ret !=3D 0) - qc->flags =3D V4L2_CTRL_FLAG_DISABLED; =20 - return ret; + /* + * This is probably not needed, but this flag has been set for + * many kernel versions. Leave to avoid breaking any apps + */ + qc->flags =3D V4L2_CTRL_FLAG_DISABLED; + return -EINVAL; } =20 static int atomisp_camera_g_ext_ctrls(struct file *file, void *fh, @@ -1561,7 +1565,7 @@ const struct v4l2_ioctl_ops atomisp_ioctl_ops =3D { .vidioc_enum_input =3D atomisp_enum_input, .vidioc_g_input =3D atomisp_g_input, .vidioc_s_input =3D atomisp_s_input, - .vidioc_queryctrl =3D atomisp_queryctl, + .vidioc_query_ext_ctrl =3D atomisp_query_ext_ctrl, .vidioc_s_ctrl =3D atomisp_s_ctrl, .vidioc_g_ctrl =3D atomisp_g_ctrl, .vidioc_s_ext_ctrls =3D atomisp_s_ext_ctrls, --=20 2.47.0.338.g60cca15819-goog From nobody Fri Dec 27 11:43:48 2024 Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D07D19AD86 for ; Mon, 9 Dec 2024 19:25:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772344; cv=none; b=Q5ku/jXeskTBwzHwxeMhk8f5AwWeHNAITbHa4CXmeOMIY5r4mWTfUtJ+9MCCsiEVXeE8NZMFEic7uC9iZTx+SD+OT8/W4JU1qpFq4DeVomyh2GUMaOd3eRDud2pXoFCJn0ieQ1t4zmv0GGO3E8RhSnWrLvmrWMaKGkpYrvF31cs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772344; c=relaxed/simple; bh=qjgx+2RW+2qA3Kpo1t21oiWuDE038T0YMMKuiv+Fi0U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BgZ5jRnx4/Wqdik5CpWwK6ze0tltfoZ7MHQBsZmmoiIw9FBnQ/f6oi4UCl8XMbrsrPgczZ9I+fU6Wut2MPFDgVgKFixkypUxuXLH5qlKw6bmdCqoLlMlWzaBB/8U3YgrtWhgSOJK7mnx3Svmvif39+apoMOUPFaBodIPZfuSqEs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Yv7Vyq7p; arc=none smtp.client-ip=209.85.222.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Yv7Vyq7p" Received: by mail-qk1-f175.google.com with SMTP id af79cd13be357-7b6cade6e1fso156027785a.2 for ; Mon, 09 Dec 2024 11:25:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733772340; x=1734377140; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=bD/oB3rKRX6sl1z5Slf9ygtbR1yaEO5qPjqhHmqcVUs=; b=Yv7Vyq7pfI/rSU/66IqVKgaPy9znhSKlSLsEz3dmnOaCHgdhDvFdwQwv9QLe8U3RYg wch3e0i+OCftccYTws+9JMFKiVxEXs9KtO5wfDBN4FT5hE9hahFRhwP3NtvGv39DoXag 6eqyGunRRyf/kdrOw52x+MOo0hlA/uVqrEaRQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772340; x=1734377140; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bD/oB3rKRX6sl1z5Slf9ygtbR1yaEO5qPjqhHmqcVUs=; b=CqPS7hrhZlYeQVoie43MO9NQoOZRofgSyZh2tZDsKe0foFxa1Oeg/5zFpdjyLeUGbo R60Uk26WEogDTe1XUWCY3baS+1o/32G+YmEamalZRrGd0uMhnKlUfG9+mm6JfwdJZ6Yy FCMDuYKKmgLcTI6X7oiIu2jvj8bdhwlyd6LGqwsM+GWbwVzAr+QyaseabIHokADkeGvp hQzTKbMFOiH+U8tAmfU1WGaTJcuRghaueQX2bNhE5s+TZh4Kjblf1Uw33vOoG1UR8j6D 8ng1BZ5v8CReGkyvVDLcicIiC/1X1pkr9a1ZSnKEtgZX4s/l4f70crp2hOqXb0z2FK3i ZDYA== X-Forwarded-Encrypted: i=1; AJvYcCVfemL6xNgo2wvWFWL4goDBvgQ5B0rWXJecUZxZJxWz4hD9OCyfTrpJzbRe38/hFwoc10u2LgCXx5nE/74=@vger.kernel.org X-Gm-Message-State: AOJu0YxCFnRXCjHbrslEkefbAbKsM1aN6gsYOMc4OHeTgrJnZqHtDMEw VwRwOvI49TmJn99cZdH8g8Zn17HMijxbyMk5F3G2vC0lUsLIpyNDS/mIz+gdfQ== X-Gm-Gg: ASbGncuRJ1Ch7MP4RsVXx/DVxAwY0fKm3L99NcZbxuuoG9SRCFBvtm9sVCgfB0/dFOW gIbBQLid39nvh6R8tkRZn42VcEZfjt7SgT+BdX2jCDxBDPdLYnM/c3z1mznxsPpPA3jLd/o3xNs 0XmF9UKl6DOqJJSP/XmT62x2NQAD8QKBGxiqxqQG4151RACENWNNkXrdY0E1H1Mt9skCwh8Sfgx cRo4h0uARk3dVleSuiSU8sq1PELOEAUm84uyCU1IQcwV6+UZQL9HdizWuo5WKGu/NcJgZwl4mzI 3TXkksjypYRFdtTr6nHErFD0 X-Google-Smtp-Source: AGHT+IFFo3fcSdPum9b6G5uOLTbU7+t/CJfByumNs2Z5/XcG53j0L97A8+L9Fove8A9qec5bpHOBcA== X-Received: by 2002:a05:620a:450b:b0:7b6:cf60:3971 with SMTP id af79cd13be357-7b6cf603aa3mr1080045685a.22.1733772340240; Mon, 09 Dec 2024 11:25:40 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b6cc1cf6fesm217433385a.102.2024.12.09.11.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:25:39 -0800 (PST) From: Ricardo Ribalda Date: Mon, 09 Dec 2024 19:25:37 +0000 Subject: [PATCH 06/10] media: atomisp: Remove vidioc_g/s callback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-queryctrl-v1-6-deff7acfcdcb@chromium.org> References: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> In-Reply-To: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 The v4l2 ioctl framework can implement vidioc_g/s_ctrl with vidioc_g/s_ext_ctrl() and we provide those. These are the last references of vidioc_s/g_ctrl in the codebase. We can attempt to remove them now. Signed-off-by: Ricardo Ribalda --- drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/st= aging/media/atomisp/pci/atomisp_ioctl.c index d24420d8bd57..394b6f06246c 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -1566,8 +1566,6 @@ const struct v4l2_ioctl_ops atomisp_ioctl_ops =3D { .vidioc_g_input =3D atomisp_g_input, .vidioc_s_input =3D atomisp_s_input, .vidioc_query_ext_ctrl =3D atomisp_query_ext_ctrl, - .vidioc_s_ctrl =3D atomisp_s_ctrl, - .vidioc_g_ctrl =3D atomisp_g_ctrl, .vidioc_s_ext_ctrls =3D atomisp_s_ext_ctrls, .vidioc_g_ext_ctrls =3D atomisp_g_ext_ctrls, .vidioc_enum_framesizes =3D atomisp_enum_framesizes, --=20 2.47.0.338.g60cca15819-goog From nobody Fri Dec 27 11:43:48 2024 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 914B919B3EE for ; Mon, 9 Dec 2024 19:25:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772344; cv=none; b=OZ/nB9lJdHUlJFQy1QxEndMnHx7RUztVpoe9zGAIuPpSdINF1y9q6QK6D/BX9/rNqqERUyl5BZePwkn/SjQ6tAG63zOkzYQOeNA8DaVvMjKzvnk8RRAOzGhML33opxLvrpVCBNUq7yH6Zx4CSm+RJwSHylM7z3fCmVMJqmleHT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772344; c=relaxed/simple; bh=oaCq3lFHUlXWfLBs1yLgfb1pQhfpAzznJwSy1NrE1wY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gCLt+rG66IbUxP9eF4+FZIkx2UC7AJz5MtLC7a/0cKub4ocm3CcX9RrP9XVX5MzFon1y2fcSv5sJ7K2lF5oddXZIaIx+Rway6r14fkkHkn6PA0vaQMFjysAzLqORUBReu6jjMoefZAARlUf4xZOTZqdYs6D+MEyZlH0eB2/crKY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=m/fipHAp; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="m/fipHAp" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-7b676152a86so576765885a.1 for ; Mon, 09 Dec 2024 11:25:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733772341; x=1734377141; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ltErOm77Oh5lK6TbfQofWHlLQPTPm1Kvo+0ZzyBQyKQ=; b=m/fipHApLRWoXOYh7YusvwGzNf5CW5p+47YbogJlAMIOgzgXaOAdXFkic2X5Rfd02w /6cPL/kTauMxSls1e9w1oxjVPObxtFsaM194/hjD5vLQm42XHvbfgJK473TvFh9+yAlm RCFjKEq4lJ7twwDPXcwV36++P0ztVg8Y2QYtQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772341; x=1734377141; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ltErOm77Oh5lK6TbfQofWHlLQPTPm1Kvo+0ZzyBQyKQ=; b=NM9qne50y3KKVqSqkD9N0TWLFkhro9c3Jc17Na1OJvprwIjgNZJG2VhDHh2G2n56m7 PvFb2jnT9GBZ3YmQFkEHol3sxbBomD8U39iN8LOrNk5+d99Oar1BdXjjuAgEs8XBZho4 KCouBKWeAB/mC3CsE8btUaQMKzUXKcGh3Rw+MY8rBAG14Z4lo5XGbV3uU0jz9cpU+nh1 EX5i3xLJuG77Cr+E+XqJLdLNaE/uLsvgPXrXXqDI1pPG0zZgc7xislhQaqEwq0MIOaT6 MUvCTO7uMykb0vVWjUiS2b9MM8tNVcbZ2WvUOf5S1lyG6gLhu851PpYWlBU28HO/NCsd 4wHg== X-Forwarded-Encrypted: i=1; AJvYcCV2p0AutFyZOhRHEQEvbAZ/LQq4RsEDE7AJY4/e86Q1KdmMGQ+X9ChHDv1/2cKW1E9MHUMxmhx5IqFirvA=@vger.kernel.org X-Gm-Message-State: AOJu0Yy5SVLus74oTj1QQKRRwUikuusmqgrOuxTg1k3TbC0eEVXdlIrN mkK+tETxwJBCyuyBX9Pa9nLBW4LOVyxZi2byHAXj9BDCNEBF/jW7dMc6YhTE/A== X-Gm-Gg: ASbGncsy+k0rjkTY0Z3sv3myzlRfMxO+xq1sML4isXj/WEz4hs+u/ff31O6Aum0H4Eq dv3MJ0MRJIO9QtJgsCMBU7L3GNQf+7DdIBz6aHodcnKQ7qSxx6lNsw6KKKcb3XXNGc9JH0ajM1s MAWHYEKl3apqPJsGa2kJL+D40liqL41uNcFxbXKto+di8/gmyUo/3NhclqtA/cuIgqZkJmpgp4H ewUHkU5rnXsTP0TGPFl4353P7pVjRqPQAAIqCv41K6SHRcpO4sCdtD7pZ/Ee/cuKHeVyrkLe+NP tDCLjSbS5PjWDxTMVUZLEIW1 X-Google-Smtp-Source: AGHT+IEC8fFJCiNRaM0A+A/h+DVBohii9gw561GeeuVFgC5WSmzaiO9D+NgO5W3/1EB4ImZzjjZjKw== X-Received: by 2002:a05:620a:468f:b0:7b6:d0be:ca31 with SMTP id af79cd13be357-7b6de762d37mr79678685a.25.1733772341402; Mon, 09 Dec 2024 11:25:41 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b6cc1cf6fesm217433385a.102.2024.12.09.11.25.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:25:40 -0800 (PST) From: Ricardo Ribalda Date: Mon, 09 Dec 2024 19:25:38 +0000 Subject: [PATCH 07/10] media: v4l2: Remove vidioc_queryctrl callback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-queryctrl-v1-7-deff7acfcdcb@chromium.org> References: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> In-Reply-To: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 All the drivers either use the control framework or provide a vidioc_query_ext_ctrl. We can remove this callback to reduce the temptation of new drivers to implement it. Signed-off-by: Ricardo Ribalda --- drivers/media/v4l2-core/v4l2-dev.c | 3 +-- drivers/media/v4l2-core/v4l2-ioctl.c | 2 -- include/media/v4l2-ioctl.h | 4 ---- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v= 4l2-dev.c index 252308a67fa8..5267a0686400 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -572,8 +572,7 @@ static void determine_valid_ioctls(struct video_device = *vdev) and that can't be tested here. If the bit for these control ioctls is set, then the ioctl is valid. But if it is 0, then it can still be valid if the filehandle passed the control handler. */ - if (vdev->ctrl_handler || ops->vidioc_queryctrl || - ops->vidioc_query_ext_ctrl) + if (vdev->ctrl_handler || ops->vidioc_query_ext_ctrl) __set_bit(_IOC_NR(VIDIOC_QUERYCTRL), valid_ioctls); if (vdev->ctrl_handler || ops->vidioc_query_ext_ctrl) __set_bit(_IOC_NR(VIDIOC_QUERY_EXT_CTRL), valid_ioctls); diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core= /v4l2-ioctl.c index a5562f2f1fc9..30e32ce5278f 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2294,8 +2294,6 @@ static int v4l_queryctrl(const struct v4l2_ioctl_ops = *ops, return v4l2_queryctrl(vfh->ctrl_handler, p); if (vfd->ctrl_handler) return v4l2_queryctrl(vfd->ctrl_handler, p); - if (ops->vidioc_queryctrl) - return ops->vidioc_queryctrl(file, fh, p); if (!ops->vidioc_query_ext_ctrl) return -ENOTTY; =20 diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index bdbb7e542321..013996c33a9e 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h @@ -193,8 +193,6 @@ struct v4l2_fh; * :ref:`VIDIOC_G_OUTPUT ` ioctl * @vidioc_s_output: pointer to the function that implements * :ref:`VIDIOC_S_OUTPUT ` ioctl - * @vidioc_queryctrl: pointer to the function that implements - * :ref:`VIDIOC_QUERYCTRL ` ioctl * @vidioc_query_ext_ctrl: pointer to the function that implements * :ref:`VIDIOC_QUERY_EXT_CTRL ` ioctl * @vidioc_g_ctrl: pointer to the function that implements @@ -461,8 +459,6 @@ struct v4l2_ioctl_ops { int (*vidioc_s_output)(struct file *file, void *fh, unsigned int i); =20 /* Control handling */ - int (*vidioc_queryctrl)(struct file *file, void *fh, - struct v4l2_queryctrl *a); int (*vidioc_query_ext_ctrl)(struct file *file, void *fh, struct v4l2_query_ext_ctrl *a); int (*vidioc_g_ctrl)(struct file *file, void *fh, --=20 2.47.0.338.g60cca15819-goog From nobody Fri Dec 27 11:43:48 2024 Received: from mail-qk1-f182.google.com (mail-qk1-f182.google.com [209.85.222.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B16B199EAF for ; Mon, 9 Dec 2024 19:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772345; cv=none; b=kbbWFHtO0h4l/CWSx1aeY49kKubz9TKaElMJQJDIs2AlkCeA/MPRZ7/CsAfXwNw7uIPpmAUsIacveicBtarVxgYgNkL4S5HylBRi5V5A5oLI/eLw9MhzCoYnIDjzKZviIpoumX/Z6+i+YipvFd8EWtaW6lHm5hOTCoaNjo1v+Rg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772345; c=relaxed/simple; bh=3YJ9Y+ZQdC2SGtqO8a01crBHDOxCq7X/DFwMMUL8kxc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UTP2jfiPzLLVP0Qmq3JnTPxKdgMuuJr07V0A0GH+sJF8tHlPpT7pu6yGiEyGZA1lZZE09AB9IU8ztfwjw5qg9AxmLyqjLdF3htZySGdCFd3V8B8odOyA1LVeIFxG1jn/Xf9BbFT2hMAf5bMRqmly2xQ8xadzSdyEk3fe0+ErVag= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=JAyzBA/y; arc=none smtp.client-ip=209.85.222.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="JAyzBA/y" Received: by mail-qk1-f182.google.com with SMTP id af79cd13be357-7b15467f383so415487385a.3 for ; Mon, 09 Dec 2024 11:25:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733772342; x=1734377142; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sTWHjAR4u8Qk/v839F4GfzYW0oIRDw0e+cKCRcE0Tyo=; b=JAyzBA/ym+POLRyoUuP/5p+7uDsR9LvgdICoevXVoh9lUiXnI3VtN/Dv+21TTDDpai QUb+odFOe5SxIXD23+OAB2ybX/StIqpSH3ZsWWA2LlqgbIi+gPvjV3mGuNtV5s19Q+xa MhG+nJGF+QqUlwOrUd53NL9vBQJWQgNRDiQvg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772342; x=1734377142; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sTWHjAR4u8Qk/v839F4GfzYW0oIRDw0e+cKCRcE0Tyo=; b=jE4WZ/+zM7LssBF1/TZZ2uiXxDvrMLZWz04pyf7LDj1mg8rPfBACorUzgwnoAi0jWP DTjHF6ny/tdyKcWgYGiIOtIR8AZEC9MJjY/qEZSba+mFdk0vUupKB40MCtL9m8kq+yaG 2fJeb8Jg6XyFiEAFMOZCNVVUKydtxnZj+ErWoWcDle6ZCv4CPN4tUgOegRGtIjR4YOjL B7L+btn6mvbqiz7gAiR4nY5Odg9ImcbwJxV0vcX7PuPA/fldizfIm/IYiP3ctFCGHCAe lIi+mBhRZLzwgvP0jFnJQqiMdDSmoDOE+W0D7aLTjGIKw9nuqNKv7B/fuXZHQL+s4/VI BmXA== X-Forwarded-Encrypted: i=1; AJvYcCX/aNc2TkOY/Bx7kn9TgS5GwXt19CWA3ICzwxDjk069NTM/xxz9MAGjnTKsPps/FlzqGxLOaxpn5Hst92Q=@vger.kernel.org X-Gm-Message-State: AOJu0YwpDxoSNwJmzxmA+sXUynurzT2m6V2mfc0E0xcMmgpzELKKqWyO 9WavifOX2PuMAlt4E2lk22Jzj0bFUJgHXnxh1Y2JV47p0WagI8xj0bPr3Opfmg== X-Gm-Gg: ASbGncuruSezFr8soz4aoUmAtRcSA8vm2JOPtcU7ti4tbCb5c/0EjrVVAffvR2Qc3rB ntmij0vkN8jvgI6JlTO5+eLZ1Sp3wN7lvT6Li6FYeFm+tjSvdVX/MuXs25eq76A+gNC69mJnVzv 5JXEJ0IzTipXIY2wNsI4ub+uFs0b/AmF9bouWNtpAgjcrvdeLGDPUWn2t0BzJPqDcRvweSJfkaA 0yOq5XiMEt5KiBBs+Fy9GncdxoSTWcK4rvTjGLqWKvbatsWNDDUSi6sxC286pkfHIxmJZtEQA36 iW5zGBtKJctmaq8Q5gP+c47w X-Google-Smtp-Source: AGHT+IFX2iboYasZ2NAJeqVx58Ze6o0VlnPHCW1gi9xbgB3BYBf0YbNtsWkaDTB0PiB/STP6px6iRg== X-Received: by 2002:a05:620a:458e:b0:7b1:4d3b:d618 with SMTP id af79cd13be357-7b6dcea6f83mr267761985a.57.1733772342090; Mon, 09 Dec 2024 11:25:42 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b6cc1cf6fesm217433385a.102.2024.12.09.11.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:25:41 -0800 (PST) From: Ricardo Ribalda Date: Mon, 09 Dec 2024 19:25:39 +0000 Subject: [PATCH 08/10] media: v4l2: Remove vidioc_g_ctrl callback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-queryctrl-v1-8-deff7acfcdcb@chromium.org> References: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> In-Reply-To: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 All the drivers either use the control framework or provide a vidioc_g_ext_ctrls callback. We can remove this callback. Thanks for your service! Signed-off-by: Ricardo Ribalda --- drivers/media/v4l2-core/v4l2-dev.c | 2 +- drivers/media/v4l2-core/v4l2-ioctl.c | 2 -- include/media/v4l2-ioctl.h | 4 ---- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v= 4l2-dev.c index 5267a0686400..068ee67cd574 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -576,7 +576,7 @@ static void determine_valid_ioctls(struct video_device = *vdev) __set_bit(_IOC_NR(VIDIOC_QUERYCTRL), valid_ioctls); if (vdev->ctrl_handler || ops->vidioc_query_ext_ctrl) __set_bit(_IOC_NR(VIDIOC_QUERY_EXT_CTRL), valid_ioctls); - if (vdev->ctrl_handler || ops->vidioc_g_ctrl || ops->vidioc_g_ext_ctrls) + if (vdev->ctrl_handler || ops->vidioc_g_ext_ctrls) __set_bit(_IOC_NR(VIDIOC_G_CTRL), valid_ioctls); if (vdev->ctrl_handler || ops->vidioc_s_ctrl || ops->vidioc_s_ext_ctrls) __set_bit(_IOC_NR(VIDIOC_S_CTRL), valid_ioctls); diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core= /v4l2-ioctl.c index 30e32ce5278f..4e65d50bef27 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2363,8 +2363,6 @@ static int v4l_g_ctrl(const struct v4l2_ioctl_ops *op= s, return v4l2_g_ctrl(vfh->ctrl_handler, p); if (vfd->ctrl_handler) return v4l2_g_ctrl(vfd->ctrl_handler, p); - if (ops->vidioc_g_ctrl) - return ops->vidioc_g_ctrl(file, fh, p); if (ops->vidioc_g_ext_ctrls =3D=3D NULL) return -ENOTTY; =20 diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 013996c33a9e..4d69128023f8 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h @@ -195,8 +195,6 @@ struct v4l2_fh; * :ref:`VIDIOC_S_OUTPUT ` ioctl * @vidioc_query_ext_ctrl: pointer to the function that implements * :ref:`VIDIOC_QUERY_EXT_CTRL ` ioctl - * @vidioc_g_ctrl: pointer to the function that implements - * :ref:`VIDIOC_G_CTRL ` ioctl * @vidioc_s_ctrl: pointer to the function that implements * :ref:`VIDIOC_S_CTRL ` ioctl * @vidioc_g_ext_ctrls: pointer to the function that implements @@ -461,8 +459,6 @@ struct v4l2_ioctl_ops { /* Control handling */ int (*vidioc_query_ext_ctrl)(struct file *file, void *fh, struct v4l2_query_ext_ctrl *a); - int (*vidioc_g_ctrl)(struct file *file, void *fh, - struct v4l2_control *a); int (*vidioc_s_ctrl)(struct file *file, void *fh, struct v4l2_control *a); int (*vidioc_g_ext_ctrls)(struct file *file, void *fh, --=20 2.47.0.338.g60cca15819-goog From nobody Fri Dec 27 11:43:48 2024 Received: from mail-qk1-f172.google.com (mail-qk1-f172.google.com [209.85.222.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D131819CC1F for ; Mon, 9 Dec 2024 19:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772345; cv=none; b=pM7tQKEeezginPDUTWE3wDwX100ExuDJXAsyLUu9fKbIld45s/mEPpzYakamxg8gmF2qBRpkrz/VMIoWHgs3DkP3wFpvLrzsfask2SbMgzZ6p8uEQ+FjLPces4H8DxUXctjcI5+LD0BHIE3mYuHhuZEdEXl/QxWJNvCckVe5j3s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772345; c=relaxed/simple; bh=YVfCDMG+ewVwUxyDDbbSOUAdz+veaEMx7LKaz5GBLvs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LImj0TWBqNyGR1E0NA1gzni1zQk5D1flbTXJfCrbdmCiHnWxnhWGFo75DArp2PNCarYo4+udY3W1HRuJmnM6p86uHUc/e9zPm/fczJgCUCuORxrwVgNyVIDTLqPgnLyC+gyVUtvmGwRNl5VCSBYOMVMm6CSt89wyyblwVr/o2fc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=UGur48/o; arc=none smtp.client-ip=209.85.222.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="UGur48/o" Received: by mail-qk1-f172.google.com with SMTP id af79cd13be357-7b6d6fe8b16so98090385a.1 for ; Mon, 09 Dec 2024 11:25:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733772343; x=1734377143; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=L2k1H7nZ6EFiaX0ZIjONbwuF9mUJ/0XMhcmQKMZ+rwA=; b=UGur48/ozXYn0XUNvTuW8/Z0MIoh8wjLTbHOlPf57pyiN/ifs6VG8YP5cmqNzhhwKL 8n0kabYc0ADcrqNCo/IpJbyKSpasFP90PxKGRoaVaOieWY8njQsmXEhvoTH55DneoxM9 ZQRWOoJJokP5fSef33mBXg8o5Qhg4IVuUf4Qo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772343; x=1734377143; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L2k1H7nZ6EFiaX0ZIjONbwuF9mUJ/0XMhcmQKMZ+rwA=; b=L7tqEHRg/HZC0rj0jaHNyCBOpy9ROg6qc6ikPHwK0B4VR/V7IX3rs/FFNLWXPe8lxA V0L7lOGlI29hqe21mJYPvfRfuAb/xrAwnqonSTJpjoavoSL+c+3D+ju+v08tGM/5DWlo /irCT5gnpgVwrPQIKrqzrPoB1I7Q/yu0Tl0XoIn1YO1989UMjEvFYn4AKpV17UVZFl2Q +S4dH5Bn3g6RkqvLAik25pcSHNxqO1vO9gay+mJS0+KUbukExcA/UYnhOMz6L7S6FNwO tlaX//SEcSQaIHQBBjWlA8e8/ni4e6GxyUnVT+I1RO7XiAyJOOqZKoW1r0yB49epZIGb W3lQ== X-Forwarded-Encrypted: i=1; AJvYcCUSus1JHqcsdF/L306rSsk/matVjZ0RNNevpB0szySFZyQfYwfpQaExGYfVGDf3hwF9WkDqq97tGUdw8Tg=@vger.kernel.org X-Gm-Message-State: AOJu0YyFhrziQMiwst9GOpABGJ/bFL1EdsmUos8D/3b3Jstk0EE8M5gL UuAEUQAxnwUjRVAGLH4KqXS5AM6qg1mbRZ0QuF/dRgyIBkntbUU0AeFTiqiBjA== X-Gm-Gg: ASbGncvB5Uwx1U+shHE5AKjWByTeqJIXQdErt+T3+g/EORenpdhWfsLts01JFEkUEig qypbthxH5t25wmF34w8/NWfNBv43WQc1KfcZ0VifMneX6J8M1rp7mMwl6bcHITkC1Nj0WvWeGpf hCJ2lbrJt1sJ/6aKkc95JtFepCASZz51pldlv1GbGTs0ehymqM1mPfGYRPo7nacB4VAXd4Jm49P sUDFFZjK33VGlMBuluTrw6aUhyAHjzw7LPXiPUCIboq8BtuSD6FeXJ5KNVrE/2/qwvuljClVmff 8Pj/xLJms+Y1Mfyycmob888G X-Google-Smtp-Source: AGHT+IEEiNvdKrQR0ZlgT/dI9fWuGcmjgZ2kgyinLriV9vaeViM47DQlUbu8twZBqoLXdUvISKJmXQ== X-Received: by 2002:a05:620a:1918:b0:7b1:48ff:6b3c with SMTP id af79cd13be357-7b6dcdfe7c9mr246350985a.16.1733772342811; Mon, 09 Dec 2024 11:25:42 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b6cc1cf6fesm217433385a.102.2024.12.09.11.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:25:42 -0800 (PST) From: Ricardo Ribalda Date: Mon, 09 Dec 2024 19:25:40 +0000 Subject: [PATCH 09/10] media: cx231xx: Replace s_ctrl with s_ext_ctrls Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-queryctrl-v1-9-deff7acfcdcb@chromium.org> References: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> In-Reply-To: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 The v4l2 ioctl framework can provide support for s_ctrl. This the last driver implementing s_ctrl. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/cx231xx/cx231xx-417.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-417.c b/drivers/media/usb/cx= 231xx/cx231xx-417.c index a4a9781328c5..3c1941709ebf 100644 --- a/drivers/media/usb/cx231xx/cx231xx-417.c +++ b/drivers/media/usb/cx231xx/cx231xx-417.c @@ -1538,17 +1538,24 @@ static int vidioc_s_std(struct file *file, void *pr= iv, v4l2_std_id id) return 0; } =20 -static int vidioc_s_ctrl(struct file *file, void *priv, - struct v4l2_control *ctl) +static int cx231xx_s_ext_ctrls(struct file *file, void *priv, + struct v4l2_ext_controls *ctls) { struct cx231xx *dev =3D video_drvdata(file); + struct v4l2_control ctl; struct v4l2_subdev *sd; + unsigned int i; =20 - dprintk(3, "enter vidioc_s_ctrl()\n"); + dprintk(3, "enter vidioc_s_ext_ctrl()\n"); /* Update the A/V core */ - v4l2_device_for_each_subdev(sd, &dev->v4l2_dev) - v4l2_s_ctrl(NULL, sd->ctrl_handler, ctl); - dprintk(3, "exit vidioc_s_ctrl()\n"); + for (i =3D 0; i < ctls->count; i++) { + ctl.id =3D ctls->controls[i].id; + ctl.value =3D ctls->controls[i].value; + v4l2_device_for_each_subdev(sd, &dev->v4l2_dev) + v4l2_s_ctrl(NULL, sd->ctrl_handler, &ctl); + ctls->controls[i].value =3D ctl.value; + } + dprintk(3, "exit vidioc_s_ext_ctrl()\n"); return 0; } =20 @@ -1627,7 +1634,7 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops =3D= { .vidioc_enum_input =3D cx231xx_enum_input, .vidioc_g_input =3D cx231xx_g_input, .vidioc_s_input =3D cx231xx_s_input, - .vidioc_s_ctrl =3D vidioc_s_ctrl, + .vidioc_s_ext_ctrls =3D cx231xx_s_ext_ctrls, .vidioc_g_pixelaspect =3D vidioc_g_pixelaspect, .vidioc_g_selection =3D vidioc_g_selection, .vidioc_querycap =3D cx231xx_querycap, --=20 2.47.0.338.g60cca15819-goog From nobody Fri Dec 27 11:43:48 2024 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F085D19D08A for ; Mon, 9 Dec 2024 19:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772346; cv=none; b=IW/ZnDp9UuJ0tY0Gr8PI8nANVTU/4EFWlD5rTJkCMkwO743PR7tk79tY8fLDGERe8NWd5CJ79a/kuyKJFjDvbjhzkYYauKBODJUvdG7EbwU2l3K6E94YyuvM5pMjjXgCYZDpQ7Q6JjyqnLMfTCkhyby9gmwhzAQo9RiSMJilkeQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772346; c=relaxed/simple; bh=xfUwtSBU2RPjXRdqhWZRl04Dp2rWNk2bKx3bk1pDlLs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RTJNk7narwB6NdG5NAQ58h4fPdJQ8VIadlaOBzkPWZaS/3xekBzqWsHjnOwDOKpramOr6B3SigZ1FC+DEHe4pShiQ80t/XqL/hhoYuudkzTkvW3ULD0w0p1U2pOXq3q70XRnUSNYPcqw1WstNAaPJQ72j2jxmW/qmHSewBe3tn0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=esE9m3ti; arc=none smtp.client-ip=209.85.160.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="esE9m3ti" Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-4676e45234dso6157861cf.0 for ; Mon, 09 Dec 2024 11:25:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733772343; x=1734377143; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=T9/yEI3m3K/0zf7XJobUGHsXsYeP/0tT64hyQf5D30E=; b=esE9m3ti2XEeRVYi97pW99i/YHLerhGwRx3Qtba/kQtVKU5rSUMTfgc2JGXsy9C+2N O0zMu1ORSp6ycYAk6QWV4mDuBUsW9qYPxOB2DBMAeKgae0cQUNgR8A6Z3PHnSBvYqnW7 XzUSPjH9wsbzGjk37tVALwJAc2CIH4xnjbnhs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733772343; x=1734377143; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T9/yEI3m3K/0zf7XJobUGHsXsYeP/0tT64hyQf5D30E=; b=DE+7e7yuMk1zK+AV6DUG9m4/dhKnaP1A9UHns8sqo/cYSCmSccukk1hGJgoqzuv5XP okY6cNFSP/pSMyPc8oQaKtHSDW1f78NxLTR/RjvGtHbefMuExRexqCMj+e0Sr/3H5sBf pPt0yQBXna0sF7wu5HlkajoHRybrvkzJJ25rnJi2Rr8RCAjJnCvX7Sid7woViwaR2J/T BCpyL79/E4JED2vC3wfCJVMOlQ3kW+DAeJdCQWRwvEiJuWhkU3J5ZsHFZVE+gJlx6Fb+ sKti6nUJsTce85ZtVEgMttqfdsAxxsKNTMqsrtHAbNnyrFpls5T2Ei/2PWJqFRkkxS7s MTvA== X-Forwarded-Encrypted: i=1; AJvYcCUloWPZsOjIFZQ9Rf8nBYXeNl1s+kbvrkYyNeeR9PESHZegpQsnuDd7AY4wS4jYl3lwUQRQzmntvgv6q+I=@vger.kernel.org X-Gm-Message-State: AOJu0YzrUsSZxy7HDwOuzo3GJoH2XMmWYNarVAjVgoA73CwNO6xP1UVr EOAl+Q+Ta+V9Mb7qMs67eiPjGHeoEGAl1CQT6tVhrBQjFkV02sdj5uqaK0LyXQ== X-Gm-Gg: ASbGnctpG1JoWpnkW5ACFeScDmfIaCsuNf9kDwiaaA2Xe1t7jnm6tFGZ0eWO15GN/bz RBgkZS/5rKAsFyPUY4vwq/n6UZID58Rs7/8/sGGSQBs4bLwyz2wXU/9XTiylyjW8NYH63rrgeYF KU2q8t4R9Hx/bC8Yr5aLQX1xvFR5PEpvS6iRgnflYPs27AuxnH8PooJNZyuBn7BhBSRB9osNXJt SkP9RFsYtFGpSS+/q8L1537XB5KzTDw9IAFQ9f9bc5CxQ0CRBwrZZ05O1ezWweM7aR76nwIfFpv j6SwilqaL+a7gvnZKV80yWRYrr0d X-Google-Smtp-Source: AGHT+IHgsfDAcmQoVPz3OqjY4fsfStHe8w+bApIyZU3horEfuMPbagTTxS37mo+7l7Vwk3GrfCkZRA== X-Received: by 2002:a05:622a:1647:b0:466:93b9:8356 with SMTP id d75a77b69052e-4677528b6camr10363241cf.22.1733772343653; Mon, 09 Dec 2024 11:25:43 -0800 (PST) Received: from denia.c.googlers.com (5.236.236.35.bc.googleusercontent.com. [35.236.236.5]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b6cc1cf6fesm217433385a.102.2024.12.09.11.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2024 11:25:43 -0800 (PST) From: Ricardo Ribalda Date: Mon, 09 Dec 2024 19:25:41 +0000 Subject: [PATCH 10/10] media: v4l2: Remove vidioc_s_ctrl callback Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241209-queryctrl-v1-10-deff7acfcdcb@chromium.org> References: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> In-Reply-To: <20241209-queryctrl-v1-0-deff7acfcdcb@chromium.org> To: Mauro Carvalho Chehab , Mike Isely , Laurent Pinchart , Hans de Goede , Sakari Ailus , Andy Shevchenko , Greg Kroah-Hartman , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, Ricardo Ribalda X-Mailer: b4 0.13.0 All the drivers either use the control framework or provide a vidiod_ext_ctrl. We can remove this callback. Signed-off-by: Ricardo Ribalda --- drivers/media/v4l2-core/v4l2-dev.c | 2 +- drivers/media/v4l2-core/v4l2-ioctl.c | 2 -- include/media/v4l2-ioctl.h | 4 ---- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v= 4l2-dev.c index 068ee67cd574..b40c08ce909d 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -578,7 +578,7 @@ static void determine_valid_ioctls(struct video_device = *vdev) __set_bit(_IOC_NR(VIDIOC_QUERY_EXT_CTRL), valid_ioctls); if (vdev->ctrl_handler || ops->vidioc_g_ext_ctrls) __set_bit(_IOC_NR(VIDIOC_G_CTRL), valid_ioctls); - if (vdev->ctrl_handler || ops->vidioc_s_ctrl || ops->vidioc_s_ext_ctrls) + if (vdev->ctrl_handler || ops->vidioc_s_ext_ctrls) __set_bit(_IOC_NR(VIDIOC_S_CTRL), valid_ioctls); if (vdev->ctrl_handler || ops->vidioc_g_ext_ctrls) __set_bit(_IOC_NR(VIDIOC_G_EXT_CTRLS), valid_ioctls); diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core= /v4l2-ioctl.c index 4e65d50bef27..5a54e796086d 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -2396,8 +2396,6 @@ static int v4l_s_ctrl(const struct v4l2_ioctl_ops *op= s, return v4l2_s_ctrl(vfh, vfh->ctrl_handler, p); if (vfd->ctrl_handler) return v4l2_s_ctrl(NULL, vfd->ctrl_handler, p); - if (ops->vidioc_s_ctrl) - return ops->vidioc_s_ctrl(file, fh, p); if (ops->vidioc_s_ext_ctrls =3D=3D NULL) return -ENOTTY; =20 diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 4d69128023f8..c6ec87e88dfe 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h @@ -195,8 +195,6 @@ struct v4l2_fh; * :ref:`VIDIOC_S_OUTPUT ` ioctl * @vidioc_query_ext_ctrl: pointer to the function that implements * :ref:`VIDIOC_QUERY_EXT_CTRL ` ioctl - * @vidioc_s_ctrl: pointer to the function that implements - * :ref:`VIDIOC_S_CTRL ` ioctl * @vidioc_g_ext_ctrls: pointer to the function that implements * :ref:`VIDIOC_G_EXT_CTRLS ` ioctl * @vidioc_s_ext_ctrls: pointer to the function that implements @@ -459,8 +457,6 @@ struct v4l2_ioctl_ops { /* Control handling */ int (*vidioc_query_ext_ctrl)(struct file *file, void *fh, struct v4l2_query_ext_ctrl *a); - int (*vidioc_s_ctrl)(struct file *file, void *fh, - struct v4l2_control *a); int (*vidioc_g_ext_ctrls)(struct file *file, void *fh, struct v4l2_ext_controls *a); int (*vidioc_s_ext_ctrls)(struct file *file, void *fh, --=20 2.47.0.338.g60cca15819-goog