Kevin Hilman wrote:
> m-kariche...@ti.com writes:
> 
>> This patch adds vpfe capture driver support. This is a new driver based on
>> v4l2-int-device.h interface for attaching slave decoder device to 
>> v4l2 master device. This replaces the old davinci_vpfe.c and davinci_vpfe.h.
>> Files have been renamed to reflect its usage across multiple platforms
>> that has a VPFE to capture video from yuv/raw decoders. This uses an 
>> interface, defined in ccdc_hw_if.h, to configure ccdc in vpfe to work
>> with the decoder attached to the interface.
>>
> 
> Hi Murali,
> 
> This is great work, thank you!
> 
> While we wait for this to go to the V4L2 list for discussions, I've
> pushed this series and some of my own changes into a staging branch on
> DaVinci git called 'staging/v4l2-capture' which is based on DaVinci
> git updated to v2.6.28-rc6.
> 

Hi Kevin, Murali,

I tested this driver on EVM and it is working flawlessly. Thanks for this new 
vpfe driver. There are some minor issues with driver:

1. Driver returns cropcap ioctl if mutex locked if operation fails.
2. s_parm ioctl is not implemented. However, gstreamer plugins rely on this 
   iotcl. I don't know if other user space programs require this or not.
3. I guess capture height is incorrectly set to 2 always in try_fmt ioctl.
4. cropcap ioctl always returns einval. I had to change it a little bit.
5. crop rectangle left coordinate is not set, instead top is set twice.

My diff against staging/v4l2-capture branch is attached. I'm fairly sure they 
are
not in an appropriate shape They're just trivial hacks to make driver functional
at the moment.

Thanks,
Caglar

________________________________________________________________________________

diff --git a/drivers/media/video/davinci/vpfe_capture.c 
b/drivers/media/video/davinci/vpfe_capture.c
index 32084e2..de242d0 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -313,7 +313,7 @@ static int vpfe_config_format(struct channel_obj *ch)
 
        vid_ch = &(ch->video);
        common->crop.top = 0;
-       common->crop.top = 0;
+       common->crop.left = 0;
        /* first get format information from the decoder.
         * if not available, get it from CCDC
         */
@@ -554,6 +554,8 @@ static irqreturn_t vpfe_isr(int irq, void *dev_id)
                                        common->curFrm->state = VIDEOBUF_DONE;
                                        wake_up_interruptible(&common->curFrm->
                                                              done);
+                                       common->curFrm->size = 
common->fmt.fmt.pix.width *
+                                               common->fmt.fmt.pix.height * 2;
                                        common->curFrm = common->nextFrm;
                                }
                                /* based on whether the two fields are stored
@@ -979,8 +981,8 @@ static int vpfe_try_format(struct channel_obj *channel,
 
        if ((pixfmt->height == 0) && (pixfmt->field == V4L2_FIELD_NONE))
                pixfmt->height = 1;
-       else
-               pixfmt->height = 2;
+       //else
+       //      pixfmt->height = 2;
 
        pixfmt->bytesperline = ROUND32(pixfmt->width * bpp);
        if (pixfmt->pixelformat == V4L2_PIX_FMT_NV12)
@@ -2072,9 +2074,17 @@ static int vpfe_cropcap(struct file *file, void *priv,
 {
        struct vpfe_fh *fh = file->private_data;
        struct channel_obj *channel = fh->channel;
-       struct v4l2_int_device *dec =
-               channel->decoder[channel->current_decoder];
-       return vidioc_int_cropcap(dec, crop);
+       //struct v4l2_int_device *dec =
+       //      channel->decoder[channel->current_decoder];
+       struct video_obj *vid_ch = &(channel->video);
+       struct v4l2_fract pa = VPFE_PIXELASPECT_PAL;    
+       crop->bounds.top = crop->bounds.left = 0;
+       crop->bounds.width = vid_ch->std_info.activepixels;
+       crop->bounds.height = vid_ch->std_info.activelines;
+       crop->defrect = crop->bounds;
+       crop->pixelaspect = pa;
+       return 0;
+       //return vidioc_int_cropcap(dec, crop);
 }
 
 static int vpfe_g_crop(struct file *file, void *priv,
@@ -2156,7 +2166,7 @@ static int vpfe_s_crop(struct file *file, void *priv,
        } else {
                dev_err(vpfe_dev, "Error in S_CROP params\n");
                ret = -EINVAL;
-               goto out;
+               goto lock_out;
        }
 lock_out:
        mutex_unlock(&common->lock);
@@ -2209,6 +2219,14 @@ out:
        return ret;
 }
 
+static int vpfe_s_parm(struct file *file, void *priv,
+               struct v4l2_streamparm *a)
+{
+       /* FIXME: Not supported yet */
+       printk("VPFE s_parm is not implemented yet\n");
+       return 0;
+}
+
 
 /* vpfe capture ioctl operations */
 static const struct v4l2_ioctl_ops vpfe_ioctl_ops = {
@@ -2236,6 +2254,7 @@ static const struct v4l2_ioctl_ops vpfe_ioctl_ops = {
        .vidioc_g_crop           = vpfe_g_crop,
        .vidioc_s_crop           = vpfe_s_crop,
        .vidioc_default          = vpfe_param_handler,
+       .vidioc_s_parm           = vpfe_s_parm,
 };
 
 /*     vpfe_probe : This function creates device entries by register

_______________________________________________
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to