From patchwork Fri Dec 2 17:02:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 29013 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp972249wrr; Fri, 2 Dec 2022 09:07:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf7cjVLimEaJhN94d4pGL7amN66+rht4u6szI34i7ySoL/D8jKKKFpB5TDUh9fi4wjILPPbw X-Received: by 2002:aa7:8493:0:b0:563:8d32:abdc with SMTP id u19-20020aa78493000000b005638d32abdcmr53405939pfn.47.1670000854741; Fri, 02 Dec 2022 09:07:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670000854; cv=none; d=google.com; s=arc-20160816; b=DY+sug36P69DJUiQrl9NF2iCGwhW3o5V/suBFml0dtmslGdgh81lR2HptVMqURV5wM GNme+f32/GRvRluMLXWWgB3lIzf6B/k5dkemZtvqXVe1VX/tq6q170soAqFSbcF+liDD wIh6Tk+VnFeb8F7/dGe+oCYGczYkG4S/9a1aUY4b8iAncLbhCfao+qSZdVkW4D9eVdo6 0u0Jp85tMv65qo4brkG0vcwJlU+B0UcdUHbJbfIR1roKiLbnADbzdNiKI8/pXeZbuiON uM8PjcOTQM6apoZWW8iCttQGMCoTGiCLWKUm0nZo9GPm1Ld6bC0sDNsK+h5Xoi0f0T1D pg0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=KTzGbELlKza/9kwevLALsVHryAN8WDcrHC7w5wg6Na4=; b=f7dKBYpkhObJWzV6eqSTjA21L2jO/SD95OHSBqlTVo+/gzHSfvWuN//vO6lwYgBRUe rQDKU0StS6Tn0iWPBeSDh33OfOYgnuLRKj9LyCwL3h60ZtBuOjEz8TaFJf643TfTYQhz fesziGtNU1PR7nK8OVJvoXKdOA+e50R0nXVQpxCb9nERucDgbxWlkG4zRvH2YXrBkKOy E98+63n30lVI21o82Vs5q273q1It9bSHBCEp4nlCmnP3toswcFeyPydBpcpnhBPI9JU2 OvFQIabNeOINPeyltTPH+uZcKWf6EMA3g+YuqGLmRTwOnHqT+WtprQBlP+zC8k36idwo Zzdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=S1W+HURE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a11-20020a170902eccb00b001891509807fsi8323711plh.575.2022.12.02.09.07.20; Fri, 02 Dec 2022 09:07:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=S1W+HURE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234276AbiLBRDQ (ORCPT + 99 others); Fri, 2 Dec 2022 12:03:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234142AbiLBRDD (ORCPT ); Fri, 2 Dec 2022 12:03:03 -0500 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B70956403 for ; Fri, 2 Dec 2022 09:03:01 -0800 (PST) Received: by mail-ej1-x631.google.com with SMTP id gu23so12919552ejb.10 for ; Fri, 02 Dec 2022 09:03:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; 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=KTzGbELlKza/9kwevLALsVHryAN8WDcrHC7w5wg6Na4=; b=S1W+HUREYDZKrxoEwQlXVCBdLqkRqdX82DIpktGpRdIUD37IVAzsh6+SFRkd53Gehp wrD3D9qdP8ZtQsarb+lyYS+HWHIa9Dc5HCWTWNabZZ4dOINTJeNiBDLfqhVW39NAc5j9 KwMeED/SfoGbr4LxJhamZkhandaEf2or7m48A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=KTzGbELlKza/9kwevLALsVHryAN8WDcrHC7w5wg6Na4=; b=3lIlJcMyxX7YwRVOjz6/c5AqAJM1NCUi8Eywe941+rjWOUfuMvQmzVIlu4yr+BaYWy XyFpLsz9a9Cq4p7OIN5TdiXWpchI6+WgOAi7aBValasBgNzquj/NFsr1sxUCfG9I5qoh EQ7g0V/b+5aArAX07D04hnUC2QBdxe8xzWSxHgTEHuTI3UiNpSeZ45ZQL1ZTFNN1N8Yq 31bfWj1Bmiz3KXnnbyFKB82592Cti+MKQ86uOpFS2wndm1RrkduRDSeYO4tzHiUB1IQP 0kyqn7zFyGp0JL7LyjckCZnndr/4RfrpqllR88lB1yGaj/TGd8ZyuxeQD6wUoJNMNhe9 4sqQ== X-Gm-Message-State: ANoB5plgv7JMSsuGxlNY83Ns5fulfjkjeOfV+SGXHjTm36RXBZyV7vdK xBSu79qTAuGP9pgi1neYAjwVXQ== X-Received: by 2002:a17:907:6744:b0:7c0:8d04:d1f1 with SMTP id qm4-20020a170907674400b007c08d04d1f1mr14711050ejc.208.1670000580335; Fri, 02 Dec 2022 09:03:00 -0800 (PST) Received: from alco.roam.corp.google.com (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id sa22-20020a170906edb600b0073d7ab84375sm3249133ejb.92.2022.12.02.09.02.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:02:59 -0800 (PST) From: Ricardo Ribalda Date: Fri, 02 Dec 2022 18:02:41 +0100 Subject: [PATCH RESEND v2 1/8] media: uvc: Extend documentation of uvc_video_clock_decode() MIME-Version: 1.0 Message-Id: <20220920-resend-hwtimestamp-v2-1-0d7978a817cc@chromium.org> References: <20220920-resend-hwtimestamp-v2-0-0d7978a817cc@chromium.org> In-Reply-To: <20220920-resend-hwtimestamp-v2-0-0d7978a817cc@chromium.org> To: Mauro Carvalho Chehab , Laurent Pinchart Cc: "hn.chen" , linux-media@vger.kernel.org, Ricardo Ribalda , linux-kernel@vger.kernel.org X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=1083; i=ribalda@chromium.org; h=from:subject:message-id; bh=7/FBms1zVY/y54Npj9F3M2JJkIZ6gxgY9l354aVjRxo=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjii+3/p+J4BSKRQ04UFfbXKbXXmgs+tPfyCpseQQV RMSUzwuJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY4ovtwAKCRDRN9E+zzrEiDUBD/ 4xijQ+AnWrIOeimoMQ3X5ag4tK54eZT+YleK8V+KtwjkDWV0CKU+NO/1q1gnHw5F6Lo1e8Z1doB/cX i/COrdCCXiY5W3bWii+riMj9si4YupbU5L/xZpk9V5aVDrqS0yT5KDdboPm7I20/T5k6HcP/DNgR8p DaWbTWQpthqQk8yYnOjqL/7LsWISKFQZ5v5/zoIdnv9qT5iwiWn5owJ2Ba3BBvYZjk46gKVpVhUZqM a0bYJKvo7AMpS6coBbYSfsox7ob9+3KihZUyuTpt6xARPteYa8ltiXbY+E91LeI+ECzrklNLQ6Kj38 HJoIjsqqckzN/bfGY0tgGQsyA+hMudrXFOv1UjSdmP0RkFWUqcV1Nch2rThr21N7bBVut8W1WGuUeI dsqk9RIHvb0VYV5jc9HZCV/PLFIZ/jy9JjndXnQ7qRo+86gIfZBJqy9C9U6BgHfKyXis2l5HJa/TQt DQKCBYwwFmjLtUqw3dzx7VvFhe5zxl+hXwKLK1fABr8mRkJ0Yo+05a/voyD4WnySlNuewhxAaCDb9n XZe992z4le/DZq6Xt+LlrSkkTlqpFm1dJFxEVLw4c5BhODyJhMS39lbJLJkMyx/xqZAn0aKhY9CSTu x1cOQTBoFizuVkAGMqGCmCjvN3pdhMgvpd7kZIXlaeOS3VuTwbxU2aMVI/Rg== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751122816484438078?= X-GMAIL-MSGID: =?utf-8?q?1751122816484438078?= Make a explicit reference to uvc 1.5, explaining how the algorithm supports the different behaviour of uvc 1.1 and 1.5. Tested-by: HungNien Chen Signed-off-by: Ricardo Ribalda --- drivers/media/usb/uvc/uvc_video.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 170a008f4006..ab56e65ca324 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -517,6 +517,9 @@ uvc_video_clock_decode(struct uvc_streaming *stream, struct uvc_buffer *buf, /* * To limit the amount of data, drop SCRs with an SOF identical to the * previous one. + * This filtering is also needed for supporting UVC 1.5. Where all the + * data packages of the same frame contains the same sof. In that case + * only the first one will match the host_sof. */ dev_sof = get_unaligned_le16(&data[header_size - 2]); if (dev_sof == stream->clock.last_sof)