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: 851584 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: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: 851583 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);