public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Jasmin J." <jasmin@anw.at>
Cc: linux-media@vger.kernel.org, hverkuil@xs4all.nl,
	mchehab@s-opensource.com, arnd@arndb.de
Subject: Re: [PATCH] media: uvcvideo: Fixed ktime_t to ns conversion
Date: Fri, 02 Feb 2018 13:32:19 +0200	[thread overview]
Message-ID: <1778442.ouJt2D3mk7@avalon> (raw)
In-Reply-To: <1515925303-5160-1-git-send-email-jasmin@anw.at>

Hi Jasmin,

Thank you for the patch.

On Sunday, 14 January 2018 12:21:43 EET Jasmin J. wrote:
> From: Jasmin Jessich <jasmin@anw.at>
> 
> Commit 828ee8c71950 ("media: uvcvideo: Use ktime_t for timestamps")
> changed to use ktime_t for timestamps. Older Kernels use a struct for
> ktime_t, which requires the conversion function ktime_to_ns to be used on
> some places. With this patch it will compile now also for older Kernel
> versions.
> 
> Signed-off-by: Jasmin Jessich <jasmin@anw.at>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and taken into my tree for v4.17.

> ---
>  drivers/media/usb/uvc/uvc_video.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_video.c
> b/drivers/media/usb/uvc/uvc_video.c index 5441553..1670aeb 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -1009,7 +1009,7 @@ static int uvc_video_decode_start(struct uvc_streaming
> *stream,
> 
>  		buf->buf.field = V4L2_FIELD_NONE;
>  		buf->buf.sequence = stream->sequence;
> -		buf->buf.vb2_buf.timestamp = uvc_video_get_time();
> +		buf->buf.vb2_buf.timestamp = ktime_to_ns(uvc_video_get_time());
> 
>  		/* TODO: Handle PTS and SCR. */
>  		buf->state = UVC_BUF_STATE_ACTIVE;
> @@ -1191,7 +1191,8 @@ static void uvc_video_decode_meta(struct uvc_streaming
> *stream,
> 
>  	uvc_trace(UVC_TRACE_FRAME,
>  		  "%s(): t-sys %lluns, SOF %u, len %u, flags 0x%x, PTS %u, STC %u frame
> SOF %u\n", -		  __func__, time, meta->sof, meta->length, meta->flags,
> +		  __func__, ktime_to_ns(time), meta->sof, meta->length,
> +		  meta->flags,
>  		  has_pts ? *(u32 *)meta->buf : 0,
>  		  has_scr ? *(u32 *)scr : 0,
>  		  has_scr ? *(u32 *)(scr + 4) & 0x7ff : 0);


-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2018-02-02 11:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-14 10:21 [PATCH] media: uvcvideo: Fixed ktime_t to ns conversion Jasmin J.
2018-01-14 10:26 ` Jasmin J.
2018-01-14 14:19 ` Arnd Bergmann
2018-01-19  3:43   ` Jasmin J.
2018-01-27 16:21     ` Jasmin J.
2018-02-02 11:32 ` Laurent Pinchart [this message]
2018-02-04 10:37   ` Jasmin J.
2018-02-04 11:09     ` Hans Verkuil
2018-02-04 22:45       ` Jasmin J.
2018-02-04 13:27     ` Laurent Pinchart
2018-02-04 22:56       ` Jasmin J.

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=1778442.ouJt2D3mk7@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=arnd@arndb.de \
    --cc=hverkuil@xs4all.nl \
    --cc=jasmin@anw.at \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@s-opensource.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