[SRU] [X/B] [PATCH 0/1] Skip frame when buffer overflow on UVC camera

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SRU] [X/B] [PATCH 0/1] Skip frame when buffer overflow on UVC camera

Kai-Heng Feng
BugLink: https://bugs.launchpad.net/bugs/1849871

[Impact]
Currently to use Intel RealSense, kernel needs to be patched [1].
This SRU is to bring one of several fixes to Ubuntu kernel.

"Some cameras post inaccurate frame where next frame data overlap
it. this results in screen flicker, and it need to be prevented."

[Fix]
"So this patch marks the buffer error to discard the frame where
buffer overflow."

[Test]
I don't have such bad device so I can't test it. By reading through the
code, this patch seems to be correct.

[Regression Potential]
Low. This patch has been in the kernel tree for more than two years and
it doesn't bring any regression. So it should be fairly safe.

[1] https://github.com/IntelRealSense/librealsense/blob/master/scripts/patch-realsense-ubuntu-lts.sh

Baoyou Xie (1):
  media: uvcvideo: Mark buffer error where overflow

 drivers/media/usb/uvc/uvc_video.c | 1 +
 1 file changed, 1 insertion(+)

--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/1] media: uvcvideo: Mark buffer error where overflow

Kai-Heng Feng
From: Baoyou Xie <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1849871

Some cameras post inaccurate frame where next frame data overlap
it. this results in screen flicker, and it need to be prevented.

So this patch marks the buffer error to discard the frame where
buffer overflow.

Signed-off-by: Baoyou Xie <[hidden email]>
Reviewed-by: Laurent Pinchart <[hidden email]>
Signed-off-by: Mauro Carvalho Chehab <[hidden email]>
(cherry picked from commit dfc1648c576719b5a2701805aab1e208789d5969)
Signed-off-by: Kai-Heng Feng <[hidden email]>
---
 drivers/media/usb/uvc/uvc_video.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index 31d428c6bd20..924974125714 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1089,6 +1089,7 @@ static void uvc_video_decode_data(struct uvc_streaming *stream,
  /* Complete the current frame if the buffer size was exceeded. */
  if (len > maxlen) {
  uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n");
+ buf->error = 1;
  buf->state = UVC_BUF_STATE_READY;
  }
 }
--
2.17.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [PATCH 1/1] media: uvcvideo: Mark buffer error where overflow

Connor Kuehl
On 10/25/19 9:30 AM, Kai-Heng Feng wrote:

> From: Baoyou Xie <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1849871
>
> Some cameras post inaccurate frame where next frame data overlap
> it. this results in screen flicker, and it need to be prevented.
>
> So this patch marks the buffer error to discard the frame where
> buffer overflow.
>
> Signed-off-by: Baoyou Xie <[hidden email]>
> Reviewed-by: Laurent Pinchart <[hidden email]>
> Signed-off-by: Mauro Carvalho Chehab <[hidden email]>
> (cherry picked from commit dfc1648c576719b5a2701805aab1e208789d5969)
> Signed-off-by: Kai-Heng Feng <[hidden email]>

Acked-by: Connor Kuehl <[hidden email]>

> ---
>   drivers/media/usb/uvc/uvc_video.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index 31d428c6bd20..924974125714 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -1089,6 +1089,7 @@ static void uvc_video_decode_data(struct uvc_streaming *stream,
>   /* Complete the current frame if the buffer size was exceeded. */
>   if (len > maxlen) {
>   uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n");
> + buf->error = 1;
>   buf->state = UVC_BUF_STATE_READY;
>   }
>   }
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [PATCH 1/1] media: uvcvideo: Mark buffer error where overflow

Stefan Bader-2
In reply to this post by Kai-Heng Feng
On 25.10.19 18:30, Kai-Heng Feng wrote:

> From: Baoyou Xie <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1849871
>
> Some cameras post inaccurate frame where next frame data overlap
> it. this results in screen flicker, and it need to be prevented.
>
> So this patch marks the buffer error to discard the frame where
> buffer overflow.
>
> Signed-off-by: Baoyou Xie <[hidden email]>
> Reviewed-by: Laurent Pinchart <[hidden email]>
> Signed-off-by: Mauro Carvalho Chehab <[hidden email]>
> (cherry picked from commit dfc1648c576719b5a2701805aab1e208789d5969)
> Signed-off-by: Kai-Heng Feng <[hidden email]>
Acked-by: Stefan Bader <[hidden email]>

> ---
>  drivers/media/usb/uvc/uvc_video.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index 31d428c6bd20..924974125714 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -1089,6 +1089,7 @@ static void uvc_video_decode_data(struct uvc_streaming *stream,
>   /* Complete the current frame if the buffer size was exceeded. */
>   if (len > maxlen) {
>   uvc_trace(UVC_TRACE_FRAME, "Frame complete (overflow).\n");
> + buf->error = 1;
>   buf->state = UVC_BUF_STATE_READY;
>   }
>  }
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [SRU] [X/B] [PATCH 0/1] Skip frame when buffer overflow on UVC camera

Stefan Bader-2
In reply to this post by Kai-Heng Feng
On 25.10.19 18:30, Kai-Heng Feng wrote:

> BugLink: https://bugs.launchpad.net/bugs/1849871
>
> [Impact]
> Currently to use Intel RealSense, kernel needs to be patched [1].
> This SRU is to bring one of several fixes to Ubuntu kernel.
>
> "Some cameras post inaccurate frame where next frame data overlap
> it. this results in screen flicker, and it need to be prevented."
>
> [Fix]
> "So this patch marks the buffer error to discard the frame where
> buffer overflow."
>
> [Test]
> I don't have such bad device so I can't test it. By reading through the
> code, this patch seems to be correct.
>
> [Regression Potential]
> Low. This patch has been in the kernel tree for more than two years and
> it doesn't bring any regression. So it should be fairly safe.
>
> [1] https://github.com/IntelRealSense/librealsense/blob/master/scripts/patch-realsense-ubuntu-lts.sh
>
> Baoyou Xie (1):
>   media: uvcvideo: Mark buffer error where overflow
>
>  drivers/media/usb/uvc/uvc_video.c | 1 +
>  1 file changed, 1 insertion(+)
>
Applied to bionic+xenial/master-next. Thanks.

-Stefan



--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment