Re: [PATCH] soc_camera_platform: Add necessary v4l2_subdev_video_ops method

2010-05-11 Thread Guennadi Liakhovetski
Hello Morimoto-san

Thanks for testing and fixing this driver, but I think there's one slight 
issue with your patch:

On Tue, 11 May 2010, Kuninori Morimoto wrote:

 These function are needed to use camera.
 This patch was tested with sh_mobile_ceu_camera
 
 Signed-off-by: Kuninori Morimoto kuninori.morimoto...@renesas.com
 ---
  drivers/media/video/soc_camera_platform.c |   39 
 +
  1 files changed, 39 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/media/video/soc_camera_platform.c 
 b/drivers/media/video/soc_camera_platform.c
 index 10b003a..d36f732 100644
 --- a/drivers/media/video/soc_camera_platform.c
 +++ b/drivers/media/video/soc_camera_platform.c
 @@ -83,10 +83,49 @@ static int soc_camera_platform_enum_fmt(struct 
 v4l2_subdev *sd, int index,
   return 0;
  }
  
 +static int soc_camera_platform_g_crop(struct v4l2_subdev *sd, struct 
 v4l2_crop *a)
 +{
 + struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
 +
 + a-c.left   = 0;
 + a-c.top= 0;
 + a-c.width  = p-format.width;
 + a-c.height = p-format.height;
 + a-type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 +
 + return 0;
 +}
 +
 +static int soc_camera_platform_cropcap(struct v4l2_subdev *sd, struct 
 v4l2_cropcap *a)
 +{
 + struct soc_camera_platform_info *p = v4l2_get_subdevdata(sd);
 +
 + a-bounds.left  = 0;
 + a-bounds.top   = 0;
 + a-bounds.width = p-format.width;
 + a-bounds.height= p-format.height;
 + a-defrect  = a-bounds;
 + a-type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
 + a-pixelaspect.numerator= 1;
 + a-pixelaspect.denominator  = 1;
 +
 + return 0;
 +}
 +
 +static int soc_camera_platform_s_fmt(struct v4l2_subdev *sd,
 +  struct v4l2_mbus_framefmt *mf)
 +{
 + return 0;

This function needs not only return 0, but also fill fmt with the current 
pixel format.

 +}
 +
  static struct v4l2_subdev_video_ops platform_subdev_video_ops = {
   .s_stream   = soc_camera_platform_s_stream,
   .try_mbus_fmt   = soc_camera_platform_try_fmt,
   .enum_mbus_fmt  = soc_camera_platform_enum_fmt,
 + .cropcap= soc_camera_platform_cropcap,
 + .g_crop = soc_camera_platform_g_crop,
 + .g_mbus_fmt = soc_camera_platform_try_fmt,
 + .s_mbus_fmt = soc_camera_platform_s_fmt,

Wouldn't

+   .s_mbus_fmt = soc_camera_platform_try_fmt,

work here as well?

  };
  
  static struct v4l2_subdev_ops platform_subdev_ops = {
 -- 
 1.6.3.3

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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] soc_camera_platform: Add necessary v4l2_subdev_video_ops method

2010-05-11 Thread Kuninori Morimoto

Dear Guennadi

Thank you for checking patch

  +static int soc_camera_platform_s_fmt(struct v4l2_subdev *sd,
  +struct v4l2_mbus_framefmt *mf)
  +{
  +   return 0;
 
 This function needs not only return 0, but also fill fmt with the current 
 pixel format.

sorry.
Does this fill mean fill mf- ?

mf-code = ;
mf-colorspace = xxx;

   static struct v4l2_subdev_video_ops platform_subdev_video_ops = {
  .s_stream   = soc_camera_platform_s_stream,
  .try_mbus_fmt   = soc_camera_platform_try_fmt,
  .enum_mbus_fmt  = soc_camera_platform_enum_fmt,
  +   .cropcap= soc_camera_platform_cropcap,
  +   .g_crop = soc_camera_platform_g_crop,
  +   .g_mbus_fmt = soc_camera_platform_try_fmt,
  +   .s_mbus_fmt = soc_camera_platform_s_fmt,
 
 Wouldn't
 
 + .s_mbus_fmt = soc_camera_platform_try_fmt,
 
 work here as well?

g_mbus_fmt / try_mbus_fmt are using same argument,
and in this driver, it needs same operation I think.
(same operation mean it fill mf-)
But should I modify it ?

int (*g_mbus_fmt)(struct v4l2_subdev *sd,  struct v4l2_mbus_framefmt *fmt);
int (*try_mbus_fmt)(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt);


Best regards
--
Kuninori Morimoto
 
--
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] soc_camera_platform: Add necessary v4l2_subdev_video_ops method

2010-05-11 Thread Guennadi Liakhovetski
On Tue, 11 May 2010, Kuninori Morimoto wrote:

 
 Dear Guennadi
 
 Thank you for checking patch
 
   +static int soc_camera_platform_s_fmt(struct v4l2_subdev *sd,
   +  struct v4l2_mbus_framefmt *mf)
   +{
   + return 0;
  
  This function needs not only return 0, but also fill fmt with the current 
  pixel format.
 
 sorry.
 Does this fill mean fill mf- ?
 
 mf-code = ;
 mf-colorspace = xxx;

Exactly, sorry for being unclear.

static struct v4l2_subdev_video_ops platform_subdev_video_ops = {
 .s_stream   = soc_camera_platform_s_stream,
 .try_mbus_fmt   = soc_camera_platform_try_fmt,
 .enum_mbus_fmt  = soc_camera_platform_enum_fmt,
   + .cropcap= soc_camera_platform_cropcap,
   + .g_crop = soc_camera_platform_g_crop,
   + .g_mbus_fmt = soc_camera_platform_try_fmt,
   + .s_mbus_fmt = soc_camera_platform_s_fmt,
  
  Wouldn't
  
  +   .s_mbus_fmt = soc_camera_platform_try_fmt,
  
  work here as well?
 
 g_mbus_fmt / try_mbus_fmt are using same argument,
 and in this driver, it needs same operation I think.
 (same operation mean it fill mf-)
 But should I modify it ?

My expectation is, that you don't need to modify anything, just 
soc_camera_platform_try_fmt() for all three methods: .try_mbus_fmt, 
.g_mbus_fmt and .s_mbus_fmt. Please, verify, whether or not I am right.

 int (*g_mbus_fmt)(struct v4l2_subdev *sd,  struct v4l2_mbus_framefmt *fmt);
 int (*try_mbus_fmt)(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *fmt);

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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