[Gta04-owner] camera hack/patch/question

Benjamin Deering ben_deering at swissmail.org
Wed Jan 22 04:38:09 CET 2014

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?

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.


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 
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 
+       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,

More information about the Gta04-owner mailing list