public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-kernel@vger.kernel.org, linux-media@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	"hn.chen" <hn.chen@sunplusit.com>
Subject: Re: [PATCH v7 6/6] media: uvcvideo: Fix hw timestamp handling for slow FPS
Date: Wed, 15 Mar 2023 21:34:52 +0900	[thread overview]
Message-ID: <20230315123452.GA1927922@google.com> (raw)
In-Reply-To: <20220920-resend-hwtimestamp-v7-6-cf1d78bb8821@chromium.org>

On (23/03/10 10:01), Ricardo Ribalda wrote:
[..]
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -473,6 +473,21 @@ static void uvc_video_clock_add_sample(struct uvc_clock *clock,
>  
>  	spin_lock_irqsave(&clock->lock, flags);
>  
> +	/* Delete last overflows */
> +	if (clock->head == clock->last_sof_overflow)
> +		clock->last_sof_overflow = -1;
> +
> +	/* Handle overflows */
> +	if (clock->count > 0 && clock->last_sof > sample->dev_sof) {

Per offline discussion, we set clock->last_sof to sameple->dev_sof
right before uvc_video_clock_add_sample() so this condition is always
false. clock->sof needs to be updated after overflow handling checks.

  reply	other threads:[~2023-03-15 12:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10  9:01 [PATCH v7 0/6] uvcvideo: Fixes for hw timestamping Ricardo Ribalda
2023-03-10  9:01 ` [PATCH v7 1/6] media: uvcvideo: Fix underflow addressing on hw timestamp Ricardo Ribalda
2023-03-10 12:18   ` Sergey Senozhatsky
2023-03-10  9:01 ` [PATCH v7 2/6] media: uvcvideo: Ignore empty TS packets Ricardo Ribalda
2023-03-10  9:01 ` [PATCH v7 3/6] media: uvcvideo: Quirk for invalid dev_sof in Logitech C922 Ricardo Ribalda
2023-03-10  9:01 ` [PATCH v7 4/6] media: uvcvideo: Allow hw clock updates with buffers not full Ricardo Ribalda
2023-03-10  9:01 ` [PATCH v7 5/6] media: uvcvideo: Refactor clock circular buffer Ricardo Ribalda
2023-03-10  9:01 ` [PATCH v7 6/6] media: uvcvideo: Fix hw timestamp handling for slow FPS Ricardo Ribalda
2023-03-15 12:34   ` Sergey Senozhatsky [this message]
2023-08-15 11:26 ` [PATCH v7 0/6] uvcvideo: Fixes for hw timestamping Ricardo Ribalda
2023-09-04 11:55   ` Ricardo Ribalda
2023-11-10 10:23     ` 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=20230315123452.GA1927922@google.com \
    --to=senozhatsky@chromium.org \
    --cc=hn.chen@sunplusit.com \
    --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 \
    /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