[Gta04-owner] camera hack/patch/question

Dr. H. Nikolaus Schaller hns at goldelico.com
Fri Jan 24 07:11:59 CET 2014


Hi,

Am 22.01.2014 um 04:38 schrieb Benjamin Deering:

> 
> I'm not sending this with git send-email because it shouldn't be applied as is.  Like it says in the commit message, it is taken from https://patchwork.kernel.org/patch/1242121/.  To make cheese (camera program) work I had to hard code a value:
> fmtdesc->pixelformat = 0x59565955;//vfh->format.fmt.pix.pixelformat;
> 
> Does someone with ov9655/v4l2 knowledge know how we can set format.fmt.pix.pixelformat in the ov9655 driver so we could use the unmodified patch?

I think the camera driver can't and should not. Since it is the pixel format of the ISP which is the pipeline within the SoC.

Rather, I would expect that mediactl (which is the user space controller of the ISP) can set that value by some magic arguments (unfortunately nobody has written a man page I am aware of).

And I wonder what the relation of the new function to isp_video_get_format() and isp_video_set_format() could be.
To me it looks like an additional getter method just for the pixel format. The format can be stored by isp_video_set_format() in to_isp_video_fh(fh)->video before.

> 
> If I have this patch in my kernel and use the media-ctl commands from the camera demo script to set up the pipeline, cheese detects a camera for each pad.  The resizer pad is the one that displays.  This probably enables a bunch of programs besides cheese since cheese uses gstreamer.

That would indeed be a nice improvement.

> 
> 
> Ben

BR,
Nikolaus

> 
> 
> 
> 
> 
> This patch is from https://patchwork.kernel.org/patch/1242121/ with
> one change.  OV9655 doesnt set vfh->format.fmt.pix.pixelformat and I
> didn't see where it could be set so I hard-coded it.  With this change
> cheese detects the gta04 camera.
> ---
> drivers/media/platform/omap3isp/ispvideo.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c
> index a908d00..1a5c7b5 100644
> --- a/drivers/media/platform/omap3isp/ispvideo.c
> +++ b/drivers/media/platform/omap3isp/ispvideo.c
> @@ -355,7 +355,27 @@ __isp_video_get_format(struct isp_video *video, struct v4l2_format *format)
>        format->type = video->type;
>        return isp_video_mbus_to_pix(video, &fmt.format, &format->fmt.pix);
> }
> +static int
> +isp_video_enum_format(struct file *file, void *fh, struct v4l2_fmtdesc *fmtdesc)
> +{
> +       struct isp_video_fh *vfh = to_isp_video_fh(fh);
> +       struct isp_video *video = video_drvdata(file);
> +
> +       if (fmtdesc->index)
> +               return -EINVAL;
> +
> +       if (fmtdesc->type != video->type)
> +               return -EINVAL;
> +
> +       fmtdesc->flags = 0;
> +       fmtdesc->description[0] = 0;
> 
> +       mutex_lock(&video->mutex);
> +       fmtdesc->pixelformat = 0x59565955;//vfh->format.fmt.pix.pixelformat;
> +       mutex_unlock(&video->mutex);
> +
> +       return 0;
> +}
> static int
> isp_video_check_format(struct isp_video *video, struct isp_video_fh *vfh)
> {
> @@ -1200,6 +1220,7 @@ isp_video_s_input(struct file *file, void *fh, unsigned int input)
> 
> static const struct v4l2_ioctl_ops isp_video_ioctl_ops = {
>        .vidioc_querycap                = isp_video_querycap,
> +       .vidioc_enum_fmt_vid_cap        = isp_video_enum_format,
>        .vidioc_g_fmt_vid_cap           = isp_video_get_format,
>        .vidioc_s_fmt_vid_cap           = isp_video_set_format,
>        .vidioc_try_fmt_vid_cap         = isp_video_try_format,
> -- 
> 1.7.12
> 
> _______________________________________________
> Gta04-owner mailing list
> Gta04-owner at goldelico.com
> http://lists.goldelico.com/mailman/listinfo/gta04-owner



More information about the Gta04-owner mailing list