From patchwork Tue Sep 20 14:08:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 608147 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F77FC54EE9 for ; Tue, 20 Sep 2022 14:08:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231502AbiITOIf (ORCPT ); Tue, 20 Sep 2022 10:08:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231416AbiITOIb (ORCPT ); Tue, 20 Sep 2022 10:08:31 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37EA156BB9 for ; Tue, 20 Sep 2022 07:08:29 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id y17so6465887ejo.6 for ; Tue, 20 Sep 2022 07:08:29 -0700 (PDT) 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; bh=GNRZeqqBofwFFgvrtZo64pHwe4vN8QcPuwanc3P7m18=; b=dnl1UAEIow118xOMF3d6RV2uDS3Ampdbfn1MZ3MdrPkxuKps/M901LSwgUR2f7gSnx Aqs9MQURHmRNMKI3ptqiA5ssM3VAnUCI2/E+Gqnc9KxiVfJ7pqRU6QsdWr5LYXTyvyVS avsZfKcyJwxWSCWuBvLqgXVSUib0DJUHZ5MBY= 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; bh=GNRZeqqBofwFFgvrtZo64pHwe4vN8QcPuwanc3P7m18=; b=4ivT3TYnvsoLO48tA4YYCMsesI/r8JUu+ozOEodo1ZSg8NcdJfzs+qJfVezcDdzpK5 CUNHvjU5EGAN7pAyL09psiAMhNJhOFFMumpVc/2WdckFvlxUNdD330feUWuuSlLt1UQJ nnzh63v5Y+OKazOQlfk72UnJSNVheSX3PSHUxl3P0m6lkVVNpeWCDEn+jgPlJ1GwRnI9 NAPIbm3BEcuTsHYOpvqvbTT+9WtmV4hE6oz8SH2FQIm6aa8/C/7QI1y+mSY97UNz2Tr+ 8BURAiaxM3D5xc3C+A8q+nezAdBJn+6h3AIGnTQ00jQBb0ki7jIXNkMk+RC56bkKifOv 9e3Q== X-Gm-Message-State: ACrzQf1L0uf0iS1vUXF3KSe72Hw77HHP25hk5F82a0WSUczePPYOpja/ m8b6NdWTeBQYuvUBp1DjcOfJ5g== X-Google-Smtp-Source: AMsMyM5NcNM0Hllkv6SuG/1QMVy1P2GJGEUX/BF/5aVADEeqmQHmsphKLxgXR1Wte8bFdAGpZWm95A== X-Received: by 2002:a17:907:3f09:b0:780:330d:d907 with SMTP id hq9-20020a1709073f0900b00780330dd907mr17967603ejc.23.1663682907241; Tue, 20 Sep 2022 07:08:27 -0700 (PDT) Received: from alco.roam.corp.google.com ([2620:0:1059:10:935d:52b0:7461:88e1]) by smtp.gmail.com with ESMTPSA id j17-20020a17090623f100b0077016f4c6d4sm936564ejg.55.2022.09.20.07.08.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 07:08:26 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 20 Sep 2022 16:08:07 +0200 Subject: [PATCH v1 1/8] media: uvc: Extend documentation of uvc_video_clock_decode() MIME-Version: 1.0 Message-Id: <20220920-resend-hwtimestamp-v1-1-e9c14b258404@chromium.org> References: <20220920-resend-hwtimestamp-v1-0-e9c14b258404@chromium.org> In-Reply-To: <20220920-resend-hwtimestamp-v1-0-e9c14b258404@chromium.org> To: Laurent Pinchart , Mauro Carvalho Chehab Cc: "hn.chen" , Ricardo Ribalda , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org X-Mailer: b4 0.11.0-dev-d93f8 X-Developer-Signature: v=1; a=openpgp-sha256; l=962; i=ribalda@chromium.org; h=from:subject:message-id; bh=HA7gMmyIlso0y4JghGpn78Jy/w8ZP1mfGIQm1eY7vlA=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjKclLuC0+GprVRxBvAJv8LhmrYKAks0uKapIO0d7+ k/bas+eJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCYynJSwAKCRDRN9E+zzrEiK66D/ 0eAwIh96q1kC3kaW1GM7CZDtt98KXc5Fyz2oK4QdJdaRA2/zxVxQ3lnLFw6cvs/XI4nawjYU4prYEt b6gYhY7vPvLyoWbigdRjcwSxxj9Bn9B+p34lMimLLV+sTw0MVlDdf84xLmSxeFffg+89JaJl62Cs+o Gc3notu6stl92B4UP6bsueh/XsifvFj/EqGYO5crJBUawtuF2CHrJomFRvNfmul72kockWrm12nFSS nmga38/SDIz+IyubUOfV1feuhA/VC/Q45Lith1ezwQNgUFCLPcAVJ6hQj+DeWnWL0sJQyV73NwO3yq tRgZaHwHz/VjBBQ8IpVB7e38+a4v+mQILoO58jRaT/NYeHqLS9HpA4DoyyrxlCdxw6sFAsi11CZ6GX HkwdVX2A7CBgEQGXfjHLsYjWoy0kP/EDlECWDtoCwVx2eWO/gKPopJI7rzY+j2GLPRgqNyPKJHK5zI 83WXnMdvWu2RgBRsO8BFonmUgEl1Gka2T4/g2l0HgSJTYcHxDLuGX0yDNqDBltuKJIlREgyz6AoeO3 CptJ/WVpT6rEE04NDCvX5xXe0Ze/zP7C9rHkegbbj7epu7TC+f/n0LglqBG9ousJZTb78lmoOlcqKz pPtsHvkicSFlDeD6F/qKk6kCuxYkHQr2CxPb39ALNuFQrcXI7wFXqOAu37rg== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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: hn.chen Signed-off-by: Ricardo Ribalda 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)