summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/s5p-fimc
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2011-01-15 01:17:42 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 04:54:20 -0300
commit91707b8b27a785c42949ba55b65f084027962afa (patch)
treea14bdf23a1115376d738ea0d09eb9c92d7aaa1be /drivers/media/video/s5p-fimc
parent1e00469599b5841f5b02c436b9958073a0ad576c (diff)
downloadblackbird-op-linux-91707b8b27a785c42949ba55b65f084027962afa.tar.gz
blackbird-op-linux-91707b8b27a785c42949ba55b65f084027962afa.zip
[media] s5p-fimc: Fix G_FMT ioctl handler
Use pix_mp member of struct v4l2_format to return a format description rather than pix. Also fill in the plane_fmt array. This is a missing bit of conversion to the multiplanar API. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/s5p-fimc')
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c
index b29937eba602..6c919b38a3d8 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -804,15 +804,33 @@ int fimc_vidioc_g_fmt_mplane(struct file *file, void *priv,
{
struct fimc_ctx *ctx = priv;
struct fimc_frame *frame;
+ struct v4l2_pix_format_mplane *pixm;
+ int i;
frame = ctx_get_frame(ctx, f->type);
if (IS_ERR(frame))
return PTR_ERR(frame);
- f->fmt.pix.width = frame->width;
- f->fmt.pix.height = frame->height;
- f->fmt.pix.field = V4L2_FIELD_NONE;
- f->fmt.pix.pixelformat = frame->fmt->fourcc;
+ pixm = &f->fmt.pix_mp;
+
+ pixm->width = frame->width;
+ pixm->height = frame->height;
+ pixm->field = V4L2_FIELD_NONE;
+ pixm->pixelformat = frame->fmt->fourcc;
+ pixm->colorspace = V4L2_COLORSPACE_JPEG;
+ pixm->num_planes = frame->fmt->memplanes;
+
+ for (i = 0; i < pixm->num_planes; ++i) {
+ int bpl = frame->o_width;
+
+ if (frame->fmt->colplanes == 1) /* packed formats */
+ bpl = (bpl * frame->fmt->depth[0]) / 8;
+
+ pixm->plane_fmt[i].bytesperline = bpl;
+
+ pixm->plane_fmt[i].sizeimage = (frame->o_width *
+ frame->o_height * frame->fmt->depth[i]) / 8;
+ }
return 0;
}
@@ -907,6 +925,7 @@ int fimc_vidioc_try_fmt_mplane(struct file *file, void *priv,
&pix->height, 8, variant->pix_limit->scaler_dis_w, mod_y, 0);
pix->num_planes = fmt->memplanes;
+ pix->colorspace = V4L2_COLORSPACE_JPEG;
for (i = 0; i < pix->num_planes; ++i) {
int bpl = pix->plane_fmt[i].bytesperline;
OpenPOWER on IntegriCloud