diff options
Diffstat (limited to 'drivers/media/platform/davinci')
-rw-r--r-- | drivers/media/platform/davinci/vpbe.c | 30 | ||||
-rw-r--r-- | drivers/media/platform/davinci/vpbe_display.c | 10 | ||||
-rw-r--r-- | drivers/media/platform/davinci/vpfe_capture.c | 12 |
3 files changed, 16 insertions, 36 deletions
diff --git a/drivers/media/platform/davinci/vpbe.c b/drivers/media/platform/davinci/vpbe.c index 18c035ef84cf..4766a7a23d16 100644 --- a/drivers/media/platform/davinci/vpbe.c +++ b/drivers/media/platform/davinci/vpbe.c @@ -93,28 +93,6 @@ static int vpbe_find_encoder_sd_index(struct vpbe_config *cfg, } /** - * vpbe_g_cropcap - Get crop capabilities of the display - * @vpbe_dev: vpbe device ptr - * @cropcap: cropcap is a ptr to struct v4l2_cropcap - * - * Update the crop capabilities in crop cap for current - * mode - */ -static int vpbe_g_cropcap(struct vpbe_device *vpbe_dev, - struct v4l2_cropcap *cropcap) -{ - if (!cropcap) - return -EINVAL; - cropcap->bounds.left = 0; - cropcap->bounds.top = 0; - cropcap->bounds.width = vpbe_dev->current_timings.xres; - cropcap->bounds.height = vpbe_dev->current_timings.yres; - cropcap->defrect = cropcap->bounds; - - return 0; -} - -/** * vpbe_enum_outputs - enumerate outputs * @vpbe_dev: vpbe device ptr * @output: ptr to v4l2_output structure @@ -740,7 +718,7 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev) if (ret) { v4l2_err(&vpbe_dev->v4l2_dev, "Failed to set default output %s", def_output); - return ret; + goto fail_kfree_amp; } printk(KERN_NOTICE "Setting default mode to %s\n", def_mode); @@ -748,12 +726,15 @@ static int vpbe_initialize(struct device *dev, struct vpbe_device *vpbe_dev) if (ret) { v4l2_err(&vpbe_dev->v4l2_dev, "Failed to set default mode %s", def_mode); - return ret; + goto fail_kfree_amp; } vpbe_dev->initialized = 1; /* TBD handling of bootargs for default output and mode */ return 0; +fail_kfree_amp: + mutex_lock(&vpbe_dev->lock); + kfree(vpbe_dev->amp); fail_kfree_encoders: kfree(vpbe_dev->encoders); fail_dev_unregister: @@ -793,7 +774,6 @@ static void vpbe_deinitialize(struct device *dev, struct vpbe_device *vpbe_dev) } static const struct vpbe_device_ops vpbe_dev_ops = { - .g_cropcap = vpbe_g_cropcap, .enum_outputs = vpbe_enum_outputs, .set_output = vpbe_set_output, .get_output = vpbe_get_output, diff --git a/drivers/media/platform/davinci/vpbe_display.c b/drivers/media/platform/davinci/vpbe_display.c index 5c235898af7b..9e86b0d36640 100644 --- a/drivers/media/platform/davinci/vpbe_display.c +++ b/drivers/media/platform/davinci/vpbe_display.c @@ -759,18 +759,18 @@ static int vpbe_display_g_selection(struct file *file, void *priv, return 0; } -static int vpbe_display_cropcap(struct file *file, void *priv, - struct v4l2_cropcap *cropcap) +static int vpbe_display_g_pixelaspect(struct file *file, void *priv, + int type, struct v4l2_fract *f) { struct vpbe_layer *layer = video_drvdata(file); struct vpbe_device *vpbe_dev = layer->disp_dev->vpbe_dev; v4l2_dbg(1, debug, &vpbe_dev->v4l2_dev, "VIDIOC_CROPCAP ioctl\n"); - if (cropcap->type != V4L2_BUF_TYPE_VIDEO_OUTPUT) + if (type != V4L2_BUF_TYPE_VIDEO_OUTPUT) return -EINVAL; - cropcap->pixelaspect = vpbe_dev->current_timings.aspect; + *f = vpbe_dev->current_timings.aspect; return 0; } @@ -1263,7 +1263,7 @@ static const struct v4l2_ioctl_ops vpbe_ioctl_ops = { .vidioc_streamoff = vb2_ioctl_streamoff, .vidioc_expbuf = vb2_ioctl_expbuf, - .vidioc_cropcap = vpbe_display_cropcap, + .vidioc_g_pixelaspect = vpbe_display_g_pixelaspect, .vidioc_g_selection = vpbe_display_g_selection, .vidioc_s_selection = vpbe_display_s_selection, diff --git a/drivers/media/platform/davinci/vpfe_capture.c b/drivers/media/platform/davinci/vpfe_capture.c index ea3ddd5a42bd..9996bab98fe3 100644 --- a/drivers/media/platform/davinci/vpfe_capture.c +++ b/drivers/media/platform/davinci/vpfe_capture.c @@ -1558,20 +1558,20 @@ static int vpfe_streamoff(struct file *file, void *priv, return ret; } -static int vpfe_cropcap(struct file *file, void *priv, - struct v4l2_cropcap *crop) +static int vpfe_g_pixelaspect(struct file *file, void *priv, + int type, struct v4l2_fract *f) { struct vpfe_device *vpfe_dev = video_drvdata(file); - v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_cropcap\n"); + v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_g_pixelaspect\n"); - if (crop->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; /* If std_index is invalid, then just return (== 1:1 aspect) */ if (vpfe_dev->std_index >= ARRAY_SIZE(vpfe_standards)) return 0; - crop->pixelaspect = vpfe_standards[vpfe_dev->std_index].pixelaspect; + *f = vpfe_standards[vpfe_dev->std_index].pixelaspect; return 0; } @@ -1677,7 +1677,7 @@ static const struct v4l2_ioctl_ops vpfe_ioctl_ops = { .vidioc_dqbuf = vpfe_dqbuf, .vidioc_streamon = vpfe_streamon, .vidioc_streamoff = vpfe_streamoff, - .vidioc_cropcap = vpfe_cropcap, + .vidioc_g_pixelaspect = vpfe_g_pixelaspect, .vidioc_g_selection = vpfe_g_selection, .vidioc_s_selection = vpfe_s_selection, }; |