Non-existing email in MAINTAINERS

2018-06-12 Thread Anton Leontiev
Jacob,

You have wrong e-mail address in MAINTAINERS file. Letters to
jacob2.c...@rock-chips.com return error:

550 jacob2.c...@rock-chips.com:user not exist

Best regards,
Anton Leontiev


[PATCH 5/6] [media] m2m-deinterlace: Remove surplus name initialization

2018-06-12 Thread Anton Leontiev
Name is already initialized by assignment from deinterlace_videodev.

Signed-off-by: Anton Leontiev 
---
 drivers/media/platform/m2m-deinterlace.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/m2m-deinterlace.c 
b/drivers/media/platform/m2m-deinterlace.c
index 1e4195144f39..3008892eb8dd 100644
--- a/drivers/media/platform/m2m-deinterlace.c
+++ b/drivers/media/platform/m2m-deinterlace.c
@@ -1040,7 +1040,6 @@ static int deinterlace_probe(struct platform_device *pdev)
}
 
video_set_drvdata(vfd, pcdev);
-   snprintf(vfd->name, sizeof(vfd->name), "%s", deinterlace_videodev.name);
v4l2_info(>v4l2_dev, MEM2MEM_TEST_MODULE_NAME
" Device registered as /dev/video%d\n", vfd->num);
 
-- 
2.17.1



[PATCH 1/6] [media] vim2m: Remove surplus name initialization

2018-06-12 Thread Anton Leontiev
Name is already initialized by assignment from vim2m_videodev.

Signed-off-by: Anton Leontiev 
---
 drivers/media/platform/vim2m.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/vim2m.c b/drivers/media/platform/vim2m.c
index 065483e62db4..1393aa806462 100644
--- a/drivers/media/platform/vim2m.c
+++ b/drivers/media/platform/vim2m.c
@@ -1020,7 +1020,6 @@ static int vim2m_probe(struct platform_device *pdev)
}
 
video_set_drvdata(vfd, dev);
-   snprintf(vfd->name, sizeof(vfd->name), "%s", vim2m_videodev.name);
v4l2_info(>v4l2_dev,
"Device registered as /dev/video%d\n", vfd->num);
 
-- 
2.17.1



[PATCH 2/6] [media] ti-vpe: Remove surplus name initialization

2018-06-12 Thread Anton Leontiev
Name is already initialized by assignment from vpe_videodev.

Signed-off-by: Anton Leontiev 
---
 drivers/media/platform/ti-vpe/vpe.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/ti-vpe/vpe.c 
b/drivers/media/platform/ti-vpe/vpe.c
index e395aa85c8ad..de968295ca7d 100644
--- a/drivers/media/platform/ti-vpe/vpe.c
+++ b/drivers/media/platform/ti-vpe/vpe.c
@@ -2485,7 +2485,6 @@ static void vpe_fw_cb(struct platform_device *pdev)
}
 
video_set_drvdata(vfd, dev);
-   snprintf(vfd->name, sizeof(vfd->name), "%s", vpe_videodev.name);
dev_info(dev->v4l2_dev.dev, "Device registered as /dev/video%d\n",
vfd->num);
 }
-- 
2.17.1



[PATCH 3/6] [media] s5p-g2d: Remove surplus name initialization

2018-06-12 Thread Anton Leontiev
Name is already initialized by assignment from g2d_videodev.

Signed-off-by: Anton Leontiev 
---
 drivers/media/platform/s5p-g2d/g2d.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/s5p-g2d/g2d.c 
b/drivers/media/platform/s5p-g2d/g2d.c
index 66aa8cf1d048..3735c204e9ac 100644
--- a/drivers/media/platform/s5p-g2d/g2d.c
+++ b/drivers/media/platform/s5p-g2d/g2d.c
@@ -702,7 +702,6 @@ static int g2d_probe(struct platform_device *pdev)
goto rel_vdev;
}
video_set_drvdata(vfd, dev);
-   snprintf(vfd->name, sizeof(vfd->name), "%s", g2d_videodev.name);
dev->vfd = vfd;
v4l2_info(>v4l2_dev, "device registered as /dev/video%d\n",
vfd->num);
-- 
2.17.1



[PATCH 4/6] [media] mx2: Remove surplus name initialization

2018-06-12 Thread Anton Leontiev
Name is already initialized by assignment from emmaprp_videodev.

Signed-off-by: Anton Leontiev 
---
 drivers/media/platform/mx2_emmaprp.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/mx2_emmaprp.c 
b/drivers/media/platform/mx2_emmaprp.c
index 5a8eff60e95f..2e64729134b2 100644
--- a/drivers/media/platform/mx2_emmaprp.c
+++ b/drivers/media/platform/mx2_emmaprp.c
@@ -934,7 +934,6 @@ static int emmaprp_probe(struct platform_device *pdev)
vfd->v4l2_dev = >v4l2_dev;
 
video_set_drvdata(vfd, pcdev);
-   snprintf(vfd->name, sizeof(vfd->name), "%s", emmaprp_videodev.name);
pcdev->vfd = vfd;
v4l2_info(>v4l2_dev, EMMAPRP_MODULE_NAME
  " Device registered as /dev/video%d\n", vfd->num);
-- 
2.17.1



[PATCH 6/6] [media] rga: Remove surplus name initialization

2018-06-12 Thread Anton Leontiev
Name is already initialized by assignment from rga_videodev.

Signed-off-by: Anton Leontiev 
---
 drivers/media/platform/rockchip/rga/rga.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/media/platform/rockchip/rga/rga.c 
b/drivers/media/platform/rockchip/rga/rga.c
index d508a8ba6f89..e8dffca669a1 100644
--- a/drivers/media/platform/rockchip/rga/rga.c
+++ b/drivers/media/platform/rockchip/rga/rga.c
@@ -882,7 +882,6 @@ static int rga_probe(struct platform_device *pdev)
vfd->v4l2_dev = >v4l2_dev;
 
video_set_drvdata(vfd, rga);
-   snprintf(vfd->name, sizeof(vfd->name), "%s", rga_videodev.name);
rga->vfd = vfd;
 
platform_set_drvdata(pdev, rga);
-- 
2.17.1



[PATCH] [media] vb2: Fix queue_setup() callback description

2017-03-23 Thread Anton Leontiev
Correct meaning of the last sensence by swapping it with previous.
Fix two small typos.

Signed-off-by: Anton Leontiev <scile...@gmail.com>
---
 include/media/videobuf2-core.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index ac5898a55fd9..cb97c224be73 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -305,16 +305,16 @@ struct vb2_buffer {
  * buffer in \*num_planes, the size of each plane should be
  * set in the sizes\[\] array and optional per-plane
  * allocator specific device in the alloc_devs\[\] array.
- * When called from VIDIOC_REQBUFS,() \*num_planes == 0,
+ * When called from VIDIOC_REQBUFS(), \*num_planes == 0,
  * the driver has to use the currently configured format to
  * determine the plane sizes and \*num_buffers is the total
  * number of buffers that are being allocated. When called
- * from VIDIOC_CREATE_BUFS,() \*num_planes != 0 and it
+ * from VIDIOC_CREATE_BUFS(), \*num_planes != 0 and it
  * describes the requested number of planes and sizes\[\]
- * contains the requested plane sizes. If either
- * \*num_planes or the requested sizes are invalid callback
- * must return %-EINVAL. In this case \*num_buffers are
- * being allocated additionally to q->num_buffers.
+ * contains the requested plane sizes. In this case
+ * \*num_buffers are being allocated additionally to
+ * q->num_buffers. If either \*num_planes or the requested
+ * sizes are invalid callback must return %-EINVAL.
  * @wait_prepare:  release any locks taken while calling vb2 functions;
  * it is called before an ioctl needs to wait for a new
  * buffer to arrive; required to avoid a deadlock in
-- 
2.12.0



Re: [PATCH] [media] uvcvideo: Fix marking buffer erroneous in case of FID toggling

2014-03-28 Thread Anton Leontiev
28.03.2014 20:12, Laurent Pinchart пишет:
 + * Set error flag for incomplete buffer.
 + */
 +static void uvc_buffer_check_bytesused(const struct uvc_streaming *const
 stream,
 
 No need for the second const keyword here.
 
 I would have used uvc_video_ as a prefix, to be in sync with the 
 surrounding 
 functions. What would you think of uvc_video_validate_buffer() ?
 
 +  struct uvc_buffer *const buf)
 
 And no need for const at all here.
 
 +{
 +  if (buf-length != buf-bytesused 
 +  !(stream-cur_format-flags  UVC_FMT_FLAG_COMPRESSED))
 
 The indentation is wrong here, the ! on the second line should be aligned to 
 the first 'buf' of the first line.
 
 If you agree with these changes I can perform them while applying, there's no 
 need to resubmit the patch.
 

Thank you for reviewing my first patch to Linux kernel. I completely
agree with your changes.

Just want to ask why there is no need for the second 'const' after
pointer character '*'? I thought it marks pointer itself as constant for
type-checking opposite to first 'const', which marks memory it points to
as constant for type-checking. I understand that the function is simple
enough to verify it by hand but it's better to add more information for
automatic checking.

Is there any guidelines on 'const' keyword usage in Linux kernel code?

Regards,

-- 
Anton Leontiev
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] [media] uvcvideo: Fix marking buffer erroneous in case of FID toggling

2014-03-27 Thread Anton Leontiev
26.03.2014 21:41, Laurent Pinchart wrote:
 Hi Anton,
 
 Thank you for the patch.
 
 On Tuesday 25 March 2014 08:40:57 Anton Leontiev wrote:
 Set error bit for incomplete buffers when end of buffer is detected by
 FID toggling (for example when last transaction with EOF is lost).
 This prevents passing incomplete buffers to the userspace.
 
 But this would also breaks buggy webcams that toggle the FID bit but don't 
 set 
 the EOF bit. Support for this was added before the driver got merged in the 
 mainline kernel, and the SVN log is a bit terse I'm afraid:
 
 V 104
 - Check both EOF and FID bits to detect end of frames.
 - Updated disclaimer and general status comment.
 
 I don't remember which webcam(s) exhibit this behaviour.
 
 Your patch would also mark valid buffers as erroneous when the list EOF bit 
 is 
 in a packet of its own with no data.

If camera streams compressed video the patch doesn't affect it. It
affects only uncompressed streams.

If we get EOF bit in a packet of its own with no data we take second
check under 'if (buf-state == UVC_BUF_STATE_READY)' that was before my
patch. In this case if all data were received buffer is processed
normally, but if some data is missing buffer is marked erroneous.

 As the uvcvideo driver already marks buffers smaller than the expected image 
 size as erroneous, missing EOF packets that contain data should already 
 result 
 in buffers with the error bit set.

No, because there was no check for that in case then new frame is
detected by FID toggling, it was there only for the case then new frame
is detected by EOF bit.

 Are you concerned about compressed formats only ?

No, I'm concerning about uncompressed frames only.

 While this patch would correctly detect the missing EOF packet in that
 case, any other missing packet would still result in a corrupt image, so I'm 
 not sure if this would be worth it.
 
 Signed-off-by: Anton Leontiev bun...@t-25.ru
 ---
  drivers/media/usb/uvc/uvc_video.c | 21 +++--
  1 file changed, 15 insertions(+), 6 deletions(-)

 diff --git a/drivers/media/usb/uvc/uvc_video.c
 b/drivers/media/usb/uvc/uvc_video.c index 8d52baf..57c9a4b 100644
 --- a/drivers/media/usb/uvc/uvc_video.c
 +++ b/drivers/media/usb/uvc/uvc_video.c
 @@ -1133,6 +1133,17 @@ static int uvc_video_encode_data(struct uvc_streaming
 *stream, */

  /*
 + * Set error flag for incomplete buffer.
 + */
 +static void uvc_buffer_check_bytesused(const struct uvc_streaming *const
 stream,
 +struct uvc_buffer *const buf)
 +{
 +if (buf-length != buf-bytesused 
 +!(stream-cur_format-flags  UVC_FMT_FLAG_COMPRESSED))
 +buf-error = 1;
 +}
 +
 +/*
   * Completion handler for video URBs.
   */
  static void uvc_video_decode_isoc(struct urb *urb, struct uvc_streaming
 *stream, @@ -1156,9 +1167,11 @@ static void uvc_video_decode_isoc(struct
 urb *urb, struct uvc_streaming *stream, do {
  ret = uvc_video_decode_start(stream, buf, mem,
  urb-iso_frame_desc[i].actual_length);
 -if (ret == -EAGAIN)
 +if (ret == -EAGAIN) {
 +uvc_buffer_check_bytesused(stream, buf);
  buf = uvc_queue_next_buffer(stream-queue,
  buf);
 +}
  } while (ret == -EAGAIN);

  if (ret  0)
 @@ -1173,11 +1186,7 @@ static void uvc_video_decode_isoc(struct urb *urb,
 struct uvc_streaming *stream, urb-iso_frame_desc[i].actual_length);

  if (buf-state == UVC_BUF_STATE_READY) {
 -if (buf-length != buf-bytesused 
 -!(stream-cur_format-flags 
 -  UVC_FMT_FLAG_COMPRESSED))
 -buf-error = 1;
 -
 +uvc_buffer_check_bytesused(stream, buf);
  buf = uvc_queue_next_buffer(stream-queue, buf);
  }
  }
 

-- 
Anton Leontiev
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] [media] uvcvideo: Fix marking buffer erroneous in case of FID toggling

2014-03-24 Thread Anton Leontiev
Set error bit for incomplete buffers when end of buffer is detected by
FID toggling (for example when last transaction with EOF is lost).
This prevents passing incomplete buffers to the userspace.

Signed-off-by: Anton Leontiev bun...@t-25.ru
---
 drivers/media/usb/uvc/uvc_video.c | 21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/drivers/media/usb/uvc/uvc_video.c 
b/drivers/media/usb/uvc/uvc_video.c
index 8d52baf..57c9a4b 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -1133,6 +1133,17 @@ static int uvc_video_encode_data(struct uvc_streaming 
*stream,
  */
 
 /*
+ * Set error flag for incomplete buffer.
+ */
+static void uvc_buffer_check_bytesused(const struct uvc_streaming *const 
stream,
+   struct uvc_buffer *const buf)
+{
+   if (buf-length != buf-bytesused 
+   !(stream-cur_format-flags  UVC_FMT_FLAG_COMPRESSED))
+   buf-error = 1;
+}
+
+/*
  * Completion handler for video URBs.
  */
 static void uvc_video_decode_isoc(struct urb *urb, struct uvc_streaming 
*stream,
@@ -1156,9 +1167,11 @@ static void uvc_video_decode_isoc(struct urb *urb, 
struct uvc_streaming *stream,
do {
ret = uvc_video_decode_start(stream, buf, mem,
urb-iso_frame_desc[i].actual_length);
-   if (ret == -EAGAIN)
+   if (ret == -EAGAIN) {
+   uvc_buffer_check_bytesused(stream, buf);
buf = uvc_queue_next_buffer(stream-queue,
buf);
+   }
} while (ret == -EAGAIN);
 
if (ret  0)
@@ -1173,11 +1186,7 @@ static void uvc_video_decode_isoc(struct urb *urb, 
struct uvc_streaming *stream,
urb-iso_frame_desc[i].actual_length);
 
if (buf-state == UVC_BUF_STATE_READY) {
-   if (buf-length != buf-bytesused 
-   !(stream-cur_format-flags 
- UVC_FMT_FLAG_COMPRESSED))
-   buf-error = 1;
-
+   uvc_buffer_check_bytesused(stream, buf);
buf = uvc_queue_next_buffer(stream-queue, buf);
}
}
-- 
1.9.1

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html