diff options
author | Sylwester Nawrocki <s.nawrocki@samsung.com> | 2011-01-14 23:17:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 03:54:20 -0400 |
commit | 91707b8b27a785c42949ba55b65f084027962afa (patch) | |
tree | a14bdf23a1115376d738ea0d09eb9c92d7aaa1be /drivers/media/video/s5p-fimc | |
parent | 1e00469599b5841f5b02c436b9958073a0ad576c (diff) |
[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.c | 27 |
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 b29937eba60..6c919b38a3d 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, | |||
804 | { | 804 | { |
805 | struct fimc_ctx *ctx = priv; | 805 | struct fimc_ctx *ctx = priv; |
806 | struct fimc_frame *frame; | 806 | struct fimc_frame *frame; |
807 | struct v4l2_pix_format_mplane *pixm; | ||
808 | int i; | ||
807 | 809 | ||
808 | frame = ctx_get_frame(ctx, f->type); | 810 | frame = ctx_get_frame(ctx, f->type); |
809 | if (IS_ERR(frame)) | 811 | if (IS_ERR(frame)) |
810 | return PTR_ERR(frame); | 812 | return PTR_ERR(frame); |
811 | 813 | ||
812 | f->fmt.pix.width = frame->width; | 814 | pixm = &f->fmt.pix_mp; |
813 | f->fmt.pix.height = frame->height; | 815 | |
814 | f->fmt.pix.field = V4L2_FIELD_NONE; | 816 | pixm->width = frame->width; |
815 | f->fmt.pix.pixelformat = frame->fmt->fourcc; | 817 | pixm->height = frame->height; |
818 | pixm->field = V4L2_FIELD_NONE; | ||
819 | pixm->pixelformat = frame->fmt->fourcc; | ||
820 | pixm->colorspace = V4L2_COLORSPACE_JPEG; | ||
821 | pixm->num_planes = frame->fmt->memplanes; | ||
822 | |||
823 | for (i = 0; i < pixm->num_planes; ++i) { | ||
824 | int bpl = frame->o_width; | ||
825 | |||
826 | if (frame->fmt->colplanes == 1) /* packed formats */ | ||
827 | bpl = (bpl * frame->fmt->depth[0]) / 8; | ||
828 | |||
829 | pixm->plane_fmt[i].bytesperline = bpl; | ||
830 | |||
831 | pixm->plane_fmt[i].sizeimage = (frame->o_width * | ||
832 | frame->o_height * frame->fmt->depth[i]) / 8; | ||
833 | } | ||
816 | 834 | ||
817 | return 0; | 835 | return 0; |
818 | } | 836 | } |
@@ -907,6 +925,7 @@ int fimc_vidioc_try_fmt_mplane(struct file *file, void *priv, | |||
907 | &pix->height, 8, variant->pix_limit->scaler_dis_w, mod_y, 0); | 925 | &pix->height, 8, variant->pix_limit->scaler_dis_w, mod_y, 0); |
908 | 926 | ||
909 | pix->num_planes = fmt->memplanes; | 927 | pix->num_planes = fmt->memplanes; |
928 | pix->colorspace = V4L2_COLORSPACE_JPEG; | ||
910 | 929 | ||
911 | for (i = 0; i < pix->num_planes; ++i) { | 930 | for (i = 0; i < pix->num_planes; ++i) { |
912 | int bpl = pix->plane_fmt[i].bytesperline; | 931 | int bpl = pix->plane_fmt[i].bytesperline; |