RE: [PATCH] media: mx3_camera: buf_init() add buffer state check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi Guennadi,

> On Mon, 30 Jul 2012, Alex Gershgorin wrote:

> This patch check the state of the buffer when calling buf_init() method.
> The thread http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/48587
> also includes report witch can show the problem. This patch solved the problem.
> Both MMAP and USERPTR methods was successfully tested.
>
> Signed-off-by: Alex Gershgorin <alexg@xxxxxxxxxxxxxx>
> ---
>  drivers/media/video/mx3_camera.c |   12 +++++++-----
>  1 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
> index f13643d..950a8fe 100644
> --- a/drivers/media/video/mx3_camera.c
> +++ b/drivers/media/video/mx3_camera.c
> @@ -405,13 +405,15 @@ static int mx3_videobuf_init(struct vb2_buffer *vb)

>> Sorry, don't understand. As we see in the thread, mentioned above, the
>> Oops happened in mx3_videobuf_release(). If my analysis was correct in
>> that thread, that Oops happened, when .buf_cleanup() was called without
>> .buf_init() being called. This your patch modifies mx3_videobuf_init().
>> which isn't even called in the problem case. How does this help?

Sorry for not quite a clear explanation, I will explain in more details.
if you divide the report into two parts:
1) USERPTR method Oops happened as a result discontiguous memory allocation
2) USERPTR method use framebuffer memory allocation video starting, but after a few seconds the video freezes.
    if we consider the first part of the report, your analysis is absolutely 
   correct and unfortunately this patch does not solve the problems mentioned in the thread.
   This patch solves a problem that is described in the second part of the report.

>       struct mx3_camera_dev *mx3_cam = ici->priv;
>       struct mx3_camera_buffer *buf = to_mx3_vb(vb);
>
> -     /* This is for locking debugging only */
> -     INIT_LIST_HEAD(&buf->queue);
> -     sg_init_table(&buf->sg, 1);
> +     if (buf->state != CSI_BUF_PREPARED) {
> +             /* This is for locking debugging only */
> +             INIT_LIST_HEAD(&buf->queue);
> +             sg_init_table(&buf->sg, 1);
>
> -     buf->state = CSI_BUF_NEEDS_INIT;
> +             buf->state = CSI_BUF_NEEDS_INIT;
>
> -     mx3_cam->buf_total += vb2_plane_size(vb, 0);
> +             mx3_cam->buf_total += vb2_plane_size(vb, 0);
> +     }
>
>       return 0;
>  }
> --
> 1.7.0.4
>

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


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux