From patchwork Tue Dec 17 21:06:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13912512 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 66BEA1F9AB2 for ; Tue, 17 Dec 2024 21:07:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734469626; cv=none; b=ML6VeiuEspcq1TA684WFCMe7iHo4yEcXq16dSUhck6yCo54IbWrZixlFzWZ7eM4ki9kznOFIcOEBlQ0+qgMJg+eSgtvkrX0gvpkGl4w43OhbkdVMcukSpRJ0aJajCvpuRYcawJa4UgChlELJMOKo7dESCkHmrrDf/Ud6aH+vjaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734469626; c=relaxed/simple; bh=TMV/gS+pZ0eeGBOV266PLaY1f6B/qSj7zVYBiHN+BO8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pFBqylrXW399IRGX2cvRcxqtAKqJ8pXK4m1dc8Uu7hLia9F22EFYlJ0Iqes5KI/WxITEelg2MYtOpAh1Y15QhszqNj9onGLuinU0oS/lBkDuU2yfN6MHTtrWgssRv/zkXVUyOIQEjiJGr0EVzbgb/CMGr4Pb8nZGGx1tr5fiLnY= 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=UHNK5P0u; arc=none smtp.client-ip=209.85.219.53 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="UHNK5P0u" Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6d900c27af7so66088076d6.2 for ; Tue, 17 Dec 2024 13:07:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1734469623; x=1735074423; 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=YaRXnJufUgA+sZgOmkVmsImy13QD0OXBethBAiDBkw4=; b=UHNK5P0u81QTCtcfRXwvvoYGD+vqqODGbdhZ8malQF6ZnJPejPHgGMeBagjks8zDXH Z6QOtwMmcSWsqmRm+t0r7y4W+AftOM+x1TfUrhh9HSSrXLrMZ8u1UILVoCft2IAhhNeI LO3H2/1pK7DBU3RwXYt9/mR8e8C4YYIR9Ul+E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734469623; x=1735074423; 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=YaRXnJufUgA+sZgOmkVmsImy13QD0OXBethBAiDBkw4=; b=ir0pY9Y2j9cQK/+UKBsQwcU4Gp2fZMcRze4upS/AUSaPpU850948Zn9TbLRibH8s47 cLzvhrUzBhXKzM4CZY5W/GmprhIWrf71xgkbBwFdWC9UL0f3XOExG4ASiMIVCh2Ii/qR d+nxO8Ntrq1NyAG/3T1AYisuodnFZScpPZRN9Q0ANlSkKP3mlOx7x7+ypMxSpVeH1VY7 pS6jsi3R3WpOSjxsLq4Mqq04anFru/so/miKpti1hjXrTQdmqQrsFw2bPyuTqozsfLuQ vfX+b9sT1Sy8xyu5pPQLFuCkTlKLmdAnQaKFi3AElprhG4HILqBY2v5iZPd81Tl+zIpz kpaw== X-Gm-Message-State: AOJu0YzM3qZ3qSksozpg2sLJEFGUBe+Kco3h+tCyJxRSbxXG+fkmMCN3 RE0nOMe4m1Pxz08v4UZcvhnMJxR08B1jVEXsL5j3spOMvChhmBI+qxL++n2N3g== X-Gm-Gg: ASbGncuWFoJkOp3chNmsBiKosI9SWXPnHkVw60OiyfXyCHZHOMaOKasbu8MPVcVcb5R scEnvtDEYTzsHcWSfx1EhbC9kst43ldGwR1jSL5MgKFtrHB9s0UmYBE5FQt91VZz6bkMSVy1fH7 P6pDdKM9tl8ojWQQOpLfv+uvZrBrNd2WXYfn+cPoUvBlY0NcRc/opvwmMzOa08CTLx1TwbwpcDr Q1AxaTn2RW2YsdzPGZ+Nre4fD77xB0lmUSIw3d1IrOJoIXBJNyrdZtlXNahsxhRAPZ2xAYEyMIX DPpsP3jBTpEQr2PGrAgNhFqyreDhaY8= X-Google-Smtp-Source: AGHT+IGEXrMxy1WDPRLI/fTTdd0pTFr9WF7IHUP8Q3LLmBM2sJDZT64JK/AWifyLauuM9iWm29j/og== X-Received: by 2002:a05:6214:402:b0:6d8:9872:adcb with SMTP id 6a1803df08f44-6dd0923d060mr9539956d6.36.1734469623238; Tue, 17 Dec 2024 13:07:03 -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 6a1803df08f44-6dccd22f2a7sm42825276d6.27.2024.12.17.13.07.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 13:07:01 -0800 (PST) From: Ricardo Ribalda Date: Tue, 17 Dec 2024 21:06:57 +0000 Subject: [PATCH 1/3] media: uvcvideo: Swap default value for nodrop module param Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241217-uvc-deprecate-v1-1-57d353f68f8f@chromium.org> References: <20241217-uvc-deprecate-v1-0-57d353f68f8f@chromium.org> In-Reply-To: <20241217-uvc-deprecate-v1-0-57d353f68f8f@chromium.org> To: Laurent Pinchart , Hans de Goede , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 The module param `nodrop` defines what to do with frames that contain an error: drop them or sending them to userspace. The default seems to be to send them to userspace so they can decide what to do with the frame. Change the default behaviour of uvcvideo to match the rest of the drivers and maybe get rid of the module parameter in the future. Suggested-by: Laurent Pinchart Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index b3c8411dc05c..091145743872 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -32,7 +32,7 @@ unsigned int uvc_clock_param = CLOCK_MONOTONIC; unsigned int uvc_hw_timestamps_param; -unsigned int uvc_no_drop_param; +unsigned int uvc_no_drop_param = 1; static unsigned int uvc_quirks_param = -1; unsigned int uvc_dbg_param; unsigned int uvc_timeout_param = UVC_CTRL_STREAMING_TIMEOUT; From patchwork Tue Dec 17 21:06:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13912513 Received: from mail-qv1-f53.google.com (mail-qv1-f53.google.com [209.85.219.53]) (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 CEBB51F9F68 for ; Tue, 17 Dec 2024 21:07:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734469627; cv=none; b=cykEpV80J8NPlz89S5ioXm+CsDmJjk+ZHed2GYBnqFzlJzRaIzCnu2HWpzfuKWEBb6dyFvwAePQ7kMOnYw2VXbajrlx+tIkIYeKX6vC+8ngDK0gfVWuPjDP3d82zzi6J0L42xqT+maOOdz3mAlpA5t5/pc9YYhvr7YddzE31TSk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734469627; c=relaxed/simple; bh=KWINgD5ata/eDZY7THpzR0BBEKdcMhTmgSkDYYCfiIc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=atyxcTHYMKLM6bAV4PHRIYVS1w6ETXO31mxZU+iZNhYvhMTt5LUJGgQMT0lwDhjAu7W/YWz7PRVzDAJpPwXi0kWMGqyTXTXKG2jSDjMI7UA3sfwFDheSuueZXtx5EwEeX+a272MOlyIMCRdN5btM7wTV/E6lqy5iNLGf5zpVNWc= 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=MSDIlEc4; arc=none smtp.client-ip=209.85.219.53 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="MSDIlEc4" Received: by mail-qv1-f53.google.com with SMTP id 6a1803df08f44-6d89a727a19so1299436d6.0 for ; Tue, 17 Dec 2024 13:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1734469625; x=1735074425; 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=tzDVbtPPI6/PR4xHZ+uo8XhKlnVqNLbQOPgmtj8cDpY=; b=MSDIlEc4F3Md47Awgp+ZISXD6fmtw5DnG2qsq7B4Cv3CAJwjQhD12G5GxY1/UUo0O+ 1FsWGtiMDZn43RR/hDp/lyWQwIVwnr+YqIrXN1WEvuq7VwxMyL6R7yW8FQkIPKSI/X68 u5utrH1iE8uyOuKgbYzBMCgM+MCxizgjaLH/k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734469625; x=1735074425; 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=tzDVbtPPI6/PR4xHZ+uo8XhKlnVqNLbQOPgmtj8cDpY=; b=qPYSnl3FzCPbzKlCLaIXqcZBvjkKP4haZQhXBKzlrnaCVZpi05ory/vQl8A5eqSxE6 5/Rsf8gmvIB/94bKT1R1Kbu4UroH0JXUb6LHuhWv6ixRZGjWQF6Joi10uIHL5/t4PXAO 17KYWUVpIuczjeM+CTbWNI0txXJ7HgyFDXsRr+eDUVGfVbSURLbcQ0BrtCWIv7ZBkaTQ oWaBqVKVH9vD6VBjQSplVQg6eJaYxfUX6N10vzjrrDv9GiAY6UFUFdMCEaJHCRLSHVEp sGlxy6tF0iUSIrTCmTxqDgQGVjAXjNvGRTrAcvq1dDrkc2G+jZ4yXsMpHjZqcckGMkt9 IGFw== X-Gm-Message-State: AOJu0YyuoYFn8cfb/Szx37D+N7ktDm9Klf3bNkq01QVNoJf6Quwt+cBY FX+ELsG8/m4Jkdc+T44Sg3OVsq1EqSZUXfHj3UMXB3KE9EdAEF5104vGV4CPMQ== X-Gm-Gg: ASbGncvyw+0VpW4fIE4xLQNGKV9TZhoqcubOvzoMeSd3QBsI5WFFzgkCWZc6fdQwvty 5LeRYPIsBX3RG0aKImT+aayQdWK/zGOug5wZNC9m9iqDUp1v8kZudfzKSBq28MJL2InlNfTSoOm 7Bp8AsM1DMsCLFP0G7wUWLY6NBWsdeu7DuG/+ILio6VQbC824pin9rlwjJC7enTQyUFeikfjPas 2DCqvbV8e7TcgPaRTfoKWjvPeZwVHpFEg+Ugzcfp/kn9RZIFiwPsGeHdEbVtBVBB2u+W34Kyrs6 sQQFMBiBSmFCITc+Wz3c1ptME9ms9hA= X-Google-Smtp-Source: AGHT+IGX8riHqAG53Ns1JT9wSuOCfFOlraoLCjYZFxLDwPTGDlF0oXz/RZNF/7QUyo7aQ+ZSfrGJPA== X-Received: by 2002:a05:6214:501a:b0:6d9:fb5:d496 with SMTP id 6a1803df08f44-6dcf4c9e41cmr84982336d6.24.1734469624744; Tue, 17 Dec 2024 13:07:04 -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 6a1803df08f44-6dccd22f2a7sm42825276d6.27.2024.12.17.13.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 13:07:03 -0800 (PST) From: Ricardo Ribalda Date: Tue, 17 Dec 2024 21:06:58 +0000 Subject: [PATCH 2/3] media: uvcvideo: Allow changing noparam on the fly Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241217-uvc-deprecate-v1-2-57d353f68f8f@chromium.org> References: <20241217-uvc-deprecate-v1-0-57d353f68f8f@chromium.org> In-Reply-To: <20241217-uvc-deprecate-v1-0-57d353f68f8f@chromium.org> To: Laurent Pinchart , Hans de Goede , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 Right now the parameter value is read during video_registration and cannot be changed afterwards, despite its permissions 0644, that makes the user believe that the value can be written. The parameter only affects the beviour of uvc_queue_buffer_complete(), with only one check per buffer. We can read the value directly from uvc_queue_buffer_complete() and therefore allowing changing it with sysfs on the fly. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 2 +- drivers/media/usb/uvc/uvc_queue.c | 6 ++---- drivers/media/usb/uvc/uvcvideo.h | 4 +--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 091145743872..10812a841587 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -1995,7 +1995,7 @@ int uvc_register_video_device(struct uvc_device *dev, int ret; /* Initialize the video buffers queue. */ - ret = uvc_queue_init(queue, type, !uvc_no_drop_param); + ret = uvc_queue_init(queue, type); if (ret) return ret; diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c index 26ee85657fc8..ed246d8ff31a 100644 --- a/drivers/media/usb/uvc/uvc_queue.c +++ b/drivers/media/usb/uvc/uvc_queue.c @@ -208,8 +208,7 @@ static const struct vb2_ops uvc_meta_queue_qops = { .stop_streaming = uvc_stop_streaming, }; -int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, - int drop_corrupted) +int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type) { int ret; @@ -239,7 +238,6 @@ int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, mutex_init(&queue->mutex); spin_lock_init(&queue->irqlock); INIT_LIST_HEAD(&queue->irqqueue); - queue->flags = drop_corrupted ? UVC_QUEUE_DROP_CORRUPTED : 0; return 0; } @@ -472,7 +470,7 @@ static void uvc_queue_buffer_complete(struct kref *ref) struct vb2_buffer *vb = &buf->buf.vb2_buf; struct uvc_video_queue *queue = vb2_get_drv_priv(vb->vb2_queue); - if ((queue->flags & UVC_QUEUE_DROP_CORRUPTED) && buf->error) { + if (buf->error && !uvc_no_drop_param) { uvc_queue_buffer_requeue(queue, buf); return; } diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h index 07f9921d83f2..ebbd8afcf136 100644 --- a/drivers/media/usb/uvc/uvcvideo.h +++ b/drivers/media/usb/uvc/uvcvideo.h @@ -316,7 +316,6 @@ struct uvc_buffer { }; #define UVC_QUEUE_DISCONNECTED (1 << 0) -#define UVC_QUEUE_DROP_CORRUPTED (1 << 1) struct uvc_video_queue { struct vb2_queue queue; @@ -674,8 +673,7 @@ extern struct uvc_driver uvc_driver; struct uvc_entity *uvc_entity_by_id(struct uvc_device *dev, int id); /* Video buffers queue management. */ -int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, - int drop_corrupted); +int uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type); void uvc_queue_release(struct uvc_video_queue *queue); int uvc_request_buffers(struct uvc_video_queue *queue, struct v4l2_requestbuffers *rb); From patchwork Tue Dec 17 21:06:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13912514 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 C5CBE1FA257 for ; Tue, 17 Dec 2024 21:07:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734469631; cv=none; b=rApkRHyeqOUuVhWuAGmQpKNs8M8NRm3VjOJu5RuJojrqjcmZXBvcl4RuLWXJUrt43Ti0tMuP+cNNhBLUyxjynfuSMMbT35sr3Z54lYJ9BEPObDTSyy52bprvVa0gP/IhpLnLpuykKpP04tRlmbhhfentH32r4TOBPJyanDFL76M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734469631; c=relaxed/simple; bh=uenJu74j/Lwr2wWBMfStYd5Y0E2jiTk4eE6aU1AVS9g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aVEZGqxRghiGz4NVTywWtffgHUup1d4yoI8q0a3F64nUpOhEPbyHZ9vQI5zgE2WMsHGwAUcX2tx6BpP60BtRD0xvvr23/yM+AWN9MIXADPGrV/VqzFofC8PJpJR7BIGG2X+NuwdJJjb4566+TDtdlxFS4OAg4REPASvo52Gz5cg= 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=RSNBeIoU; arc=none smtp.client-ip=209.85.160.171 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="RSNBeIoU" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-467a0a6c9fcso84539751cf.3 for ; Tue, 17 Dec 2024 13:07:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1734469627; x=1735074427; 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=4X38Eu7mA026YUSiXMDtPdvj4gwf9pxsv7m3KoYh7F0=; b=RSNBeIoUJpiEqSPzD1ut2BbMtwXIjPsJjaDjG3Rztw/gEdhnPfIo6Za65DpKxzQLHA p+4bYopdIR4R/HgNb7dyl6YaLmnkK0rf27v6j+n8Pf0/+fXTs/SxhFHbsoJrSBONMUM6 5x+TzPW1mklS9EHW97q/AIxIf/OdN/C9ls6Ic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734469627; x=1735074427; 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=4X38Eu7mA026YUSiXMDtPdvj4gwf9pxsv7m3KoYh7F0=; b=vRUMjN+4ZluwVj6cS04StoCXM+qY4kLCuXXJu14KZATNW2AW1mOl3Vf2sOgibERyLt fT45o7Hr1vt+iDzzD3rGXf+/GT5JfMPqphnYI2wDTLmMg1P+A7GV/jJgULezhXKeZgCB CP4hYFz0BfqBoS5YAoPwRGxkSpmxJd0betgfclHzCmRGlddzoYtNFQj13jSJyA3mBQNG TQ6JKWCHm0YHryFR7/W+OVmMIAdg9YbcAauJDw05KYsxmNXAjm8qlKm2FR1dw/4mf7ul 37FMU5oba2JNeiFNrnYHMGWB74+2N701HPePrcTCLdLXQk7+2XOK2LnCDzHtv7qQAomq YjLQ== X-Gm-Message-State: AOJu0YwFjm+aVoScCT4M2QzpyQ3fl5rbSBDfGxvan4STFNixy9LWo5I8 6B5kWALRx3ti3dy/7I1STGOfVpqBIc9KRBNZW7WgoRWsiZGuxa3QLq/dBenFYg== X-Gm-Gg: ASbGncs6tXS1AFxbScIRaZSf2JTPfujgFj04h5UmcMTCWQDXbRBCkNqugEgJVMGTMVc c90h9bkQ/IcYCXX97HIcADagKXl3Z2+7EJsIQAZKO55pe7w+TbC/batRaXshet+myiRiek2TIQ4 KlkDA3VcfuCqhHnL9czCB/jYDc/3gZJ9g0OZmcfwwcIrpvVDoeCBPMvCyvYwtX3yMRRGu9iy+M5 eVYOWkAwWjnESl7bXajciQ5gCgtAi7lkWfLThZsm9s7Bt7iO8H+cmKCtuO3g5WODHHMt9VL+gQh JGyZggOGleSyJrpWoaNsOUJXSQC231k= X-Google-Smtp-Source: AGHT+IFXaZ4pKbRSE3Q+DHG7qDiGY5XwCpLr9wYWd9bPXYCo700dc7W1WXA/aJz07Xomabvl8yqDxQ== X-Received: by 2002:a05:6214:f2e:b0:6d8:899e:c3be with SMTP id 6a1803df08f44-6dd0927b806mr8066266d6.49.1734469626916; Tue, 17 Dec 2024 13:07:06 -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 6a1803df08f44-6dccd22f2a7sm42825276d6.27.2024.12.17.13.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Dec 2024 13:07:05 -0800 (PST) From: Ricardo Ribalda Date: Tue, 17 Dec 2024 21:06:59 +0000 Subject: [PATCH 3/3] media: uvcvideo: Announce the user our deprecation intentions Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20241217-uvc-deprecate-v1-3-57d353f68f8f@chromium.org> References: <20241217-uvc-deprecate-v1-0-57d353f68f8f@chromium.org> In-Reply-To: <20241217-uvc-deprecate-v1-0-57d353f68f8f@chromium.org> To: Laurent Pinchart , Hans de Goede , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.13.0 If the user sets the nodrop parameter, print a deprecation warning once. Hopefully they will come to the mailing list if it is an ABI change. Now that we have a callback, take this chance to parse the parameter as a boolean. Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_driver.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 10812a841587..d8e8675dd2cd 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -2424,8 +2424,25 @@ module_param_call(clock, uvc_clock_param_set, uvc_clock_param_get, MODULE_PARM_DESC(clock, "Video buffers timestamp clock"); module_param_named(hwtimestamps, uvc_hw_timestamps_param, uint, 0644); MODULE_PARM_DESC(hwtimestamps, "Use hardware timestamps"); -module_param_named(nodrop, uvc_no_drop_param, uint, 0644); + +static int param_set_nodrop(const char *val, const struct kernel_param *kp) +{ + pr_warn_once("uvcvideo: " + DEPRECATED + "nodrop parameter will be eventually removed.\n"); + return param_set_bool(val, kp); +} + +static const struct kernel_param_ops param_ops_nodrop = { + .set = param_set_nodrop, + .get = param_get_uint, +}; + +param_check_uint(nodrop, &uvc_no_drop_param); +module_param_cb(nodrop, ¶m_ops_nodrop, &uvc_no_drop_param, 0644); +__MODULE_PARM_TYPE(nodrop, "uint"); MODULE_PARM_DESC(nodrop, "Don't drop incomplete frames"); + module_param_named(quirks, uvc_quirks_param, uint, 0644); MODULE_PARM_DESC(quirks, "Forced device quirks"); module_param_named(trace, uvc_dbg_param, uint, 0644);