From patchwork Mon Dec 9 19:25:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13900335 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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 C6D041957FC for ; Mon, 9 Dec 2024 19:25:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772338; cv=none; b=LFQwunsTc5P9OE0In6Yf8SY/UXYWpwLk1ulhiu9fInAyCHzQn4izE7LW2We6MNVcmNOsC/qtgzBucHS4HlWikooOK0oiTkHrm2iTRDyOU0B7vVSrbLOwqest3RyIA0esh1mgIlTiY1RcBTjPfo0QE3hZYXtUbNDvfueHaK6MjMg= 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.160.181 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-qt1-f181.google.com with SMTP id d75a77b69052e-4676e708aeaso7091711cf.1 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=UxPl4b2E+BdrTwDyv4mQwbys1xJywccPHyylakgSfVWFp+cBcduY3BBPQPXqfqkfha 4jPZc0sg13sTRih5BEK1N0Py0gqyexAqqzJlAfax5nhhZ92qBwHHR0TZfrJaRWg5S3Km uJHAN2jk5CMYxNKhM78VS7KLSnDlJE2gvpM9Ywo7kyPI7wNkmbbAeqTvhZV5clVCCkyz H3JbNtRYQsTCrzG3k+5SWbsca2bezN4C0nRqIppUGDuMRdHrhCDe1NWfXSA2PNlPkEqP JWgTL8gybqFvwwY0MQjIMxpdkCSglAU036zGmwXwIH12zQ1ur64zD+B7wQCCdlD+fZeB uJ6Q== X-Gm-Message-State: AOJu0YzYhedmhrY11eSrsv5vY1edlOm5QCCtPYSUP3omT4/HFYY2KsWX a9hXKiMmh4Om/0+42P6u9vVQ//HiUZJWpKS8asc7PcWrKxX03qRgFtK94KNkvA== X-Gm-Gg: ASbGncsxRc/oi7ptQH7XJStFvEpTE8In27vN+gNBFEk0/sKKeaAXjUiYJTwO3zv1LNK 1QqKEnbBWG9GYcuSVAdSOg+CeSVm4FaXvhwBzsdyS3Gw3En92p8F/b4871LGRoIxzaiVcxwkh8N 4u3I7TlDaYHjbWBW7vv0AhBJy5z545XwpR/orNcBqtnZA15Y5viV8aNNTjFmSlwUZjjnlVHRzAi WNIWDC14GR5eYapK1E4sCCQ/9eh/e7Qu48i1UiUpqeYtlFkcvz8D3iZbsIn4zTNXdBqVt8Yf+YI HZOtxmB/x9V9uCDatr7mXMZv 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-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/v4l2-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 = video_devdata(file); + struct v4l2_query_ext_ctrl qec; struct v4l2_queryctrl *p = arg; struct v4l2_fh *vfh = test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags) ? fh : NULL; + int ret; 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 = p->id; + ret = ops->vidioc_query_ext_ctrl(file, fh, &qec); + if (ret) + return ret; + + p->id = qec.id; + p->type = qec.type; + strscpy(p->name, qec.name, sizeof(p->name)); + p->minimum = qec.minimum; + p->maximum = qec.maximum; + p->step = qec.step; + p->default_value = qec.default_value; + p->flags = qec.flags; + + return 0; } static int v4l_query_ext_ctrl(const struct v4l2_ioctl_ops *ops, From patchwork Mon Dec 9 19:25:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13900336 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 5048E157A6B for ; Mon, 9 Dec 2024 19:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772339; cv=none; b=tUfY3A4USSGlBEyNCCc3kcJe+mUILvr3MfEGTgljiNcrK2AZKGMCQc+kJx1Mo8Sm254Ae6XGaTjDM6da1KNk9dzw2WaTneoB38tb42J4uMl65u98tLxez/ZssPKHAtj5FnrJsvCU0aaQWgt34HMu1Ea3VGqtjBr9mqnfP61n0EM= 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.181 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-f181.google.com with SMTP id af79cd13be357-7b6da2d7884so61624185a.1 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=bAo7Ql3obKmpvuQFhChNUS8w5quvoTwvprAkCn08RMf02+eUx2dSEr7xpyaMkHg9if XGYixyiiTcxPcHF4QyrZPfRxrtaebXJcm7vdumTnFmh8f1lLO2LNrTpnxMrinZV8mbVP I2hpRES0IPEdRG8Y7FbMdZlTXmEz/ExhD9FmDxN+jwvWukodih/7dhjWLUlz+dngfGM/ t9+4kDtcmPF+zs4D50VLcS3G9zhlw0YxrmXzK+5yuD3syv/u0CA8x08TvDfkC5NH00U1 VbDsJoyzBn0fjwm5Z9xCfQgGP4Gbm46dhb+MZ7KDFlkt/63nJ19fYNXzTPv1MLBRtKrF /l7w== X-Gm-Message-State: AOJu0YyyeRchlq4mmWJ0xr7vf+TKk8b0pmj8Tnt6aphUfBlrBkbIvPsJ zWA2DEu75/JxypAQAne6MWxW/zGhc2UXRBB1g38fin4KYgBIECZ5G1Mjn+a+8g== X-Gm-Gg: ASbGnct1rKY1g+aDb3nNp/cv14amK1wPGZ1XSagoUHq+jSKCvjaKmRmfOVPfkZ2/uC0 xpSgAX3nKhoefuxmMBm0Yx7anxxA0lUrhcdbLqpjMzQzNW36cpLPuJLJfpxU5esyOQjvmlrnGDs cs5VPv9JGRt62C871pCRmF4f4l8W9HKOsL45uGmQCQNpxIoBrfZIFJiesl2u1cgOKTB6mDVS8e0 boVcT0U9AR9Q8V3JbI3rKlhLgUs/5Tul7jObbswROGfgUQVYVPgYokyOJa58MjbbgWnY+dB620b ykWg5bMV3F5HkXGFJQhtmOBJ 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-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/pvrusb2/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); } -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 = file->private_data; struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; @@ -521,13 +521,16 @@ static int pvr2_queryctrl(struct file *file, void *priv, } pvr2_trace(PVR2_TRACE_V4LIOCTL, - "QUERYCTRL id=0x%x mapping name=%s (%s)", + "QUERYEXTCTRL id=0x%x mapping name=%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 = pvr2_ctrl_get_v4lflags(cptr); pvr2_ctrl_get_def(cptr, &val); vc->default_value = val; + vc->nr_of_dims = 0; + vc->elems = 1; + vc->elem_size = 4; switch (pvr2_ctrl_get_type(cptr)) { case pvr2_ctl_enum: vc->type = 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=0x%x name=%s not mappable", + "QUERYEXTCTRL id=0x%x name=%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 = { .vidioc_try_fmt_vid_cap = pvr2_try_fmt_vid_cap, .vidioc_streamon = pvr2_streamon, .vidioc_streamoff = pvr2_streamoff, - .vidioc_queryctrl = pvr2_queryctrl, + .vidioc_query_ext_ctrl = pvr2_query_ext_ctrl, .vidioc_querymenu = pvr2_querymenu, .vidioc_g_ctrl = pvr2_g_ctrl, .vidioc_s_ctrl = pvr2_s_ctrl, From patchwork Mon Dec 9 19:25:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13900337 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (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 2186619884B for ; Mon, 9 Dec 2024 19:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772339; cv=none; b=KwyACy9L2jDYw4vNDjQTlhV1KGopur5Td0JYlVg92i5+zDqwyTfZWV/8X8vrTFN4sgTFmhHkgvKwdaYRqBZORUtb2tDJC947/SMovjgo0frGxt0dH8xwHGyY+JhkATKlcoQuWP9aXV26NLmz5dSl53v7op/ffKJWgSEc/U6N/VA= 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.44 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-f44.google.com with SMTP id 6a1803df08f44-6d8d44e177cso44947146d6.1 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=K0p8VGtzoHlj93aW4ZVy/fHObpyUArkyJaGUXwNlUhiU8RFacsFbG92pO8FLwaXMeT 8Cd8QJnsF5Xy2aRbYJ5CHHSpey5Qgwjm0afRmQze1vutyIyJSTzO7+XVh/jysdR8HuM4 fiv3FURRKCDNubbkN+gNsRiaMlAHo52FqCAJkIU3JtmfCeW341CrU3uT04dTXtNBeNps EmFu5ZVQxwEWQa1/ovNkf4ny2larTUXCnXWiXiM2W1sz6Ka/rZPtkOYrRoYqrd3m+qpa qa9KmEwOEqq9kj9ssSSRNcku+CL2BX2tw02KGWF1CwTRLgyJBemFXyMFi0L8oHMKTKt5 gtuA== X-Gm-Message-State: AOJu0YzOdVZdUmmCqupDH7VVgRGQ4cWqTrzgo1nx26s9K1E22j9U+rls yQYhdizgsE5/kRoXwbx1mGA3Jimxqh2Ui0G87D7F5lQ1FRPzyJJLjDFWN9Lnrw== X-Gm-Gg: ASbGnctwxY+olJJt2MKfDfbtAmOPirjPXvUH+2q70N6DkzxQ57b7dN/gU+yFs8qhrZi /jBR03eUTwl3tOr7UZvHAw6ej1ZhTmGk4YQ9i4xkUyRW9utokTYiHc5pPM1IT51HLg3o6/UnEYF yzhI2K/WCfXMJ6EbsJq+DfKmHErTYs79airgz+vGo2m4cMiRKxHtWZVNRDzxPRdBoNGNtVuRwo0 CHyZK3QXf+6obKuKC6/M/e7SeElrcrrw6pEQEj0vtwHA6cudKaSc9rZM7aDutFlCoo3+YbuMqwK ZTO4DZwYKughI20xEyy3qfTk 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-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/pvrusb2/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 *priv, struct v4l2_querymenu * return ret; } -static int pvr2_g_ctrl(struct file *file, void *priv, struct v4l2_control *vc) -{ - struct pvr2_v4l2_fh *fh = file->private_data; - struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; - int val = 0; - int ret; - - ret = pvr2_ctrl_get_value(pvr2_hdw_get_ctrl_v4l(hdw, vc->id), - &val); - vc->value = val; - return ret; -} - -static int pvr2_s_ctrl(struct file *file, void *priv, struct v4l2_control *vc) -{ - struct pvr2_v4l2_fh *fh = file->private_data; - struct pvr2_hdw *hdw = fh->channel.mc_head->hdw; - int ret; - - ret = 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 = { .vidioc_streamoff = pvr2_streamoff, .vidioc_query_ext_ctrl = pvr2_query_ext_ctrl, .vidioc_querymenu = pvr2_querymenu, - .vidioc_g_ctrl = pvr2_g_ctrl, - .vidioc_s_ctrl = pvr2_s_ctrl, .vidioc_g_ext_ctrls = pvr2_g_ext_ctrls, .vidioc_s_ext_ctrls = pvr2_s_ext_ctrls, .vidioc_try_ext_ctrls = pvr2_try_ext_ctrls, From patchwork Mon Dec 9 19:25:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13900338 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 F2FAB1990A7 for ; Mon, 9 Dec 2024 19:25:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772340; cv=none; b=lN7veF611AprT1F7WN9U4TI8RmGTzG/vKAtALMafc2tU8BkUE4M+2xxZJx6BJLemor3E7FcangFoEF+3DvE1M7vd/8Zuz/scfxgkkCBFP537oZsDQRyzZ3ET4UrenahPJUpU7XsR/c/68w+9AcpDK5NHuUTsQE7fREuLMKKgLkk= 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.180 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-f180.google.com with SMTP id af79cd13be357-7b15467f383so415481085a.3 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=v689jCRdV6rS6BhCbFP0hFwwrZkgNJ1PIiSfQtacIBwSR3UUGZ4gXoKOzpzuC5QA7X usDEJ0qbz4kUPVSi/l1NP5hTtvoDTvRWi+uV5GWsiwyt/JFDlplV1J5p78CGXcNLKWuC iqnHApM4qyDuG6TPmSdIBL/F3X++rcY322hyP037yUtUIxUYQj0wbf9p06TiYO5PgDKE 89AKTlGujuCbPQB+4G0+x1MHZgGVyL3pQMbjz0wQoAPE5niJsLf7k67UVXmy/Z98ZnJJ 84hmVL9JFItVhU3t9HiuTXweqOIM9CIIOig/Qwf5S5rhXZrA60axZRRc6IrzMRfCH6Ra hPjw== X-Gm-Message-State: AOJu0Yw35xqGmUJDGE+5UEy32tqE82GO1Cl+VKk9An3UKoCP7rTG62Iy ZDbJt1vj/wgjrXInm9RqKHrbuPnSbetQ7AS4dG/OyRb8egc5XD6MilnV3cBSCw== X-Gm-Gg: ASbGnct6gUMxF2jYqzLNXScyalvcPTyqYWzi/InQHuL5Kn3gcBeaWSVyoO7UXpUwiX1 DXVQcyeHBOD8KBcQ4z9gYadtEU63ocNxa7YWsyeOjqWxgrAK04h3DnHj2KB7PFIQaXpGBb6YR7Z +GHaYW23g88V8h0oSPDk3B5AKw4pKIiB7mwuAIPu5QWgx4HiuDD2IQiGyovHABvI/1n4lbSDPb/ eyUGv00suGr+kWnkliUHr2aMcHm1M4cIM5rup1mHHA8sIdVaOiz3TOL/JSUCWiVsGMoMD4W3cqf OaRlJJsuYoVNy5eoeMaOi6/M 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-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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_v4l2.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; } -static int uvc_ioctl_queryctrl(struct file *file, void *fh, - struct v4l2_queryctrl *qc) -{ - struct uvc_fh *handle = fh; - struct uvc_video_chain *chain = 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 = { .vidioc_enum_input = uvc_ioctl_enum_input, .vidioc_g_input = uvc_ioctl_g_input, .vidioc_s_input = uvc_ioctl_s_input, - .vidioc_queryctrl = uvc_ioctl_queryctrl, .vidioc_query_ext_ctrl = uvc_ioctl_query_ext_ctrl, .vidioc_g_ext_ctrls = uvc_ioctl_g_ext_ctrls, .vidioc_s_ext_ctrls = uvc_ioctl_s_ext_ctrls, From patchwork Mon Dec 9 19:25:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13900339 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 09B54199249 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-6d8edbd1a3bso23221576d6.3 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=FSnuLYPbCbnp8TIvlDEj6cctqGpdC+QSbACo2QuZiyGzqaGVWm0Vtpxc0F6wy1JD/E Ae3JEmC0SW+kcUDMWNuYOrWENIGH/pVOoP9ymTMgiQSQarmJwldsDHmibx2ZmoHwcYJG fed0c6Jg+vRB0jzgT0VaS+GlKNvyHIxchdXOUiiIGi5vEBpWVYb2y3ivTrdqqyCDamTh ydUgIMVBQudUbAbrRlQq+BKvcj2ccS0enG5PTb2nrVcvgcJEOZF7aDl1pQmQgb/lUVb5 Cy+JpIsrIrcWfuIEG1HKuuYiPJOgM+QJgm50ufFT5obCCZ5dmmTwlUH2VLUYGZt0pG4B lHBA== X-Gm-Message-State: AOJu0YzqFFJyPXRp6oIUngA3MQ+22nUHQKOcoNiLZ7BPxOOGWufKxReB u+TmuQ94RJMNH+rMYC8P4u94OAawZH04F26XopbDmP78IjMwzmSS7Nqf9R7CrA== X-Gm-Gg: ASbGncvnIXIP9rPZysygUtVahs034c6ASU8viz5heaWteKkNkYePoXto/3OZnQnBMcs Er586LVWp8iHsouWAgRV3uekVusvUnX+FQTDPu/mViJrQlLxz3uyPwFSF1wMDa8rqfdDLZ/oMTI cPpJSlzAzRJgvMe7Jp5eJUWtKJiw6D73vEyVTvX2qT2LxaC4pqxFhjbrI0urR6pGvB0aDv3SSEZ i/E8ROojsjDxXeyNDtMIexg9kyFmBR3ehkYdDT7oHwPl/A0gk8lwqmWHixuMkIksuzt/aw7GF+Y NxFJTzkCpsmLZchlp5TGGaSm 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-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/staging/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 = "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[] = { +static struct v4l2_query_ext_ctrl ci_v4l2_controls[] = { { .id = V4L2_CID_AUTO_WHITE_BALANCE, .type = V4L2_CTRL_TYPE_BOOLEAN, @@ -1140,31 +1140,35 @@ static int atomisp_s_ctrl(struct file *file, void *fh, /* * 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 = -EINVAL; + int i; + /* TODO: implement V4L2_CTRL_FLAG_NEXT_CTRL */ if (qc->id & V4L2_CTRL_FLAG_NEXT_CTRL) - return ret; + return -EINVAL; for (i = 0; i < ctrls_num; i++) { if (ci_v4l2_controls[i].id == qc->id) { - memcpy(qc, &ci_v4l2_controls[i], - sizeof(struct v4l2_queryctrl)); - qc->reserved[0] = 0; - ret = 0; - break; + memcpy(qc, &ci_v4l2_controls[i], sizeof(*qc)); + qc->nr_of_dims = 0; + qc->elems = 1; + qc->elem_size = 4; + return 0; } } - if (ret != 0) - qc->flags = V4L2_CTRL_FLAG_DISABLED; - 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 = V4L2_CTRL_FLAG_DISABLED; + return -EINVAL; } static int atomisp_camera_g_ext_ctrls(struct file *file, void *fh, @@ -1561,7 +1565,7 @@ const struct v4l2_ioctl_ops atomisp_ioctl_ops = { .vidioc_enum_input = atomisp_enum_input, .vidioc_g_input = atomisp_g_input, .vidioc_s_input = atomisp_s_input, - .vidioc_queryctrl = atomisp_queryctl, + .vidioc_query_ext_ctrl = atomisp_query_ext_ctrl, .vidioc_s_ctrl = atomisp_s_ctrl, .vidioc_g_ctrl = atomisp_g_ctrl, .vidioc_s_ext_ctrls = atomisp_s_ext_ctrls, From patchwork Mon Dec 9 19:25:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13900340 Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (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 5C67C199FAF for ; Mon, 9 Dec 2024 19:25:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772343; cv=none; b=cSwnpV8fOugb9vmW2mTXzhr92Q36bIwAQUgQJB8Qb0K2RrQvp0LZlxDl9ZcB6Slpf7GzlS1aUqY13L4s35gtdhAAjT3BOB2cqSjBJIMnczP1CsSsNNdJNenlv8ci//luEYJydqyvuT+e3rgSAQuImenOpzVYqcivpvPnfNABHBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772343; 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=JGRcoGiQ39SIjwzjmmCbgRCVw3HjU/N0nEnlSF4IjSDtB8Lrdm1WN26LYo9iFusZa5Y+hcTKeNxtOKnQMABIno0IkTmuO90PQtaF3vngWauMQoboNDiQIBzaw7J6FOna77FQFKGPFUTOVi1T/IhAq0WyT6rct5KrXzRlpBvEedA= 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.173 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-f173.google.com with SMTP id af79cd13be357-7b6cade6e1fso156027585a.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=RYF9clX5yc4RbcNYy4spXeqZnuPyoEwL5SxqP6cn033KMbl6aa3m83rXpzBAMHH/P5 C8/G6txbVp9Wi18wk66ScBCWfDTlkcCcc5BblgChoPb0Z0fBQGD4ncOjY6talSSpCd3r tfCWFmmsfVvQ44Bf0siRWSnzmkMteCvc0sUi2Vt+7DtXXA34NcEpmLBe2j92+b5PYcFP nHovc6WPhnXBHY9q9i4zvjev7x7Jf0tA3/6AcmY+BY5g5MMP6ls/m99czjeeMDDQX287 LpT24WSrHH57IiYEBqXMb+7q2+pvOks9MiwsaVGi7+BN0yFOjCRLtsmSYklxVP4K/ShG qeEA== X-Gm-Message-State: AOJu0YzramUo6pxYYffiqLZmRT0U2LFqwiXgQIuI6WMHTjsntVvfqMZP SC1xjqNYdVzHODfgUjxThR9sm5qL+cjj2qfy/5u2ZyEzSF6jWJ8iysadlrTqow== X-Gm-Gg: ASbGncuI4lcDnTkdeA2zHd4iNUQwRis9wlIITXU6zl4RjNvK3PhxYiNRkkpTfoPqTZZ UDuD/VJ3I933IUjLyqtBKV/3cWA7DXKgh0US5el5Gtas3pqxnvHYD0Po678v1UIIi1acCty4hAa yyZDB7djVJIid76uBY3Mx62aSJLVWCCZ55qFs5vw23PKLLHVZh+GZtviXVeo5xhs8N0NJzyfEkX zJVf/ZCq7f5519ew/IIoXCRM9uGiu2s492xzLMSD2KPCBBu093ak0yn85HKXi6pOb5i89+uFRSA NM0xXCZg0VrrMGsOEOnSQuwv 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-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/staging/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 = { .vidioc_g_input = atomisp_g_input, .vidioc_s_input = atomisp_s_input, .vidioc_query_ext_ctrl = atomisp_query_ext_ctrl, - .vidioc_s_ctrl = atomisp_s_ctrl, - .vidioc_g_ctrl = atomisp_g_ctrl, .vidioc_s_ext_ctrls = atomisp_s_ext_ctrls, .vidioc_g_ext_ctrls = atomisp_g_ext_ctrls, .vidioc_enum_framesizes = atomisp_enum_framesizes, From patchwork Mon Dec 9 19:25:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13900341 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 8395D198A01 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-7b6c6baf8d6so164524085a.0 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=Wlir/qaMWllloTstK/H5xKNtqD8DjybDE4DxYxJmWN8W6NZ0QWHxL0NI2DZNXJeoji dHHPu1i8A3VUlH1c1p4KQEFGiqKVmtAoA2cV2U6O7E3gJAhU28ij2BeSkvOtWwjohLrK wOrHUBvkoeM/GAHfhOOKOJask2Kq4+Unb2FOa8mf/YenwsvAG0enat/j8cfj7YmxzqOK TBcvXin2Df9KIt2u8GHTvTfMlWOnBDq7CL8C4m+exrd/1W6feaS7XCP6Wxoodjnw85IZ RDPk0IqWs9laP4U5mbnMqptrb6at8pGRsP0oudhazXaKCcniQHZgseUVONlt24BAKOyG A6vg== X-Gm-Message-State: AOJu0YyCPHmpbPyqpq/t7FHgaiPfu6WIceKCuPXQV8OQvpnNqn2DEGto 3C/19RBHZL5VktD9IETeQJ5HbQ8swkbhku9ZqxiIEpYIw7Rpwvx7Fx/plKBJ9A== X-Gm-Gg: ASbGncvFAigw7W2BJy4V8OzJohgLMFiH+36vf44GMjxvHBHo86F9b9/cvZz0P7a2QCJ zchs5e+JhpMSIwTrgo783FAO+EHN2g2iwuWQkL9k3Q6jJDW208q3lPO2Nka9aMOgZk8tmttWygK xs+2h/83n3lVD9KRw0gSVzyPJxhr9FvWECl5XOme3Mxncw0pWYgV3lrZ5oZ/mt/ebtW1mGqEkqo CBpDmyiPhUuBEpl+nvGgO0VOUkTdap3Gcw5fisTZCKuQ2nlwUW2nhNGcL5eoRlc6ILw6rJb52KE +0Oqv2n7vrsvvT0pkbXh/AqQ 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-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/v4l2-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; 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); /* 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, From patchwork Mon Dec 9 19:25:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13900342 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (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 3EB8419C554 for ; Mon, 9 Dec 2024 19:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772345; cv=none; b=ZfpbuVCrrMeQ82c1U6JwWx0f2d2VDRVw/YfDpblkA6g87ZlCjeoREBEiYzZfg1eO1Y8dj+1ZUbkks4pnOPjC7vB5gx9UlIEb+pG9xKg/9HuVFaRBE8wrI6DJCQrkUA3kcddnptx0vrW0yWGsv+60c/EwT2mxjvAU6HObUq/dVw0= 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.176 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-f176.google.com with SMTP id af79cd13be357-7b6c3b1ee59so181822285a.0 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=ry6jRtr+tlZxITlaKoO4adqxJGokCC/UeCOErLFDgv2n6o2VOigh5sH/AaKv/v0nop n7EeDSvjd6wbl0YULLA4158oH2aAfEdIBFL7A8k1qHy5nFG4GuTCw6hFa/uXBDilTaNv q8bYDEAjO8BhmIDO9GaVOnD5VY9IAX61BNDt1iOGn3Ad1RBy6Wp9gIdo1pO9V7yEKqMY MOiVLbPDqWdsyQYacmRJsCGnIlGODOtkwdOPV1u2UE+AWnSlVdZgaolBm2sHJ/Ueh3VB tlPyg9usSJ76KJ0F40TKYxVmEOm3bFPk8aFyHCXnZIE6K+uEQw4Y0FMPy0aNDpofcdqd vICQ== X-Gm-Message-State: AOJu0Yy65niaCWC14Tml7k0QhiYZi730Z1f699kT+PWg7f0DK9AEu967 YBmEf3xKN5hcGdlEVcFZDFZ3bWHuQfsH4rh/hgz/s9i75f2tXfEuFtrIhXIpbg== X-Gm-Gg: ASbGnctCpSIBdqibsp5TBFLBnCuQNAzL/xXKOAidHo8n5/tDR5Qe5ZhiFTBdIv/AKJD wlbvUxaYyOcj5P+fDpuQGNZLcW8EvZhLX/xPLVN2m0uppUKh5PRyIqoVQuUFLZrAbLVJnFbHp26 gTy69AQnYztpi/nWKVs6h6RmGybK7lRZScIcElw6lAZ4PN/Pfnpb9ikKmwvMtkxcBYH5VwA7C2J Km72VeHja/XAG3mFcdUjNO0TigbFweoBpt5Ox8MveSpT2TYK6LNIrYJ98vh03ZRySIXo1i06HPG 7gHHwlXBRPy9wFnUA3Kv8dJs 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-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/v4l2-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 *ops, 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 == NULL) return -ENOTTY; 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, From patchwork Mon Dec 9 19:25:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13900343 Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (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 E616119CC24 for ; Mon, 9 Dec 2024 19:25:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772346; cv=none; b=jXxs3v+UvQaK+fSRWVXEkHcBdAWl+bYa8b1BcOKTCAPIaOcNUsdbTLgBbAdzGQx4deiBETnlsSq+/V3aV7ard7IdGDiqWJ/VtTUriBFAGOPVmxiWwIUru2kyTilkUBteXo1IriU400fF6qPmGO0QJY/SbdQh0xIQMIYhTXyMyew= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772346; c=relaxed/simple; bh=YVfCDMG+ewVwUxyDDbbSOUAdz+veaEMx7LKaz5GBLvs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ro/0i8+TDXjP0mkA4thYagKDaUlPUlzdZzzjTaN1bQIhICh6Sdaj2UpObWJdwrHIWQzm2Ls9JOKrYJ7xOMt/dH+V9PnV+oPVd3BIR7yhn6EvsiqrtS6gdWqPz5CMRaC06m9Tx1Q+08mcegBWBD3Vr/Q3+RHlO44jAfsCjSyjI4w= 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.178 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-f178.google.com with SMTP id af79cd13be357-7b6d07c7d84so131705585a.2 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=nSizvh0L5RVVD5WR+SPalsX90rd1y+jNJzhnlBF97qX6N/v4qS9K7OqfFHfKG5Hznz pNbVW6sExxqJOIq8ZEuPyIG2AKZBeTKXQuWmI3eQXEpP+IITLRFwIc18x8ueVkbnuvpZ QE/+dquF1dDLZ/wyPPa/avKyiq16NJMSb0woWzHnTot76b2uNHjmrJIzQ2dzxTJ5v56m mkw8nr4295M0ibbkAOKP10c7tpI/liz8453eUFlVmY3+o+4jF5gzcnuHGvXoD6skcj0I cujKtaSn+3Gzv65pnMIwR0ld0x/G5XYEafgQ9ypw7HXY06cdxc38ib/8vQYz4k/j+jKK HMfA== X-Gm-Message-State: AOJu0YyveOb5gj2YBMl7C0kGphgPheVSs9k5NUWTQiFCqIaK6vVqoPf4 KCpZ0t9eNJt8VqyVLlq26UUhhDPU4+b+Dc644VsmFZrXGxUVYooNm+Z5iJwr+g== X-Gm-Gg: ASbGncvWYribwMrzWE8vduVCvbmwFNo96xa5cTe7rp/+s8UmrDQzaB3RYgz80PbiXwr xrvZE0WeXhU/NK/Ff3rliGBCtmzJ3E9d1L3EySPiUySdUY09LBeaNlQgU5jMxc7LdbQ4oOVFUQt vyAaQlu/QM9o65QYeGKYy9GrFVFWhRZzpelk3d0YfUCpZI1V6uIZf+jjuaU3xIk+vupbLrOL4Nv 3iuf/wUgvga1PqSGH99nrcdExs5gGfFn0t5MAKaEvkbQuBJBAyXkm5u+bcm7wTkv9fRVd1jm7fe oe4fzTihYSvnYJ1ePiKj/OfY 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-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/cx231xx/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 *priv, v4l2_std_id id) return 0; } -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 = video_drvdata(file); + struct v4l2_control ctl; struct v4l2_subdev *sd; + unsigned int i; - 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 = 0; i < ctls->count; i++) { + ctl.id = ctls->controls[i].id; + ctl.value = 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 = ctl.value; + } + dprintk(3, "exit vidioc_s_ext_ctrl()\n"); return 0; } @@ -1627,7 +1634,7 @@ static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { .vidioc_enum_input = cx231xx_enum_input, .vidioc_g_input = cx231xx_g_input, .vidioc_s_input = cx231xx_s_input, - .vidioc_s_ctrl = vidioc_s_ctrl, + .vidioc_s_ext_ctrls = cx231xx_s_ext_ctrls, .vidioc_g_pixelaspect = vidioc_g_pixelaspect, .vidioc_g_selection = vidioc_g_selection, .vidioc_querycap = cx231xx_querycap, From patchwork Mon Dec 9 19:25:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13900344 Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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 DD41419D075 for ; Mon, 9 Dec 2024 19:25:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733772346; cv=none; b=SCB4Yq6UPLPK/e/dqUwcwE1G+wBE7wG8P1LZ72h3BKKMIy1WDJLtnnONYsNlOrYkotwsrzvEl0ENKIGhLLYHZ6nxCaXHU7l99mLdD2bvip6ZzTH27uiXH/QsSoBsbGctDowcmdB75HhHkfnLuxsL9y87YMRmLcHsEHnJ5EbhjBU= 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.181 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-f181.google.com with SMTP id d75a77b69052e-4676f1a43dfso5859671cf.1 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=cEIGeMIHKHfiIZDZk2tSA26DjtbaiUGGdVpxGxUikFPwHQH/DD1i6zR2KI95iTcW1z U0Dsi1q/6PnjsW4SM8DnQtEyhUJMxeXKkq1LTDPpXEHw/xTNQ5sn0VMIvwA11siGZC/I IPOuOSKtbLQWgrIF4sXDt0rdAdpIQLNC2bZcuGo4s+JI2JmcVEBv5qpcTaIgbULwh7L4 aiUWbx4BtFwil7pNV4LUniNx+J8Ns8d7wDgOGy/2BvErodEai5gMinuoDfVM2gGvMxej 9IGi+vVrJUWyJGdAbRn+sLJX78aCVD7d3KykS86bHHkFSqLe5ex3xbmSiHqlhnBH1255 XzfA== X-Gm-Message-State: AOJu0YxITWQvE27noiAJFw48tf1TRs3ptHxdKImDXoh6I568KVMcXjmR Zwhm2dAKFZXNgMh+2DQARaE4Sp3QbcfSg0euqepjEOqtTTPF9IFiyz8pPuCa0Q== X-Gm-Gg: ASbGncvH6F+2NX0SY+3GScz8Z1DTDkHWMleNuqJ5RY6mUuYZePQPUOB1UnRA7okLHuv c4+1g5HnHqUp9X9HdYkN/PdlskVKmZLzcE3ssDTgHVG8KfSuNUCk0GNj+jmzyZ/rdbCMgfP3Caz rFswp2XqYYEjCYKoqDx4j2l6XDGmrJM2K9mjFTcyrT0PXmKRBci8CK1dUCwYA8VC6YQSgxv3syB dLLJYaXsfpsJIgGQ6FOJ/o/gIV0Z5OqSylmnsP78iYbRjiJE60l7f6v0pg2IZ6h//vDclZoW7SP RIc/nSvOPcuQRTYc1t0uuTY8tgUB 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-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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/v4l2-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 *ops, 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 == NULL) return -ENOTTY; 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,