From: Hans de Goede <hansg@kernel.org>
To: Ricardo Ribalda <ribalda@chromium.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Tomasz Figa <tfiga@chromium.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Yunke Cao <yunkec@google.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH 2/4] media: uvcvideo: Use hw timestaming if the clock buffer is full
Date: Mon, 11 May 2026 17:31:33 +0200 [thread overview]
Message-ID: <32eec99d-c4d6-4d30-823f-b5e0f8d5ded0@kernel.org> (raw)
In-Reply-To: <20260323-uvc-hwtimestamp-v1-2-aa42e3865204@chromium.org>
Hi,
On 23-Mar-26 14:10, Ricardo Ribalda wrote:
> In some situations, even with a full clock buffer, it does not contain
> 250msec of data. This results in the driver jumping back from software
> to hardware timestapsing creating a nasty artifact in the video.
>
> If the clock buffer is full, use it to calculate the timestamp instead
> of defaulting to software stamps, the reduced accuracy is less visible
> than jumping from one timestamping mechanism to the other.
>
> Fixes: 6243c83be6ee8 ("media: uvcvideo: Allow hw clock updates with buffers not full")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Regards,
Hans
> ---
> drivers/media/usb/uvc/uvc_video.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index 6786ca38fe5e..c7ebedb3450f 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -842,7 +842,7 @@ void uvc_video_clock_update(struct uvc_streaming *stream,
> * dev_sof runs at 1KHz, and we have a fixed point precision of
> * 16 bits.
> */
> - if ((y2 - y1) < ((1000 / 4) << 16))
> + if (clock->size != clock->count && (y2 - y1) < ((1000 / 4) << 16))
> goto done;
>
> y = (u64)(y2 - y1) * (1ULL << 31) + (u64)y1 * (u64)x2
>
next prev parent reply other threads:[~2026-05-11 15:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260323-uvc-hwtimestamp-v1-0-aa42e3865204@chromium.org>
[not found] ` <20260323-uvc-hwtimestamp-v1-1-aa42e3865204@chromium.org>
2026-05-11 15:31 ` [PATCH 1/4] media: uvcvideo: Fix dev_sof filtering in hw timestamp Hans de Goede
2026-05-11 15:46 ` Laurent Pinchart
2026-05-11 15:56 ` Ricardo Ribalda
2026-05-11 16:05 ` Hans de Goede
[not found] ` <20260323-uvc-hwtimestamp-v1-3-aa42e3865204@chromium.org>
2026-05-11 15:33 ` [PATCH 3/4] media: uvcvideo: Relax the constrains for interpolating the hw clock Hans de Goede
2026-05-11 15:51 ` Laurent Pinchart
2026-05-11 15:58 ` Ricardo Ribalda
[not found] ` <20260323-uvc-hwtimestamp-v1-2-aa42e3865204@chromium.org>
2026-05-11 15:31 ` Hans de Goede [this message]
2026-05-11 15:49 ` [PATCH 2/4] media: uvcvideo: Use hw timestaming if the clock buffer is full Laurent Pinchart
[not found] ` <20260323-uvc-hwtimestamp-v1-4-aa42e3865204@chromium.org>
2026-05-11 16:07 ` [PATCH 4/4] media: uvcvideo: Do not add clock samples with small sof delta Hans de Goede
2026-05-11 16:50 ` Ricardo Ribalda
2026-05-11 18:33 ` Hans de Goede
2026-05-11 21:36 ` Ricardo Ribalda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=32eec99d-c4d6-4d30-823f-b5e0f8d5ded0@kernel.org \
--to=hansg@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=ribalda@chromium.org \
--cc=senozhatsky@chromium.org \
--cc=stable@vger.kernel.org \
--cc=tfiga@chromium.org \
--cc=yunkec@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox